关于 reasoning
面向 Agent 的系统化推理模式技能,指导复杂问题拆解、逐步求解与答案核验,并提示常见逻辑错误。
主要功能
- 01按步骤拆解复杂问题
- 02使用反思清单检查答案
- 03提供多种验证策略
- 04识别常见推理错误
适用场景
- 01规划复杂任务的解决步骤
- 02检查算法或代码逻辑
- 03核对回答是否遗漏边界情况
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ alicoder001/ agent-skills --skill reasoning安装后在 Claude Code 中输入/reasoning确认已加载。
附带文件agents/openai.yaml
详细介绍
推理模式
通过系统化思考,准确解决问题。
说明
1. 思维链(CoT)
将复杂问题拆解为明确的推理步骤:
PROBLEM → ANALYZE → DECOMPOSE → SOLVE STEPS → VERIFY → SYNTHESIZE
## Thinking Process
1. **Understand**: What is being asked?
2. **Identify**: What information do I have?
3. **Plan**: What steps will solve this?
4. **Execute**: Work through each step
5. **Verify**: Is the solution correct?
2. 自我反思协议
在确定任何输出之前:
## Reflection Checklist
- [ ] Does this answer the actual question?
- [ ] Are there any logical errors?
- [ ] Did I miss edge cases?
- [ ] Is this the simplest solution?
- [ ] Would a senior developer approve this?
3. 问题分解
// ❌ Bad: Trying to solve everything at once
function solveComplexProblem() {
// 500 lines of tangled logic
}
// ✅ Good: Decomposed into clear steps
function solveComplexProblem() {
const parsed = parseInput();
const validated = validateData(parsed);
const processed = processData(validated);
return formatOutput(processed);
}
4. 验证策略
| 策略 | 适用场景 |
|---|---|
| 跟踪执行 | 算法逻辑 |
| 边界情况 | 输入验证 |
| 类型检查 | TypeScript 代码 |
| 单元测试 | 关键函数 |
| 手动演练 | 复杂流程 |
5. 错误检测
## Common Reasoning Errors
1. **Assumption Error**: Assuming facts not stated
2. **Logic Gap**: Missing intermediate steps
3. **Scope Creep**: Solving wrong problem
4. **Premature Optimization**: Overcomplicating
5. **Confirmation Bias**: Ignoring alternatives
6. 推理模板
复杂任务请使用此模板:
## Task: [Description]
### Understanding
- Goal: [What we need to achieve]
- Constraints: [Limitations]
- Inputs: [Available data]
### Approach
1. Step 1: [Description]
2. Step 2: [Description]
3. Step 3: [Description]
### Execution
[Work through each step]
### Verification
- [ ] Goal achieved
- [ ] Constraints satisfied
- [ ] No side effects
### Reflection
- What worked: [...]
- What could improve: [...]
参考资料
评论
支持 Markdown