关于 complex-reasoning
Complex Reasoning Skill 为需要系统分析问题的用户提供结构化推理框架,适用于调试、架构决策和根因分析等任务。它包含线性、分支式及假设驱动的方法,也提供依赖与影响分析模式。
主要功能
- 01提供 CoT、ToT 和 MECE 框架
- 02支持假设驱动的调试
- 03包含依赖关系分析模式
- 04提供变更影响分析模式
- 05给出推理过程的实践建议
适用场景
- 01分析复杂故障的可能原因
- 02比较架构方案的权衡
- 03调查生产事件的根本原因
- 04评估安全风险或重构影响
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ thelobbi/ claude --skill complex-reasoning安装后在 Claude Code 中输入/complex-reasoning确认已加载。
详细介绍
复杂推理技能
用于系统化解决问题的结构化推理框架,借助扩展思考能力进行深入分析。
使用场景
- 调试复杂问题,涉及多种潜在原因
- 架构决策,需要权衡分析
- 生产事故的根因分析
- 性能优化,涉及多个变量
- 安全漏洞评估
- 代码重构,涉及大量依赖项
推理框架
思维链(CoT)
针对顺序问题进行线性、逐步推理。
## Chain-of-Thought Analysis
**Problem**: [State the problem clearly]
**Step 1: Understand the Context**
- What do we know?
- What are the constraints?
- What is the expected outcome?
**Step 2: Identify Key Components**
- Component A: [description]
- Component B: [description]
- Interactions: [how they relate]
**Step 3: Analyze Each Component**
- Component A analysis...
- Component B analysis...
**Step 4: Synthesize Findings**
- Key insight 1
- Key insight 2
**Step 5: Formulate Solution**
- Recommended approach
- Rationale
- Trade-offs
**Conclusion**: [Final recommendation with confidence level]
思维树(ToT)
针对存在多种解决路径的问题进行分支探索。
## Tree-of-Thought Exploration
**Root Problem**: [Problem statement]
### Branch 1: Approach A
├── Pros: [List advantages]
├── Cons: [List disadvantages]
├── Feasibility: [High/Medium/Low]
├── Sub-branch 1.1: [Variation]
│ └── Outcome: [Expected result]
└── Sub-branch 1.2: [Variation]
└── Outcome: [Expected result]
### Branch 2: Approach B
├── Pros: [List advantages]
├── Cons: [List disadvantages]
├── Feasibility: [High/Medium/Low]
└── Sub-branches: [...]
### Branch 3: Approach C
├── Pros: [...]
├── Cons: [...]
└── Feasibility: [...]
### Evaluation Matrix
| Approach | Feasibility | Impact | Risk | Score |
|----------|-------------|--------|------|-------|
| A | High | Medium | Low | 8/10 |
| B | Medium | High | Med | 7/10 |
| C | Low | High | High | 5/10 |
**Selected Path**: Branch [X] because [reasoning]
MECE 框架
相互独立、完全穷尽的分析。
## MECE Analysis
**Problem Space**: [Define the complete problem]
### Category 1: [Mutually exclusive category]
- Sub-element 1.1
- Sub-element 1.2
- Sub-element 1.3
### Category 2: [Mutually exclusive category]
- Sub-element 2.1
- Sub-element 2.2
### Category 3: [Mutually exclusive category]
- Sub-element 3.1
- Sub-element 3.2
- Sub-element 3.3
**Completeness Check**:
- [ ] Categories are mutually exclusive (no overlap)
- [ ] Categories are collectively exhaustive (cover all cases)
- [ ] Each sub-element belongs to exactly one category
**Priority Matrix**:
| Category | Urgency | Impact | Action |
|----------|---------|--------|--------|
| 1 | High | High | Now |
| 2 | Medium | High | Next |
| 3 | Low | Medium | Later |
假设驱动调试
系统化调试复杂问题的方法。
## Hypothesis-Driven Debug Session
**Symptom**: [Observed behavior]
**Expected**: [What should happen]
**Environment**: [Relevant context]
### Hypothesis 1: [Most likely cause]
**Evidence For**:
- [Supporting observation 1]
- [Supporting observation 2]
**Evidence Against**:
- [Contradicting observation]
**Test**: [How to validate]
**Result**: [Confirmed/Refuted]
### Hypothesis 2: [Second most likely]
**Evidence For**:
- [...]
**Evidence Against**:
- [...]
**Test**: [...]
**Result**: [...]
### Root Cause Identified
**Cause**: [Confirmed root cause]
**Evidence Chain**: [How we proved it]
**Fix**: [Remediation steps]
**Prevention**: [How to prevent recurrence]
代码分析模式
依赖分析
## Dependency Analysis: [Component Name]
### Direct Dependencies
| Dependency | Version | Purpose | Risk Level |
|------------|---------|---------|------------|
| dep-a | 2.3.1 | Auth | Low |
| dep-b | 1.0.0 | Data | Medium |
### Transitive Dependencies
- Total: [N] packages
- Security vulnerabilities: [N]
- Outdated: [N]
### Dependency Graph
[component] ├── dep-a │ ├── sub-dep-1 │ └── sub-dep-2 └── dep-b └── sub-dep-3
### Risk Assessment
1. **High Risk**: [Dependencies with known issues]
2. **Medium Risk**: [Outdated or unmaintained]
3. **Low Risk**: [Stable, well-maintained]
### Recommendations
1. [Action item 1]
2. [Action item 2]
影响分析
## Impact Analysis: [Proposed Change]
### Affected Components
| Component | Impact Type | Severity | Test Required |
|-----------|-------------|----------|---------------|
| Service A | Direct | High | Yes |
| Service B | Indirect | Medium | Yes |
| Client C | Downstream | Low | Optional |
### Risk Assessment
- **Breaking Changes**: [List any]
- **Performance Impact**: [Expected effect]
- **Data Migration**: [Required/Not required]
### Rollback Plan
1. [Step 1]
2. [Step 2]
3. [Verification]
### Recommendation
[Go/No-Go with reasoning]
与扩展思考结合使用
将这些框架与扩展思考结合使用时:
# Enable extended thinking for complex reasoning
response = client.messages.create(
model="claude-opus-4-8",
max_tokens=16000,
thinking={"type": "adaptive"},
output_config={"effort": "high"}, # deeper reasoning for complex problems
system="""You are a systematic problem solver. Use structured
reasoning frameworks like Chain-of-Thought, Tree-of-Thought,
or MECE analysis as appropriate for the problem.""",
messages=[{
"role": "user",
"content": "Analyze this architecture decision using ToT..."
}]
)
最佳实践
- 选择合适的框架:线性问题使用 CoT,分支决策使用 ToT
- 记录推理过程:便于审查和复用
- 验证假设:每个步骤都应建立在已验证的事实之上
- 考虑替代方案:始终至少探索 2–3 种方法
- 尽可能量化:使用指标比较选项
- 限制探索时间:为分析深度设定上限
另请参阅
- [[extended-thinking]] - 启用深度推理能力
- [[deep-analysis]] - 分析模板
- [[debugging]] - 通用调试模式
- [[testing]] - 验证策略
评论
支持 Markdown