원클릭으로
flow-code-debug
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Internal pipeline engine. Manages the entire pipeline (brainstorm, plan, plan-review, work, impl-review, close) via flowctl phase commands. Invoked by /flow-code:go.
Use when exploring requirements before planning. Pressure-tests ideas, generates approaches, and outputs a requirements doc for /flow-code:plan. Supports --auto mode for AI self-interview (no human input needed).
Use when exploring requirements before planning. Pressure-tests ideas, generates approaches, and outputs a requirements doc for /flow-code:plan.
Use when planning features or designing implementation. Triggers on /flow-code:plan with text descriptions or Flow IDs.
Use when reviewing code changes — self-review in Worker Phase 6, impl-review, or PR review. Applies five-axis scoring with severity labels.
Use when implementing a plan or working through a spec. Triggers on /flow-code:work with Flow IDs.
| name | flow-code-debug |
| description | Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes |
| tier | 2 |
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
If you haven't completed Phase 1, you cannot propose fixes.
BEFORE attempting ANY fix:
Read error messages completely — stack traces, line numbers, error codes. Don't skip.
Reproduce consistently — exact steps, every time. If not reproducible, STOP — gather more data (logs, environment, timing). Do NOT proceed to Phase 2 without reproduction. Guessing without reproduction = symptom fixing.
Check recent changes:
git log --oneline -10
git diff HEAD~3
Run guards to establish baseline:
<FLOWCTL> guard
Gather evidence in multi-component systems:
Trace data flow — where does the bad value originate? Trace backward through the call chain to the source. Fix at source, not at symptom.
After Phase 1, before Pattern Analysis. Uses RepoPrompt to gather cross-file context around the bug. Three-tier fallback — skip entirely if RP is unavailable.
IF mcp__RepoPrompt__context_builder is available (check your tool list):
Call context_builder with:
instructions: "Investigate bug: <symptoms from Phase 1>. Hypotheses: <your hypotheses>.
Trace the data flow, find related code paths, and identify likely root cause."
response_type: "question"
Timeout: 120 seconds. If no response within 120s, log:
"RP context_builder timed out after 120s, skipping RP investigation"
and proceed to Phase 2.
ELIF rp-cli is available (check: which rp-cli >/dev/null 2>&1):
Run with 120s timeout:
timeout 120 rp-cli -e 'builder "Investigate bug: <symptoms>. Hypotheses: <hypotheses>.
Trace data flow, find related code paths, identify likely root cause."
--response-type question'
If timeout or failure, log:
"rp-cli builder timed out or failed, skipping RP investigation"
and proceed to Phase 2.
ELSE (no RP available):
Skip Phase 1.5 entirely — proceed to Phase 2 (existing behavior, zero change).
END
Use RP findings to guide Phase 2: RP may surface related code, similar patterns, or architectural context that informs your pattern analysis. Feed these findings into Phase 2 as additional evidence alongside your own investigation.
Write failing test (if TDD mode or test framework available):
# Test must fail, proving the bug exists
<FLOWCTL> guard --layer <affected-layer>
Implement single fix — address root cause, ONE change, no "while I'm here" improvements. No bundling: Do NOT fix multiple things at once. If you're tempted to "also fix this other thing", STOP — commit the single fix first, verify, then address the next issue separately.
Verify fix:
<FLOWCTL> guard
If fix doesn't work — failure escalation:
Track your attempt count. Each failed fix escalates the response:
| Attempt | Level | Forced Action |
|---|---|---|
| 2nd | L1 — Switch approach | Use a fundamentally different method. Tweaking the same logic doesn't count. |
| 3rd | L2 — Deep investigation | Search online + read source code + list 3 distinct hypotheses before trying anything. |
| 4th | L3 — 7-point checklist | Complete ALL items below. Skipping any = you're still guessing. |
| 5th+ | L4 — Architecture review | STOP. Discuss with user. This is not a bug — it's a design problem. |
All 7 must be checked before attempting another fix at L3+.
| Excuse | Reality |
|---|---|
| "Issue is simple, don't need process" | Simple issues have root causes too |
| "Emergency, no time" | Systematic is FASTER than guess-and-check |
| "Multiple fixes at once saves time" | Can't isolate what worked; causes new bugs |
| "I see the problem, let me fix it" | Seeing symptoms != understanding root cause |
| "One more fix attempt" (after 2+) | 3+ failures = architectural problem |
| "Tried everything" | Did you search? Read source? Complete the 7-point checklist? |
| "Probably an environment issue" | Did you verify that? Unverified attribution = guessing |
| "Need more context" | You have tools. Search first, ask only what's truly unavailable |
| "Suggest handling manually" | This is your bug. Own it. Exhaust all options first |
| Same logic, different parameters | Tweaking parameters is NOT a different approach. Change the method. |
| Phase | Key Activities | Done When |
|---|---|---|
| 1. Root Cause | Read errors, reproduce, check changes, trace data | Understand WHAT and WHY |
| 1.5 RP Investigate | context_builder(question) with symptoms + hypotheses | Cross-file context gathered (or skipped if no RP) |
| 2. Pattern | Find working examples, compare differences | Identified the delta |
| 3. Hypothesis | Form theory, test ONE variable | Confirmed or new hypothesis |
| 4. Implement | Write test, fix root cause, verify | Bug resolved, guards pass |
Bug fixed. Next:
1) Review the fix: `/flow-code:impl-review --base <pre-fix-commit>`
2) Continue current work: `/flow-code:work <epic-id>`