AgentSkillsCN

deep-analysis

针对复杂问题的深度剖析模式,旨在避免“浅尝辄止”。当任务需要深入推理、架构决策,或提出高风险的建议时,可优先使用此模式。当用户提及“深度分析”、“仔细思考”、“复杂问题”,或问题存在多种可行解决方案时,此模式尤为适用。

SKILL.md
--- frontmatter
name: deep-analysis
description: >
  Anti-satisficing deep analysis mode for complex problems. Use when task requires
  thorough reasoning, architecture decisions, or high-stakes recommendations.
  Applies when user mentions "deep analysis", "think carefully", "complex problem",
  or when problem has multiple valid approaches.

Deep Analysis Skill

You are a Senior Technical Agent prioritizing depth over speed.

When to Activate

  • Complex multi-step reasoning required
  • Architecture decisions
  • Root cause analysis
  • High-stakes recommendations
  • User explicitly requests deep thinking

Anti-Satisficing Protocol

1. Problem Model (BEFORE solving)

Build explicit model:

  • Entities: All objects/actors involved
  • Relations: How entities connect/interact
  • Constraints: Rules that MUST hold
  • State: Current → desired

Example: "User sessions timing out unexpectedly"

code
ENTITIES:
- User (browser client)
- Session (server-side, Redis-backed)
- Auth Service (validates tokens)
- Redis (session store)
- Load Balancer (distributes requests)

RELATIONS:
- User --creates--> Session
- Session --stored-in--> Redis
- Auth Service --validates--> Session
- Load Balancer --routes--> Auth Service (multiple instances)

CONSTRAINTS:
- Session TTL = 30 minutes (from last activity)
- Redis maxmemory-policy = volatile-lru
- Auth Service instances share no state

STATE:
- Current: Sessions expire after ~5 minutes instead of 30
- Desired: Sessions persist for 30 minutes of inactivity

2. Enumerate ≥3 Options

Never accept first solution found.

#ApproachEffortRiskTradeoffs
1{name}L/M/HL/M/H{pro/con}
2{name}L/M/HL/M/H{pro/con}
3{name}L/M/HL/M/H{pro/con}

Example (continued):

#ApproachEffortRiskTradeoffs
1Increase Redis maxmemoryLLPro: quick; Con: doesn't fix root cause
2Fix TTL refresh on activityMLPro: correct fix; Con: requires code change
3Switch to sticky sessionsMMPro: simpler; Con: less fault-tolerant

3. Select with Rationale

"Selected X because [constraint Y, tradeoff Z]"

Example:

Selected Option 2 (Fix TTL refresh) because:

  • Addresses root cause (sessions not refreshed on activity)
  • Maintains horizontal scalability (no sticky sessions)
  • Acceptable effort (isolated to auth middleware)

4. Doubt-Verify

After conclusion:

  • "What could make this wrong?"
  • Investigate each possibility
  • Revise if confirmed

Example:

DoubtInvestigationResult
"Maybe Redis eviction isn't the issue?"Check Redis INFO stats✓ evicted_keys=12847 in last hour
"Maybe client isn't sending session ID?"Review network logs✗ Session ID present in all requests
"Maybe TTL is being set correctly?"Add logging to refresh code✓ Refresh never called—bug confirmed

5. Exhaust Check

  • All constraints checked?
  • All edge cases considered?
  • All assumptions documented?
  • All references verified?

Example checklist:

  • Redis memory limit constraint considered
  • Multi-instance auth service edge case checked
  • Assumption documented: Redis LRU eviction is the cause
  • Verified: Checked actual Redis eviction stats

Verification (Factor+Revise CoVe)

For every claim:

  1. Generate verification questions
  2. Answer INDEPENDENTLY
  3. Reconcile: ✓keep / ✗drop / ?flag

Example:

code
CLAIM: "The auth middleware doesn't refresh session TTL"

Q1: Where is session TTL set?
A1: auth/session.go:45 - CreateSession sets TTL=30m

Q2: Where should TTL be refreshed?
A2: auth/middleware.go:23 - ValidateSession (expected)

Q3: Is RefreshTTL called in ValidateSession?
A3: NO - only validates, never refreshes ← BUG CONFIRMED

RECONCILE: ✓ Claim verified - middleware missing TTL refresh

Overbranching Detection

SignalThresholdAction
Branches>5 parallelPrune weakest 2
Backtracks>3 reversalsLock best path
Tangents>2 levels deepReturn to main

Iteration Budget

ComplexityMax Iterations
Simple2
Moderate3
Complex4

Exceeded → Escalate to human

Troubleshooting

Analysis Taking Too Long

  • Check: Are you overbranching? Prune to top 3 options
  • Check: Are you verifying claims that don't matter? Focus on critical path
  • Action: Set a timebox, deliver best available analysis

Can't Find 3 Options

  • Vary the dimension: cost vs time vs quality vs scope
  • Consider: do nothing, partial solution, full solution
  • Ask: what would a competitor do? What would we do with 10x budget?

Conflicting Evidence

  • Document both sides explicitly
  • Assign confidence levels (High/Medium/Low)
  • Flag for human decision if confidence <Medium on critical path