investigate

GitHub

基于铁律方法论的系统化调试技能,通过五阶段流程(证据收集、模式分析、假设测试、最小修复、验证报告)定位根因并生成结构化JSON报告。

.claude/skills/investigate/SKILL.md catlog22/Claude-Code-Workflow

Trigger Scenarios

investigate debug root cause

Install

npx skills add catlog22/Claude-Code-Workflow --skill investigate -g -y
More Options

Non-standard path

npx skills add https://github.com/catlog22/Claude-Code-Workflow/tree/main/.claude/skills/investigate -g -y

Use without installing

npx skills use catlog22/Claude-Code-Workflow@investigate

指定 Agent (Claude Code)

npx skills add catlog22/Claude-Code-Workflow --skill investigate -a claude-code -g -y

安装 repo 全部 skill

npx skills add catlog22/Claude-Code-Workflow --all -g -y

预览 repo 内 skill

npx skills add catlog22/Claude-Code-Workflow --list

SKILL.md

Frontmatter
{
    "name": "investigate",
    "description": "Systematic debugging with Iron Law methodology. 5-phase investigation from evidence collection to verified fix. Triggers on \"investigate\", \"debug\", \"root cause\".",
    "allowed-tools": "Bash, Read, Write, Edit, Glob, Grep"
}

Investigate

Systematic debugging skill that enforces the Iron Law: never fix without a confirmed root cause. Produces a structured debug report with full evidence chain, minimal fix, and regression test.

Iron Law Principle

No fix without confirmed root cause. Every investigation follows a strict evidence chain:

  1. Reproduce the bug with concrete evidence
  2. Analyze patterns to assess scope
  3. Form and test hypotheses (max 3 strikes)
  4. Implement minimal fix ONLY after root cause is confirmed
  5. Verify fix and generate structured report

Violation of the Iron Law (skipping to Phase 4 without Phase 3 confirmation) is prohibited.

Key Design Principles

  1. Evidence-First: Collect before theorizing. Logs, stack traces, and reproduction steps are mandatory inputs.
  2. Minimal Fix: Change only what is necessary. Refactoring is not debugging.
  3. 3-Strike Escalation: If 3 consecutive hypothesis tests fail, STOP and escalate with a diagnostic dump.
  4. Regression Coverage: Every fix must include a test that fails without the fix and passes with it.
  5. Structured Output: All findings are recorded in machine-readable JSON for future reference.

Execution Flow

Phase 1: Root Cause Investigation
  Reproduce bug, collect evidence (errors, logs, traces)
  Use ccw cli --tool gemini --mode analysis for initial diagnosis
  Output: investigation-report.json
      |
      v
Phase 2: Pattern Analysis
  Search codebase for similar patterns (same error, module, antipattern)
  Assess scope: isolated vs systemic
  Output: pattern-analysis section in report
      |
      v
Phase 3: Hypothesis Testing
  Form max 3 hypotheses from evidence
  Test each with minimal read-only probes
  3-strike rule: STOP and escalate on 3 consecutive failures
  Output: confirmed root cause with evidence chain
      |
      v
Phase 4: Implementation  [GATE: requires Phase 3 confirmed root cause]
  Implement minimal fix
  Add regression test
  Verify fix resolves reproduction case
      |
      v
Phase 5: Verification & Report
  Run full test suite
  Check for regressions
  Generate structured debug report to .workflow/.debug/

Directory Setup

mkdir -p .workflow/.debug

Output Structure

.workflow/.debug/
  debug-report-{YYYY-MM-DD}-{slug}.json    # Structured debug report

Completion Status Protocol

This skill follows the Completion Status Protocol defined in _shared/SKILL-DESIGN-SPEC.md sections 13-14.

Status When
DONE Root cause confirmed, fix applied, regression test passes, no regressions
DONE_WITH_CONCERNS Fix applied but partial test coverage or minor warnings
BLOCKED Cannot reproduce bug, or 3-strike escalation triggered in Phase 3
NEEDS_CONTEXT Missing reproduction steps, unclear error conditions

Reference Documents

Document Purpose
phases/01-root-cause-investigation.md Evidence collection and reproduction
phases/02-pattern-analysis.md Codebase pattern search and scope assessment
phases/03-hypothesis-testing.md Hypothesis formation, testing, and 3-strike rule
phases/04-implementation.md Minimal fix with Iron Law gate
phases/05-verification-report.md Test suite, regression check, report generation
specs/iron-law.md Iron Law rules definition
specs/debug-report-format.md Structured debug report JSON schema

CLI Integration

This skill leverages ccw cli for multi-model analysis at key points:

Phase CLI Usage Mode
Phase 1 Initial diagnosis from error evidence --mode analysis
Phase 2 Cross-file pattern search --mode analysis
Phase 3 Hypothesis validation assistance --mode analysis

All CLI calls use --mode analysis (read-only). No write-mode CLI calls during investigation phases 1-3.

Version History

  • 07491b0 Current 2026-07-25 09:30

Same Skill Collection

.claude/skills/brainstorm/SKILL.md
.claude/skills/ccw-chain/SKILL.md
.claude/skills/ccw-help/SKILL.md
.claude/skills/delegation-check/SKILL.md
.claude/skills/issue-manage/SKILL.md
.claude/skills/memory-capture/SKILL.md
.claude/skills/memory-manage/SKILL.md
.claude/skills/prompt-generator/SKILL.md
.claude/skills/review-code/SKILL.md
.claude/skills/review-cycle/SKILL.md
.claude/skills/security-audit/SKILL.md
.claude/skills/ship/SKILL.md
.claude/skills/skill-generator/SKILL.md
.claude/skills/skill-iter-tune/SKILL.md
.claude/skills/skill-simplify/SKILL.md
.claude/skills/skill-tuning/SKILL.md
.claude/skills/spec-generator/SKILL.md
.claude/skills/team-arch-opt/SKILL.md
.claude/skills/team-brainstorm/SKILL.md
.claude/skills/team-coordinate/SKILL.md
.claude/skills/team-designer/SKILL.md
.claude/skills/team-executor/SKILL.md
.claude/skills/team-frontend-debug/SKILL.md
.claude/skills/team-frontend/SKILL.md
.claude/skills/team-interactive-craft/SKILL.md
.claude/skills/team-issue/SKILL.md
.claude/skills/team-lifecycle-v4/SKILL.md
.claude/skills/team-motion-design/SKILL.md
.claude/skills/team-perf-opt/SKILL.md
.claude/skills/team-planex/SKILL.md
.claude/skills/team-quality-assurance/SKILL.md
.claude/skills/team-review/SKILL.md
.claude/skills/team-roadmap-dev/SKILL.md
.claude/skills/team-tech-debt/SKILL.md
.claude/skills/team-testing/SKILL.md
.claude/skills/team-ui-polish/SKILL.md
.claude/skills/team-uidesign/SKILL.md
.claude/skills/team-ultra-analyze/SKILL.md
.claude/skills/team-ux-improve/SKILL.md
.claude/skills/team-visual-a11y/SKILL.md
.claude/skills/wf-composer/SKILL.md
.claude/skills/wf-player/SKILL.md
.claude/skills/workflow-execute/SKILL.md
.claude/skills/workflow-lite-execute/SKILL.md
.claude/skills/workflow-lite-plan/SKILL.md
.claude/skills/workflow-lite-test-review/SKILL.md
.claude/skills/workflow-multi-cli-plan/SKILL.md
.claude/skills/workflow-plan/SKILL.md
.claude/skills/workflow-skill-designer/SKILL.md

Metadata

Files
0
Version
07491b0
Hash
edb9d9a3
Indexed
2026-07-25 09:30

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-21 03:28
浙ICP备14020137号-1 $방문자$