complex-reasoning

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Complex Reasoning Skill

复杂推理Skill

Structured reasoning frameworks for systematic problem solving, leveraging extended thinking capabilities for deep analysis.
用于系统性解决问题的结构化推理框架,借助深度思考能力进行深度分析。

When to Use

适用场景

  • Debugging complex issues with multiple potential causes
  • Architecture decisions requiring trade-off analysis
  • Root cause analysis for production incidents
  • Performance optimization with multiple variables
  • Security vulnerability assessment
  • Code refactoring with many dependencies
  • 调试复杂问题:存在多个潜在原因的情况
  • 架构决策:需要进行权衡分析的场景
  • 生产事故根因分析
  • 多变量性能优化
  • 安全漏洞评估
  • 多依赖代码重构

Reasoning Frameworks

推理框架

Chain-of-Thought (CoT)

Chain-of-Thought (CoT)

Linear step-by-step reasoning for sequential problems.
markdown
undefined
适用于顺序问题的线性逐步推理方法。
markdown
undefined

Chain-of-Thought Analysis

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]
undefined
Problem: [清晰陈述问题]
Step 1: Understand the Context
  • 我们已知什么?
  • 约束条件有哪些?
  • 预期结果是什么?
Step 2: Identify Key Components
  • 组件A:[描述]
  • 组件B:[描述]
  • 交互关系:[组件间的关联方式]
Step 3: Analyze Each Component
  • 组件A分析...
  • 组件B分析...
Step 4: Synthesize Findings
  • 关键洞察1
  • 关键洞察2
Step 5: Formulate Solution
  • 推荐方案
  • 理由说明
  • 权衡取舍
Conclusion: [带有置信度的最终建议]
undefined

Tree-of-Thought (ToT)

Tree-of-Thought (ToT)

Branching exploration for problems with multiple solution paths.
markdown
undefined
适用于存在多个解决方案路径的分支探索方法。
markdown
undefined

Tree-of-Thought Exploration

Tree-of-Thought Exploration

Root Problem: [Problem statement]
Root Problem: [问题陈述]

Branch 1: Approach A

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]
├── Pros: [列出优势] ├── Cons: [列出劣势] ├── Feasibility: [高/中/低] ├── Sub-branch 1.1: [变体方案] │ └── Outcome: [预期结果] └── Sub-branch 1.2: [变体方案] └── Outcome: [预期结果]

Branch 2: Approach B

Branch 2: Approach B

├── Pros: [List advantages] ├── Cons: [List disadvantages] ├── Feasibility: [High/Medium/Low] └── Sub-branches: [...]
├── Pros: [列出优势] ├── Cons: [列出劣势] ├── Feasibility: [高/中/低] └── Sub-branches: [...]

Branch 3: Approach C

Branch 3: Approach C

├── Pros: [...] ├── Cons: [...] └── Feasibility: [...]
├── Pros: [...] ├── Cons: [...] └── Feasibility: [...]

Evaluation Matrix

Evaluation Matrix

ApproachFeasibilityImpactRiskScore
AHighMediumLow8/10
BMediumHighMed7/10
CLowHighHigh5/10
Selected Path: Branch [X] because [reasoning]
undefined
ApproachFeasibilityImpactRiskScore
AHighMediumLow8/10
BMediumHighMed7/10
CLowHighHigh5/10
Selected Path: Branch [X] because [推理过程]
undefined

MECE Framework

MECE Framework

Mutually Exclusive, Collectively Exhaustive analysis.
markdown
undefined
相互独立、完全穷尽(Mutually Exclusive, Collectively Exhaustive)分析方法。
markdown
undefined

MECE Analysis

MECE Analysis

Problem Space: [Define the complete problem]
Problem Space: [定义完整问题范围]

Category 1: [Mutually exclusive category]

Category 1: [相互独立的类别]

  • Sub-element 1.1
  • Sub-element 1.2
  • Sub-element 1.3
  • 子元素1.1
  • 子元素1.2
  • 子元素1.3

Category 2: [Mutually exclusive category]

Category 2: [相互独立的类别]

  • Sub-element 2.1
  • Sub-element 2.2
  • 子元素2.1
  • 子元素2.2

Category 3: [Mutually exclusive category]

Category 3: [相互独立的类别]

  • 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:
CategoryUrgencyImpactAction
1HighHighNow
2MediumHighNext
3LowMediumLater
undefined
  • 子元素3.1
  • 子元素3.2
  • 子元素3.3
Completeness Check:
  • 类别间相互独立(无重叠)
  • 类别集合完全穷尽(覆盖所有情况)
  • 每个子元素仅属于一个类别
Priority Matrix:
CategoryUrgencyImpactAction
1HighHighNow
2MediumHighNext
3LowMediumLater
undefined

Hypothesis-Driven Debugging

Hypothesis-Driven Debugging

Systematic approach to debugging complex issues.
markdown
undefined
用于调试复杂问题的系统性方法。
markdown
undefined

Hypothesis-Driven Debug Session

Hypothesis-Driven Debug Session

Symptom: [Observed behavior] Expected: [What should happen] Environment: [Relevant context]
Symptom: [观察到的行为] Expected: [预期行为] Environment: [相关上下文]

Hypothesis 1: [Most likely cause]

Hypothesis 1: [最可能的原因]

Evidence For:
  • [Supporting observation 1]
  • [Supporting observation 2]
Evidence Against:
  • [Contradicting observation]
Test: [How to validate] Result: [Confirmed/Refuted]
Evidence For:
  • [支持性观察1]
  • [支持性观察2]
Evidence Against:
  • [矛盾性观察]
Test: [验证方法] Result: [已确认/已推翻]

Hypothesis 2: [Second most likely]

Hypothesis 2: [次可能的原因]

Evidence For:
  • [...]
Evidence Against:
  • [...]
Test: [...] Result: [...]
Evidence For:
  • [...]
Evidence Against:
  • [...]
Test: [...] Result: [...]

Root Cause Identified

Root Cause Identified

Cause: [Confirmed root cause] Evidence Chain: [How we proved it] Fix: [Remediation steps] Prevention: [How to prevent recurrence]
undefined
Cause: [已确认的根因] Evidence Chain: [验证过程] Fix: [修复步骤] Prevention: [预防措施]
undefined

Code Analysis Patterns

代码分析模式

Dependency Analysis

依赖分析

markdown
undefined
markdown
undefined

Dependency Analysis: [Component Name]

Dependency Analysis: [组件名称]

Direct Dependencies

Direct Dependencies

DependencyVersionPurposeRisk Level
dep-a2.3.1AuthLow
dep-b1.0.0DataMedium
DependencyVersionPurposeRisk Level
dep-a2.3.1AuthLow
dep-b1.0.0DataMedium

Transitive Dependencies

Transitive Dependencies

  • Total: [N] packages
  • Security vulnerabilities: [N]
  • Outdated: [N]
  • Total: [N] packages
  • Security vulnerabilities: [N]
  • Outdated: [N]

Dependency Graph

Dependency Graph

[component]
├── dep-a
│   ├── sub-dep-1
│   └── sub-dep-2
└── dep-b
    └── sub-dep-3
[component]
├── dep-a
│   ├── sub-dep-1
│   └── sub-dep-2
└── dep-b
    └── sub-dep-3

Risk Assessment

Risk Assessment

  1. High Risk: [Dependencies with known issues]
  2. Medium Risk: [Outdated or unmaintained]
  3. Low Risk: [Stable, well-maintained]
  1. High Risk: [存在已知问题的依赖]
  2. Medium Risk: [过时或无人维护的依赖]
  3. Low Risk: [稳定且维护良好的依赖]

Recommendations

Recommendations

  1. [Action item 1]
  2. [Action item 2]
undefined
  1. [行动项1]
  2. [行动项2]
undefined

Impact Analysis

影响分析

markdown
undefined
markdown
undefined

Impact Analysis: [Proposed Change]

Impact Analysis: [拟议变更]

Affected Components

Affected Components

ComponentImpact TypeSeverityTest Required
Service ADirectHighYes
Service BIndirectMediumYes
Client CDownstreamLowOptional
ComponentImpact TypeSeverityTest Required
Service ADirectHighYes
Service BIndirectMediumYes
Client CDownstreamLowOptional

Risk Assessment

Risk Assessment

  • Breaking Changes: [List any]
  • Performance Impact: [Expected effect]
  • Data Migration: [Required/Not required]
  • Breaking Changes: [列出所有变更]
  • Performance Impact: [预期影响]
  • Data Migration: [需要/不需要]

Rollback Plan

Rollback Plan

  1. [Step 1]
  2. [Step 2]
  3. [Verification]
  1. [步骤1]
  2. [步骤2]
  3. [验证环节]

Recommendation

Recommendation

[Go/No-Go with reasoning]
undefined
[执行/不执行,附推理过程]
undefined

Integration with Extended Thinking

与深度思考的集成

When using these frameworks with extended thinking:
python
undefined
在结合深度思考能力使用这些框架时:
python
undefined

Enable extended thinking for complex reasoning

Enable extended thinking for complex reasoning

response = client.messages.create( model="claude-opus-4-5-20250514", max_tokens=16000, thinking={ "type": "enabled", "budget_tokens": 15000 # Higher budget for complex reasoning }, 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..." }] )
undefined
response = client.messages.create( model="claude-opus-4-5-20250514", max_tokens=16000, thinking={ "type": "enabled", "budget_tokens": 15000 # Higher budget for complex reasoning }, 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..." }] )
undefined

Best Practices

最佳实践

  1. Choose the right framework: CoT for linear problems, ToT for branching decisions
  2. Document your reasoning: Makes it reviewable and repeatable
  3. Validate assumptions: Each step should build on verified facts
  4. Consider alternatives: Always explore at least 2-3 approaches
  5. Quantify when possible: Use metrics to compare options
  6. Time-box exploration: Set limits on analysis depth
  1. 选择合适的框架:线性问题选用CoT,分支决策选用ToT
  2. 记录推理过程:便于审核和重复执行
  3. 验证假设:每一步都应基于已验证的事实
  4. 考虑替代方案:始终探索至少2-3种不同方法
  5. 尽可能量化:使用指标对比不同选项
  6. 设定分析时限:限制分析的深度范围

See Also

相关链接

  • [[extended-thinking]] - Enable deep reasoning capabilities
  • [[deep-analysis]] - Analytical templates
  • [[debugging]] - General debugging patterns
  • [[testing]] - Validation strategies
  • [[extended-thinking]] - 启用深度推理能力
  • [[deep-analysis]] - 分析模板
  • [[debugging]] - 通用调试模式
  • [[testing]] - 验证策略