self-reflecting-chain by kimasplund/claude_cognitive_reasoning
npx skills add https://github.com/kimasplund/claude_cognitive_reasoning --skill self-reflecting-chain目的:通过每一步的深度自我反思进行顺序逐步推理。与并行探索(ToT/BoT)不同,此方法遵循单一逻辑链,反思每一步的有效性,并在检测到错误时回溯。
✅ 适用于:
❌ 不适用于:
示例:
目标:将问题分解为顺序逻辑步骤
操作:
示例(调试):
Start: System crashes when user clicks "Submit"
Goal: Identify root cause
Steps:
1. Trace user action to event handler
2. Check event handler for errors
3. Trace data flow to backend
4. Check backend validation logic
5. Inspect database query execution
6. Identify exact failure point
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
对于每个步骤:
步骤模板:
## Step [N]: [Action]
### Execution
[Perform the reasoning or analysis]
### Result
[What was discovered/concluded]
### Self-Reflection
- **Confidence**: [0-100]%
- **Assumptions**: [What assumptions does this step make?]
- **Logic Check**: [Is the reasoning sound?]
- **Dependencies**: [Does this depend on previous steps being correct?]
- **Potential Errors**: [What could be wrong with this step?]
### Decision
- ✅ **Proceed** to Step [N+1] (confidence ≥70%)
- ⚠️ **Low Confidence** but proceeding (60-69%)
- ❌ **Backtrack** to Step [N-X] (confidence <60%)
触发回溯的条件:
回溯过程:
回溯示例:
## Step 5: [Attempted reasoning]
→ Result: Contradiction detected
→ Confidence: 25% (contradicts Step 3 result)
**Backtrack Decision**: Return to Step 3, try alternative interpretation
## Step 3 (Revised): [Alternative reasoning]
→ Result: New interpretation consistent
→ Confidence: 80%
→ Proceed to Step 4 with revised understanding...
在每一步,验证迄今为止的整个链:
验证清单:
完成链后:
综合模板:
## Reasoning Chain Complete
### Complete Path
1. [Step 1] → Result: [X] (Confidence: 85%)
2. [Step 2] → Result: [Y] (Confidence: 90%)
3. [Step 3] → Result: [Z] (Confidence: 75%)
4. [Step 4] → Result: [A] (Confidence: 88%)
5. [Step 5] → Result: [B] (Confidence: 82%)
### Overall Confidence
**Minimum**: 75% (Step 3 was lowest)
**Chain Confidence**: 75% (limited by weakest link)
### Backtracks
- Backtracked from Step 4 to Step 2 (logic error)
- Alternative path tried at Step 3 (failed, original was correct)
### Final Conclusion
[Answer based on complete reasoning chain]
**Reasoning Trace**: Step 1 → Step 2 → Step 3 → Step 4 → Step 5 → Conclusion
| 问题类型 | 使用自我反思链 | 使用 ToT/BoT |
|---|---|---|
| 依赖关系 | 顺序步骤 | 独立路径 |
| 目标 | 单一逻辑结论 | 探索选项 |
| 方法 | 逐步推理 | 并行分支 |
| 回溯 | 返回上一步 | 剪枝分支 |
| 输出 | 推理轨迹 | 多个解决方案 |
自我反思链是一种系统化方法,用于:
当顺序重要、存在依赖关系,并且你需要一个带有完整推理轨迹的正确答案时使用它。
记住:链置信度 = 最低步骤置信度。一个具有 95% 置信度的链,如果其中一步只有 60% 置信度,则整体置信度为 60%。加强最薄弱的环节。
每周安装次数
73
代码仓库
GitHub 星标数
2
首次出现
2026年1月25日
安全审计
安装于
gemini-cli69
opencode66
github-copilot63
codex63
cursor61
amp61
Purpose : Sequential step-by-step reasoning with deep self-reflection at each step. Unlike parallel exploration (ToT/BoT), this follows a single logical chain, reflects on each step's validity, and backtracks when errors detected.
✅ Use when:
❌ Don't use when:
Examples :
Objective : Break problem into sequential logical steps
Actions :
Example (Debugging):
Start: System crashes when user clicks "Submit"
Goal: Identify root cause
Steps:
1. Trace user action to event handler
2. Check event handler for errors
3. Trace data flow to backend
4. Check backend validation logic
5. Inspect database query execution
6. Identify exact failure point
For each step :
Step Template :
## Step [N]: [Action]
### Execution
[Perform the reasoning or analysis]
### Result
[What was discovered/concluded]
### Self-Reflection
- **Confidence**: [0-100]%
- **Assumptions**: [What assumptions does this step make?]
- **Logic Check**: [Is the reasoning sound?]
- **Dependencies**: [Does this depend on previous steps being correct?]
- **Potential Errors**: [What could be wrong with this step?]
### Decision
- ✅ **Proceed** to Step [N+1] (confidence ≥70%)
- ⚠️ **Low Confidence** but proceeding (60-69%)
- ❌ **Backtrack** to Step [N-X] (confidence <60%)
Trigger backtracking when:
Backtracking Process :
Backtracking Example :
## Step 5: [Attempted reasoning]
→ Result: Contradiction detected
→ Confidence: 25% (contradicts Step 3 result)
**Backtrack Decision**: Return to Step 3, try alternative interpretation
## Step 3 (Revised): [Alternative reasoning]
→ Result: New interpretation consistent
→ Confidence: 80%
→ Proceed to Step 4 with revised understanding...
At each step , validate the entire chain so far:
Validation Checklist :
After completing chain :
Synthesis Template :
## Reasoning Chain Complete
### Complete Path
1. [Step 1] → Result: [X] (Confidence: 85%)
2. [Step 2] → Result: [Y] (Confidence: 90%)
3. [Step 3] → Result: [Z] (Confidence: 75%)
4. [Step 4] → Result: [A] (Confidence: 88%)
5. [Step 5] → Result: [B] (Confidence: 82%)
### Overall Confidence
**Minimum**: 75% (Step 3 was lowest)
**Chain Confidence**: 75% (limited by weakest link)
### Backtracks
- Backtracked from Step 4 to Step 2 (logic error)
- Alternative path tried at Step 3 (failed, original was correct)
### Final Conclusion
[Answer based on complete reasoning chain]
**Reasoning Trace**: Step 1 → Step 2 → Step 3 → Step 4 → Step 5 → Conclusion
| Problem Type | Use Self-Reflecting Chain | Use ToT/BoT |
|---|---|---|
| Dependencies | Sequential steps | Independent paths |
| Goal | Single logical conclusion | Explore options |
| Method | Step-by-step reasoning | Parallel branches |
| Backtracking | Return to previous step | Prune branches |
| Output | Reasoning trace | Multiple solutions |
Self-Reflecting Chain is systematic methodology for:
Use it when order matters, dependencies exist, and you need one correct answer with full reasoning trace.
Remember : Chain confidence = minimum step confidence. A 95% confident chain with one 60% step has 60% overall confidence. Strengthen the weakest link.
Weekly Installs
73
Repository
GitHub Stars
2
First Seen
Jan 25, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
gemini-cli69
opencode66
github-copilot63
codex63
cursor61
amp61
AI 代码实施计划编写技能 | 自动化开发任务分解与 TDD 流程规划工具
50,900 周安装