/forge:fg-debugfrom forge
Diagnoses hard bugs and performance regressions via a phased loop: reproduce, minimise, rank hypotheses, instrument. Diagnosis only, no fixes applied.
Ships in forge. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
This is not a stage of the forge loop. It is an on-demand utility (like fg-security / fg-adversarial-review) that diagnoses a hard bug or performance regression down to its root cause, then feeds the diagnosis into the fix lane selected by invocation state.
The methodology is not forge's. It is mattpocock/skills diagnosing-bugs, vendored here under MIT (see LICENSE): a phased diagnosis discipline — build a tight red-capable feedback loop, reproduce and minimise, generate 3–5 ranked falsifiable hypotheses, instrument one variable at a time. Read DIAGNOSE.md and follow its Phases 1–4 — that file is the method's single definition and this skill never restates or forks it (the same file-reference convention as ../fg-security/AUDIT.md and ../fg-config/ECO.md). Do not edit DIAGNOSE.md, scripts/hitl-loop.template.sh, or LICENSE: they are kept byte-for-byte with upstream so a future diff stays cheap (only the entry file was renamed, SKILL.md → DIAGNOSE.md, to avoid forge's skill auto-discovery — the ../fg-security/AUDIT.md precedent), and forge's own glue lives here instead. Rationale: .forge/adr/260907-140655-fg-debug-vendored-diagnosis.md.
What forge adds is exactly three things — everything else is upstream's:
DIAGNOSE.md's Phase 5 begins — the invocation state determines whether the result returns to the active task or enters an independent fix lane, and the fix is never applied here,.forge/ state — only sanitized fixtures or persistent checks may remain in the project's working tree; sensitive and temporary material does not,Language: This skill file is authored in English, but you MUST write every message shown to the user — questions, the ranked hypothesis list, status/next-step lines, and handoff text — in the user's language (detect it from the user's own messages), never mirroring this file's English. DIAGNOSE.md's procedure is followed as written; its output to the user is rendered in the user's language, and any backlog plan this skill produces is written in the user's language.
Explaining forge: forge's vocabulary is not the user's — verified: failed, unsealed tail, a pillar or gate name means nothing unread. Always, never gated on eco: gloss a forge-specific term on first use in a message (a few words, not a paragraph), put the purpose before the mechanism, and lead with the answer, closing on what it means for the user. A gloss is not filler — with eco on, ECO.md's terse rules govern form (length, padding) while these govern vocabulary, so terseness never deletes a gloss.
Evidence and candor: every claim you make about code, state, or results — in a message or in a document you write (plan, run notes, retro, ADR) — carries its evidence in the same sentence (a file:line, a command and its output) or a label: Measured (you checked it this session), Inferred (reasoned from what you checked), Guess (a prediction or an unseen cause), rendered in the user's language. A label is not a license to skip a check — if a cheap check would settle it, run it; never hand the user a check you could run. Agreement is not the default: when asked whether to do something, invited to add scope, or shown an approach, give your real judgment first — the strongest objection, and "don't do it" when that is true. Change a recommendation only for a new fact or argument, never for repetition; the decision stays the user's — state the objection once, then follow their call without re-arguing or silently deviating. Output a deterministic script printed is already measured and needs no label.
Forge root: every .forge/... read or write below is relative to the resolved forge root — .forge/ on the default branch, .forge/branch/<branch>/ (git-tracked) on any other branch. Resolve it per ${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}/skills/fg-run/FORGE-ROOT.md (skill-relative ../fg-run/FORGE-ROOT.md) before inspecting the active slot or writing a fix plan (ADR-0011).
This skill runs in-session, never inside a delegated workflow. DIAGNOSE.md's Phase 3 shows the ranked hypothesis list to the user before testing any of them — a live checkpoint that a delegated execution (which takes no user input mid-run) cannot honor. That is pillar 1 (grilling-class interaction stays conversational), and it is also why the unattended drives skip this skill entirely (see below). fg-run's verified: failed handoff may recommend coming here when the cause is unknown — that advisory line lives in ../fg-run/SKILL.md, not here.
Before Phase 1, inspect the resolved active slot's plan.md, run.md, and STATUS.md. This classification outranks fix size:
verified: failed means this diagnosis belongs to that existing task. Keep its plan/run/STATUS untouched. A confirmed diagnosis always returns the diagnosis package to fg-run's existing fix-and-re-run path, even when the fix is trivial; never create a backlog plan and never divert it to fg-quick. An inconclusive diagnosis leaves the failed task active while requesting the missing input described below.verified: failed task owns the diagnosis, classify the confirmed fix by size after diagnosis: a typo-class, one-line, low-risk fix bails to fg-quick; a non-trivial fix may become a new backlog plan after human approval.The diagnosis package contains the confirmed root cause, the minimized reproduction, the Phase 1 command and its persistence classification, rejected hypotheses, retained sanitized artifacts, and required cleanup. This gives either execution lane evidence without creating a second diagnostic ledger.
At the moment Phase 1 selects its red-capable command, classify whether it is a persistent regression check or one-off diagnostic evidence:
curl, trace, HITL, ad-hoc scripts, temporary instrumentation, and throwaway harness commands are one-off unless they actually invoke such a project-owned persistent check. Going red once does not make them an eval.For a freshly generated fix plan, a one-off command requires either a separate work slice that converts the reproduction into a persistent check or the exemption prescribed by ../fg-run/PLAN-FORMAT.md. PLAN-FORMAT is the single definition; do not copy its rule here. For an active failed task's in-place repair, carry the persistence classification and recommended regression check (or why it cannot be persisted) in the diagnosis package for fg-run's existing fix-and-re-run path; do not edit the already-run plan.
Only a confirmed-sanitized fixture and a persistent test/check may remain in the project's working tree. Original traces, HAR files, logs, authentication headers, personal data, or other possibly sensitive captures must be collected and inspected only in an OS-managed temporary location outside the project's working tree. Create no .forge/debug/ or any other new .forge/ state (ADR 260907-140655, decision 3).
Before every exit path — confirmed, either inconclusive case, active-task return, generated-plan handoff, or fg-quick bail — delete raw captures, temporary instrumentation, and throwaway harnesses. The diagnosis package lists every sanitized artifact deliberately retained. The active repair scope, new fix plan, or fg-quick scope must own Phase 6 cleanup and verification for any retained sanitized fixture that is not meant to survive; persistent regression checks remain.
Follow DIAGNOSE.md through Phase 4 (instrument) until one hypothesis is confirmed or further progress lacks evidence. Then stop. fg-debug never applies the fix, and never creates run.md / STATUS.md or edits the active slot — a fix applied here would bypass the loop's re-run guard, verification gate (ADR-0009), and eval promotion (ADR 260907-140655, decision 2). Route by invocation state first, then outcome:
verified: failed, clean up, and request the missing evidence below; re-invoke fg-debug when it arrives. Do not invent a fix and do not route around the occupied slot.fg-quick and fix it there; its LOG line is the only task record. This is the already-approved lightweight lane (ADR-0003), not a new bypass. Hand its scope the diagnosis package and any safe Phase 6 cleanup..forge/backlog/<slug>-fix.md (or a descriptive slug) carrying <!-- generated-by: fg-debug --> and a fresh monotonic <!-- task: N --> (scan all task: markers across backlog/active/executed/done, max+1 — same rule as fg-adversarial-review). The plan carries the diagnosis package, follows PLAN-FORMAT's fix-forward eval rule (including the <!-- eval: … --> marker that names the regression-check slice or the exemption reason (PLAN-FORMAT.md; checked by forge-plan-lint)) and its fix-forward ADR rule (an ADR conflict is raised at the approval, never written silently), and includes Phase 6 cleanup and its verification.Inconclusive has two evidence-based shapes. If no feedback loop could be built, list the attempts and request environment access, a redacted artifact, or permission for temporary instrumentation. If a feedback loop exists but the root cause remains unconfirmed, preserve the red command and rejected hypotheses, then request the additional instrumentation, domain information, or reproduction environment needed to discriminate the remaining hypotheses. Both shapes clean temporary material, state the exact missing input, and tell the user how to re-invoke fg-debug.
fg-next all (ADR-0010) and fg-loop (ADR-0016) never run this skill, the same way they skip fg-adversarial-review and never ask a promotion question at the seal: ranking hypotheses with a human is conversational work, and an unattended drive cannot make that call. It is invoked deliberately, by a human.
fg-debug ("debug this" / "디버깅해줘")
│
▼
classify invocation state
├─ active slot at verified: failed ─▶ active-failure lane (size never reroutes it)
└─ otherwise ─▶ independent lane
▼
follow DIAGNOSE.md Phases 1–4 (upstream, unedited)
feedback command → classify persistent vs one-off → reproduce + minimise
→ ranked hypotheses (shown to the user) → instrument
│ sensitive captures = outside-working-tree temporary location
▼
result (clean raw captures + temporary instrumentation + throwaway harness on every exit):
├─ active + confirmed ─▶ diagnosis package ─▶ existing fg-run fix-and-re-run
├─ active + inconclusive ─▶ keep verified: failed ─▶ missing evidence ─▶ re-invoke fg-debug
├─ independent + trivial ─▶ fg-quick (diagnosis + safe cleanup scope)
├─ independent + nontrivial ─▶ human approves ─▶ generated fix plan
│ (PLAN-FORMAT eval rule + safe cleanup slice) ─▶ fg-run
└─ independent + inconclusive ─▶ missing evidence ─▶ re-invoke fg-debug
Render the handoff table per ../fg-next/HANDOFF.md — the single definition of its shape; never restate that layout here. Statement form, in the user's language, then stop (chaining is fg-next's job — ADR-0015).
Just did is the one-line verdict: the confirmed root cause (or that none was reached), the Phase 1 command and whether it is persistent or one-off, and the cleanup outcome. Fill the rest from the first matching case:
Next step = fg-run's existing fix-and-re-run path for this active task; How to start = /forge:fg-run; omit Alternative. Never point to a new plan or fg-quick here.Next step = provide the stated missing evidence, then re-invoke fg-debug while the failed task remains active; omit Alternative.Next step = provide the stated missing evidence, then re-invoke fg-debug; omit Alternative.Next step = nothing is owed — state that plainly; omit Alternative.Next step = fg-run, to promote and run the generated plan — note that the active slot must be free (an occupied slot finishes first); How to start = /forge:fg-run; omit Alternative.The rejected hypotheses and the attempted loop constructions are list-shaped, so they go below the table as bullets (HANDOFF.md's rule) — never compressed into a cell.
plan.md, run.md, STATUS.md, executed/, or done/. An active failure returns a conversational diagnosis package to fg-run's existing fix-and-re-run path..forge/backlog/<slug>-fix.md (<!-- generated-by: fg-debug -->, monotonic task:) — picked up by fg-run.fg-quick Phase 6 cleanup scope..forge/ state. It is not a loop stage.DIAGNOSE.md, scripts/hitl-loop.template.sh, or LICENSE.The diagnosis methodology is vendored from mattpocock/skills diagnosing-bugs (MIT, see LICENSE) — byte-for-byte, entry file renamed only (SKILL.md → DIAGNOSE.md).
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub gyuha/forge --plugin forge25 skills in this plugin
/fg-adversarial-reviewOptional adversarial review between fg-run and the seal (fg-done) — a reviewer assumes the result is WRONG and hunts for evidence across six lenses (failure points, hidden assumptions, misread requirements, security/perf/data-loss, unexpected misuse, weak decisions), fanning out as parallel subagents; fix-needed findings become a fix-forward plan on your approval. Outside the loop, never a seal gate, always skipped in fg-next all / fg-loop. Use in contexts like 'adversarial review', '적대적 리뷰', '이 결과 공격적으로 검토', '허점 찾아줘', 'red team this'./fg-agendaA decision queue for foggy work — outside the forge loop. Settles the destination with you, grills breadth-first to surface what must be decided, and keeps it in .forge/agenda.md (destination · decided · open questions · fog · out of scope), resolving one question at a time via fg-ask until the way is clear, then deleting itself. The agent finds the decisions; you answer them. Use in contexts like 'forge agenda', '의제', '결정 대기열', '뭘 결정해야 하는지 정리해줘', '어디서 시작할지 모르겠다'./fg-agentsGenerates a project's domain agents — conversational grilling derives the recurring roles, then writes standard Claude Code subagent cards to .claude/agents/<role>.md (each `description` carrying a "when to use" so fg-run can dispatch a matching role as agentType). Cards load only at session start, so RESTART the session after generating them before fg-run can use them. On-demand utility outside the loop. Use in contexts like 'forge agents', '도메인 에이전트 만들어', '에이전트 팀 구성', 'create project agents', 'domain agents', 'agent roles'.Other plugins' skills for the same job