[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6GTSWH7QKW2MTY6DAF3DT93":3,"skill-same:01M6GTSWH7QKW2MTY6DAF3DT93":66},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":32,"linkOnly":33,"markdownContent":34,"markdownBody":35,"frontMatter":36,"refName":38,"commitSha":39,"skillDirectory":40,"forksCount":41,"repositoryHtmlUrl":42,"repositoryHomepageUrl":43,"ownerHtmlUrl":44,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":45,"install":46,"resources":59},"01M6GTSWH7QKW2MTY6DAF3DT93","goat-debug",null,"Use when diagnosing a bug, unexpected behaviour, system failure, or unfamiliar code that needs structured investigation.","blundergoat\u002Fgoat-flow","blundergoat","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F260647401?v=4","01M6GTR7WK4KVYK7N5DEQGA7BT","01M6GTR84KH4BAF65ZV9V9DNG9",32,"MIT","https:\u002F\u002Fgithub.com\u002Fblundergoat\u002Fgoat-flow\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fgoat-debug\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[23,24,25,26,27,28,29,30,31],"debug","goat debug","goat","code","investigation","system","use","bug","structured","2026-11-10 10:12:30",false,"---\nname: goat-debug\ndescription: \"Use when diagnosing a bug, unexpected behaviour, system failure, or unfamiliar code that needs structured investigation.\"\ngoat-flow-skill-version: \"1.18.0\"\n---\n# \u002Fgoat-debug\n\n## Shared Conventions\n\nRead `.goat-flow\u002Fskill-docs\u002Fskill-preamble.md` for shared conventions.\nOn full-depth, also read `.goat-flow\u002Fskill-docs\u002Fskill-conventions.md`.\n\n## When to Use\n\nUse when diagnosing a bug or understanding unfamiliar code. For onboarding, use investigate mode.\n- Bug\u002Fsymptom --> **Diagnose mode**. Exploring, no bug --> **Investigate mode**. Already-applied fix --> Step 0 verification.\n\n**If you want to \"just try something\" before tracing the code path, STOP.** That is the failure mode this skill exists to prevent.\n\n| Excuse | Reality |\n|--------|---------|\n| \"The user already diagnosed it, hypotheses are ceremony\" | A confidently stated cause is data, not diagnosis. Trace it or eliminate it before acting. |\n| \"Prod is on fire, D1 is a luxury\" | Untraced fixes at 2am are how you get a 3-fix abort at 4am. D1 is the shortest path to a working fix. |\n| \"Type\u002Fconfig mismatch is a really clean story\" | Clean stories that don't mechanically match the symptom (e.g. value-dependent failure from a value-blind cause) are wrong stories. |\n| \"The specific number in the bug report is probably just phrasing\" | Treat every specific number, threshold, or boundary in a bug report as a clue, not rhetoric. |\n| \"Reading the footgun during an incident looks like second-guessing\" | Reading the footgun IS doing your job. Not reading it is what looks bad at post-mortem. |\n| \"Adding the field is zero-risk - worst case we try the next thing\" | This is how you enter the 3-fix abort loop. Hypothesis before code, always. |\n\n## Boundary Commands\n\n- **NEVER:** Turn diagnosis into review, test planning, milestone planning, or an ungated fix.\n- **ALWAYS in Diagnose mode:** Trace the live path, test competing hypothesis categories, and state the reproduction and evidence limits.\n- **DEFER TO:** `\u002Fgoat-review` for quality, `\u002Fgoat-qa` for test plans, `\u002Fgoat-plan` for milestones, and the dispatcher for feature briefs.\n\n## Step 0 - Choose Depth\n\n**Already-applied change: existing-fix verification.** Identify change, environment\u002Fstate, original failing steps, expected result, earlier evidence, and execution authority; historical proof is context. Go directly to D4 without D2\u002FD3, hypotheses, minimisation, or causal confidence. Use the reference's verification report; diagnosis-only obligations apply only if diagnosis runs.\n\n**New diagnosis:** Valid explicit depth wins within governing policy. Otherwise Full risk\u002Fscope triggers override Quick defaults:\n- **Quick:** isolated 1-2 files, diagnosis only, or supplied reproduction; bounded primary-path investigation and compact report.\n- **Full:** cross-component, no reproduction, CI\u002Fprod\u002Fuser-visible impact, or possible fix; trace implicated component boundaries and relevant runtime\u002Fconfiguration context. If uncertain, choose Full.\nIf vague, ask about: goal, symptom\u002Ferror message, area involved, and what was already tried with its outcome; prior attempts enter D1 as evidence to trace, not as eliminated hypotheses.\n\n**Both diagnosis depths:** D1 + applicable D1.5 + D2; read primary file, test 2 hypothesis categories, attempt reproduction or state gap. Before D2, run D1.5 or state `reproduction already minimal`, `reduction not applicable`, or `unsafe to reduce` with literal input\u002Fcommand and reason. Quick never enters D3 or D4 directly.\n\n**Full is gated, not linear:** run D1 through D2, then stop, investigate deeper, or request a fix plan. Full diagnosis-only may stop at D2. If a Quick diagnosis leads to a fix request, promote to Full at the D2 gate; do not skip either approval. D3 planning follows the first approval; implementation requires the separate D3 approval; D4 follows implementation only.\n**Footgun check:** Use the preamble's learning-loop retrieval on `.goat-flow\u002Flearning-loop\u002Ffootguns\u002F` and `.goat-flow\u002Flearning-loop\u002Flessons\u002F` for the target area. Surface matches or an explicit retrieval miss; do not broad-load either bucket.\n\n**Browser evidence detection:** URL, local page, screenshot, rendering, or browser console\u002Fnetwork symptoms require `.goat-flow\u002Fskill-docs\u002Fplaybooks\u002Fbrowser-use.md`; it owns availability, installation approval, and manual fallback.\n\nFor Diagnose\u002Fexisting-fix modes, read `references\u002Fdiagnostic-techniques.md` only for ranking-matrix detail, mutation classification, reduction-method selection, causal-distinction detail, worked diagnosis, or existing-fix reporting.\n\n## Diagnose Mode\n\n### D1 - Investigate (no fixes)\n\nAfter reading the primary file (the first relevant file at the entry or failure boundary, not a file named by chance), declare a scope snapshot: symptom boundary (what is failing), affected components (files\u002Fmodules\u002Fservices involved), read estimate, and decision-relevant source\u002Fruntime\u002Fconfiguration state as the baseline. Drift is material when it touches an affected component or the reproduction; record it without persisting secrets or raw sensitive values.\n\nWrite 2-3 hypotheses spanning at least 2 of: Data, Logic, Timing, Environment, Configuration. If the bug involves loops, indices, or pagination, include a boundary\u002Fcounting hypothesis.\n\n**Hypothesis ranking:** Before expensive tracing, reduction, or experiments, rank the hypotheses by likelihood and cost; re-rank whenever evidence changes.\n\n\nTest cheap-and-likely first; skip expensive-and-unlikely until cheap options are eliminated. When survivors remain, run the cheapest authorized distinguishing check, or cite deterministic proof that entails the symptom; one intervention per hypothesis is never required.\n\nAfter tracing, mark each: CONFIRMED \u002F ADJUSTED \u002F ELIMINATED \u002F UNRESOLVED with `file + semantic anchor` evidence.\n\n**Multi-component failures:** Record each boundary's input, output, and broken invariant; investigate the failing component. New instrumentation follows diagnostic-experiment authority below.\n\n**UI-visible bugs:** After hypotheses, apply the browser playbook. Browser output is OBSERVED; interpretations remain INFERRED until mapped to `file + semantic anchor`.\n\n**Diagnostic-experiment authority:** Read-only observation may proceed within repository rules, as may execution against disposable state created by this investigation; disclose target-controlled execution (running code or configuration the target project supplies) when required. Experiments affecting existing source, configuration, local state, network, production, or sensitive data follow the stricter approval boundary. Before mutation, state target, expected signal, affected state, rollback, and a cleanup marker; wait for explicit current-session approval. Track diagnostic mutations separately from fixes. Incomplete cleanup blocks a fixed claim, and user-owned diagnostics are never removed without permission.\n\nIf repeated reads or experiments produce no new decision signal, checkpoint: state what was checked, which hypotheses remain, and the next distinguishing evidence needed.\n\n### D1.5 - Minimise\n\n**Goal:** Reduce the failing case without removing the property required for the symptom. Before reducing, preserve the original steps, input, expected result, and context beside the reduced case.\n\n**Procedure:**\n1. Identify variables in the reproduction (input data, config, environment, sequence of actions)\n2. Choose a method that fits the failure shape; use `references\u002Fdiagnostic-techniques.md` when simple deletion is unsafe or misleading\n3. Preserve the load-bearing order, interaction, workload, environment, or timing condition while reducing unrelated factors\n\n**Output:** Reduced case and method, or a supported minimal\u002Fnot-applicable\u002Funsafe disposition; literal command\u002Finput\u002Fsteps; tested removals; updated hypothesis set. A removed factor is irrelevant only under the same decision-relevant context.\n\n**Optional bisect path (state-mutating):** Bisect is never required for a reporting-only diagnosis. In reporting-only or no-write mode, describe the option but do not run it. Otherwise require a clean worktree, validate known-good and known-bad refs plus a deterministic, non-destructive predicate at both endpoints, disclose the commands and rollback, then wait for explicit current-session approval. Urgency, an outage, or broad permission to diagnose does not override these gates. A dirty worktree stops this path; an isolated worktree is a separately approved option, not an automatic workaround. After approval, run only the diagnostic predicate. Run `git bisect reset` on success, error, cancellation, or interruption while that approval still holds. A governing freeze leaves state unchanged and outranks this cleanup: report the pending reset and wait for explicit cleanup authority, because resumption alone does not release it.\n\nAfter minimisation, re-rank survivors before D2; consult the reference's ranking matrix if needed.\n\n### D2 - Diagnosis\n\nPresent: root cause + confidence + hypothesis table + reproduction steps. **Confidence floor:** All LOW --> return to D1 or present partial findings.\n\nSymptom reproduction is not root-cause proof. HIGH requires a traced mechanism plus a distinguishing counterfactual or intervention, or deterministic proof that entails the symptom. MEDIUM means the mechanism is traced but distinguishing proof is unavailable or unsafe; name the missing proof. LOW is plausible but has a load-bearing inferred link. Keep root-cause confidence separate from the preamble's proof class.\n\n**Root cause validation before claiming HIGH confidence.** For each candidate root cause, run a causation \u002F necessity \u002F sufficiency check:\n- **Causation** - does the proposed cause mechanically produce the observed symptom? Trace the path with `file + semantic anchor`.\n- **Necessity** - without this cause, does the symptom still occur? If yes, the cause is not necessary under the compared conditions; look for an alternative sufficient cause, hold relevant cofactors constant, and assess sufficiency separately.\n- **Sufficiency** - is this cause alone enough, or are there co-factors? Name them.\n\nFor high-stakes diagnoses (production availability, persistent-data loss, or a security boundary at risk), run a 5-Whys chain. Every \"because\" MUST cite `file + semantic anchor` or a reproduction step, not just prose; the chain ends where cited evidence ends, and a missing link is reported as the gap, never invented to reach five.\n\n**BLOCKING GATE:** Present diagnosis, then pause. Human decides: dig deeper, propose fix, or stop. If confidence is MEDIUM or LOW with multiple competing hypotheses, consider `\u002Fgoat-critique` on the hypothesis set before choosing a fix direction.\n\n### D3 - Fix Plan (only if human approved)\n\nApproval to write D3 authorizes planning only, not implementation. State what changes (files + functions), blast radius, architecture check (`.goat-flow\u002Farchitecture.md`), diagnostic cleanup, rollback, and verification method.\n\n**BLOCKING GATE:** Present the fix plan, then pause. Implement only after explicit approval.\n\n### D4 - Post-Fix Verification (approved implementation or existing fix)\nFirst complete approved diagnostic cleanup, confirm each marker, retain user-owned diagnostics, and confirm the intended source\u002Fconfiguration state. Rerun the **original, unminimized reproduction** from D2 or existing-fix intake: a minimised case proves less. Run applicable D3 verification, adjacent checks at the changed causal boundary, and old-pattern searches after renames. Do not close while any approved diagnostic mutation from D1 remains uncleaned.\n\nMissing or unsafe original proof: UNVERIFIED; human-owned: HUMAN-PENDING with owner. Remaining symptom: return to D1; no new patch authority. Passing verification does not prove root cause.\n\nCite the literal reproduction output for any fixed claim.\n\n**3-fix abort rule:** If three independent fixes have failed to resolve the symptom, STOP and reconsider whether the architecture or the root-cause hypothesis is wrong. Do not attempt a fourth patch without first re-entering D1 with a fresh hypothesis set.\n\n**UI bugs:** Rerun the original browser reproduction post-fix. Capture screenshot\u002Fstate showing the symptom is gone. Follow `.goat-flow\u002Fskill-docs\u002Fplaybooks\u002Fbrowser-use.md`.\n\n## Debug Integrity\n\nEvery diagnose-mode report ends with this section.\n\n- **Files read:** count\n- **Hypotheses assessed:** count (CONFIRMED + ADJUSTED + ELIMINATED + UNRESOLVED); UNRESOLVED means insufficient distinguishing evidence, including untested hypotheses and tested but inconclusive hypotheses\n- **Checks executed:** count of hypothesis checks actually performed (reads, runs, or experiments), never inferred from the hypothesis total\n- **Categories covered:** which of Data\u002FLogic\u002FTiming\u002FEnvironment\u002FConfiguration were assessed\n- **Reproduction attempted:** yes \u002F no \u002F partial\n- **Evidence states:** OBSERVED (literal result) \u002F INFERRED (reasoned link) \u002F UNVERIFIED (not executed) \u002F HUMAN-PENDING: each human-owned check with its owner or role\n- **Proof class:** `RUNTIME | CONTRACT-GREP | STATIC | NOT-REPRODUCED` (per `skill-preamble.md` Proof Classification)\n- **Diagnostic mutations:** none \u002F approved and tracked \u002F cleanup incomplete\n- **Footgun retrieval:** hit (cite entry) \u002F miss\n- **What I Didn't Check:** files, paths, or components deliberately skipped with one-line reason each\n\n## Investigate Mode\n\nInvestigate mode does not require reproduction, bug hypotheses, minimisation, or causal proof.\n\n### I1 - Scope\n\nDeclare: **In scope** [files\u002Fdirs], **Out of scope** [what we skip], **Read estimate** [N files, pause at 3x].\n\n**CHECKPOINT:** \"I'll investigate [scope] reading up to [N] files. Adjust?\" When the goal and scope are explicit, continue to I2 without waiting. Pause only when the goal or boundary is ambiguous, or before exceeding the declared 3x read limit.\n\n### I2 - Read (Progressive Depth)\n\nRead in layers: (1) entry points, (2) critical path, (3) supporting files.\nFor each file log: role, connections, evidence tag (OBSERVED \u002F INFERRED).\n\n### I3 - Report\n\nRequired: **What I Didn't Read** (skipped files + reasons), **Current vs Expected State**, **Evidence tags** (OBSERVED\u002FINFERRED).\nRead `references\u002Fdiagnostic-techniques.md` → Investigate Report for the layout.\n\n**BLOCKING GATE:** Present report, pause. Human decides: go deeper, switch to diagnose, or close.\n\n## Constraints\n\n- Diagnose mode MUST write hypotheses AFTER initial read of the primary file\n- Diagnose mode MUST include at least 2 hypothesis categories\n- MUST verify fix doesn't violate architecture constraints\n- Diagnose mode MUST run D1.5 reduction before D2 or evidence a minimal, not-applicable, or unsafe disposition\n- MUST NOT run `git bisect` in reporting-only or no-write mode, or without explicit approval, a clean worktree, validated refs and predicate, and a reset plan\n\n## Output Format\n\nExisting-fix verification uses the reference report; otherwise use the applicable block.\n\n### Diagnose mode (through the current gate)\n\nKeep Quick output compact. Omit D3, D4, UI, and diagnostic-mutation fields when they are not applicable.\n\n```markdown\n## TL;DR       \u003C!-- root cause + confidence -->\n## Hypotheses  \u003C!-- #, hypothesis, category, status, file + semantic anchor -->\n## Minimal Failing Case  \u003C!-- D1.5 case\u002Fmethod or disposition; limits -->\n## Root Cause  \u003C!-- confidence; file + semantic anchor; description -->\n## Reproduction Steps  \u003C!-- Expected vs Actual -->\n## Fix Plan    \u003C!-- only if human approved D3 -->\n## Verification  \u003C!-- after D4 -->\n## UI Evidence  \u003C!-- if captured -->\n## Debug Integrity\n- Files read: [N]\n- Hypotheses assessed: [N] (CONFIRMED: [n] \u002F ADJUSTED: [n] \u002F ELIMINATED: [n] \u002F UNRESOLVED: [n])\n- Checks executed: [N]\n- Categories covered: [list]\n- Reproduction attempted: [yes\u002Fno\u002Fpartial]\n- Evidence states: OBSERVED=[n] \u002F INFERRED=[n] \u002F UNVERIFIED=[n] \u002F HUMAN-PENDING=[n]: [check - owner]\n- Proof class: [RUNTIME\u002FCONTRACT-GREP\u002FSTATIC\u002FNOT-REPRODUCED]\n- Diagnostic mutations: [none\u002Fapproved and tracked\u002Fcleanup incomplete]\n- Footgun retrieval: [hit\u002Fmiss]\n- What I Didn't Check: [files\u002Fpaths skipped + reason]\n```\n\n### Investigate mode (I1–I3)\n\nUse the I3 reference layout; diagnosis-only fields do not apply.\n","# \u002Fgoat-debug\n\n## Shared Conventions\n\nRead `.goat-flow\u002Fskill-docs\u002Fskill-preamble.md` for shared conventions.\nOn full-depth, also read `.goat-flow\u002Fskill-docs\u002Fskill-conventions.md`.\n\n## When to Use\n\nUse when diagnosing a bug or understanding unfamiliar code. For onboarding, use investigate mode.\n- Bug\u002Fsymptom --> **Diagnose mode**. Exploring, no bug --> **Investigate mode**. Already-applied fix --> Step 0 verification.\n\n**If you want to \"just try something\" before tracing the code path, STOP.** That is the failure mode this skill exists to prevent.\n\n| Excuse | Reality |\n|--------|---------|\n| \"The user already diagnosed it, hypotheses are ceremony\" | A confidently stated cause is data, not diagnosis. Trace it or eliminate it before acting. |\n| \"Prod is on fire, D1 is a luxury\" | Untraced fixes at 2am are how you get a 3-fix abort at 4am. D1 is the shortest path to a working fix. |\n| \"Type\u002Fconfig mismatch is a really clean story\" | Clean stories that don't mechanically match the symptom (e.g. value-dependent failure from a value-blind cause) are wrong stories. |\n| \"The specific number in the bug report is probably just phrasing\" | Treat every specific number, threshold, or boundary in a bug report as a clue, not rhetoric. |\n| \"Reading the footgun during an incident looks like second-guessing\" | Reading the footgun IS doing your job. Not reading it is what looks bad at post-mortem. |\n| \"Adding the field is zero-risk - worst case we try the next thing\" | This is how you enter the 3-fix abort loop. Hypothesis before code, always. |\n\n## Boundary Commands\n\n- **NEVER:** Turn diagnosis into review, test planning, milestone planning, or an ungated fix.\n- **ALWAYS in Diagnose mode:** Trace the live path, test competing hypothesis categories, and state the reproduction and evidence limits.\n- **DEFER TO:** `\u002Fgoat-review` for quality, `\u002Fgoat-qa` for test plans, `\u002Fgoat-plan` for milestones, and the dispatcher for feature briefs.\n\n## Step 0 - Choose Depth\n\n**Already-applied change: existing-fix verification.** Identify change, environment\u002Fstate, original failing steps, expected result, earlier evidence, and execution authority; historical proof is context. Go directly to D4 without D2\u002FD3, hypotheses, minimisation, or causal confidence. Use the reference's verification report; diagnosis-only obligations apply only if diagnosis runs.\n\n**New diagnosis:** Valid explicit depth wins within governing policy. Otherwise Full risk\u002Fscope triggers override Quick defaults:\n- **Quick:** isolated 1-2 files, diagnosis only, or supplied reproduction; bounded primary-path investigation and compact report.\n- **Full:** cross-component, no reproduction, CI\u002Fprod\u002Fuser-visible impact, or possible fix; trace implicated component boundaries and relevant runtime\u002Fconfiguration context. If uncertain, choose Full.\nIf vague, ask about: goal, symptom\u002Ferror message, area involved, and what was already tried with its outcome; prior attempts enter D1 as evidence to trace, not as eliminated hypotheses.\n\n**Both diagnosis depths:** D1 + applicable D1.5 + D2; read primary file, test 2 hypothesis categories, attempt reproduction or state gap. Before D2, run D1.5 or state `reproduction already minimal`, `reduction not applicable`, or `unsafe to reduce` with literal input\u002Fcommand and reason. Quick never enters D3 or D4 directly.\n\n**Full is gated, not linear:** run D1 through D2, then stop, investigate deeper, or request a fix plan. Full diagnosis-only may stop at D2. If a Quick diagnosis leads to a fix request, promote to Full at the D2 gate; do not skip either approval. D3 planning follows the first approval; implementation requires the separate D3 approval; D4 follows implementation only.\n**Footgun check:** Use the preamble's learning-loop retrieval on `.goat-flow\u002Flearning-loop\u002Ffootguns\u002F` and `.goat-flow\u002Flearning-loop\u002Flessons\u002F` for the target area. Surface matches or an explicit retrieval miss; do not broad-load either bucket.\n\n**Browser evidence detection:** URL, local page, screenshot, rendering, or browser console\u002Fnetwork symptoms require `.goat-flow\u002Fskill-docs\u002Fplaybooks\u002Fbrowser-use.md`; it owns availability, installation approval, and manual fallback.\n\nFor Diagnose\u002Fexisting-fix modes, read `references\u002Fdiagnostic-techniques.md` only for ranking-matrix detail, mutation classification, reduction-method selection, causal-distinction detail, worked diagnosis, or existing-fix reporting.\n\n## Diagnose Mode\n\n### D1 - Investigate (no fixes)\n\nAfter reading the primary file (the first relevant file at the entry or failure boundary, not a file named by chance), declare a scope snapshot: symptom boundary (what is failing), affected components (files\u002Fmodules\u002Fservices involved), read estimate, and decision-relevant source\u002Fruntime\u002Fconfiguration state as the baseline. Drift is material when it touches an affected component or the reproduction; record it without persisting secrets or raw sensitive values.\n\nWrite 2-3 hypotheses spanning at least 2 of: Data, Logic, Timing, Environment, Configuration. If the bug involves loops, indices, or pagination, include a boundary\u002Fcounting hypothesis.\n\n**Hypothesis ranking:** Before expensive tracing, reduction, or experiments, rank the hypotheses by likelihood and cost; re-rank whenever evidence changes.\n\n\nTest cheap-and-likely first; skip expensive-and-unlikely until cheap options are eliminated. When survivors remain, run the cheapest authorized distinguishing check, or cite deterministic proof that entails the symptom; one intervention per hypothesis is never required.\n\nAfter tracing, mark each: CONFIRMED \u002F ADJUSTED \u002F ELIMINATED \u002F UNRESOLVED with `file + semantic anchor` evidence.\n\n**Multi-component failures:** Record each boundary's input, output, and broken invariant; investigate the failing component. New instrumentation follows diagnostic-experiment authority below.\n\n**UI-visible bugs:** After hypotheses, apply the browser playbook. Browser output is OBSERVED; interpretations remain INFERRED until mapped to `file + semantic anchor`.\n\n**Diagnostic-experiment authority:** Read-only observation may proceed within repository rules, as may execution against disposable state created by this investigation; disclose target-controlled execution (running code or configuration the target project supplies) when required. Experiments affecting existing source, configuration, local state, network, production, or sensitive data follow the stricter approval boundary. Before mutation, state target, expected signal, affected state, rollback, and a cleanup marker; wait for explicit current-session approval. Track diagnostic mutations separately from fixes. Incomplete cleanup blocks a fixed claim, and user-owned diagnostics are never removed without permission.\n\nIf repeated reads or experiments produce no new decision signal, checkpoint: state what was checked, which hypotheses remain, and the next distinguishing evidence needed.\n\n### D1.5 - Minimise\n\n**Goal:** Reduce the failing case without removing the property required for the symptom. Before reducing, preserve the original steps, input, expected result, and context beside the reduced case.\n\n**Procedure:**\n1. Identify variables in the reproduction (input data, config, environment, sequence of actions)\n2. Choose a method that fits the failure shape; use `references\u002Fdiagnostic-techniques.md` when simple deletion is unsafe or misleading\n3. Preserve the load-bearing order, interaction, workload, environment, or timing condition while reducing unrelated factors\n\n**Output:** Reduced case and method, or a supported minimal\u002Fnot-applicable\u002Funsafe disposition; literal command\u002Finput\u002Fsteps; tested removals; updated hypothesis set. A removed factor is irrelevant only under the same decision-relevant context.\n\n**Optional bisect path (state-mutating):** Bisect is never required for a reporting-only diagnosis. In reporting-only or no-write mode, describe the option but do not run it. Otherwise require a clean worktree, validate known-good and known-bad refs plus a deterministic, non-destructive predicate at both endpoints, disclose the commands and rollback, then wait for explicit current-session approval. Urgency, an outage, or broad permission to diagnose does not override these gates. A dirty worktree stops this path; an isolated worktree is a separately approved option, not an automatic workaround. After approval, run only the diagnostic predicate. Run `git bisect reset` on success, error, cancellation, or interruption while that approval still holds. A governing freeze leaves state unchanged and outranks this cleanup: report the pending reset and wait for explicit cleanup authority, because resumption alone does not release it.\n\nAfter minimisation, re-rank survivors before D2; consult the reference's ranking matrix if needed.\n\n### D2 - Diagnosis\n\nPresent: root cause + confidence + hypothesis table + reproduction steps. **Confidence floor:** All LOW --> return to D1 or present partial findings.\n\nSymptom reproduction is not root-cause proof. HIGH requires a traced mechanism plus a distinguishing counterfactual or intervention, or deterministic proof that entails the symptom. MEDIUM means the mechanism is traced but distinguishing proof is unavailable or unsafe; name the missing proof. LOW is plausible but has a load-bearing inferred link. Keep root-cause confidence separate from the preamble's proof class.\n\n**Root cause validation before claiming HIGH confidence.** For each candidate root cause, run a causation \u002F necessity \u002F sufficiency check:\n- **Causation** - does the proposed cause mechanically produce the observed symptom? Trace the path with `file + semantic anchor`.\n- **Necessity** - without this cause, does the symptom still occur? If yes, the cause is not necessary under the compared conditions; look for an alternative sufficient cause, hold relevant cofactors constant, and assess sufficiency separately.\n- **Sufficiency** - is this cause alone enough, or are there co-factors? Name them.\n\nFor high-stakes diagnoses (production availability, persistent-data loss, or a security boundary at risk), run a 5-Whys chain. Every \"because\" MUST cite `file + semantic anchor` or a reproduction step, not just prose; the chain ends where cited evidence ends, and a missing link is reported as the gap, never invented to reach five.\n\n**BLOCKING GATE:** Present diagnosis, then pause. Human decides: dig deeper, propose fix, or stop. If confidence is MEDIUM or LOW with multiple competing hypotheses, consider `\u002Fgoat-critique` on the hypothesis set before choosing a fix direction.\n\n### D3 - Fix Plan (only if human approved)\n\nApproval to write D3 authorizes planning only, not implementation. State what changes (files + functions), blast radius, architecture check (`.goat-flow\u002Farchitecture.md`), diagnostic cleanup, rollback, and verification method.\n\n**BLOCKING GATE:** Present the fix plan, then pause. Implement only after explicit approval.\n\n### D4 - Post-Fix Verification (approved implementation or existing fix)\nFirst complete approved diagnostic cleanup, confirm each marker, retain user-owned diagnostics, and confirm the intended source\u002Fconfiguration state. Rerun the **original, unminimized reproduction** from D2 or existing-fix intake: a minimised case proves less. Run applicable D3 verification, adjacent checks at the changed causal boundary, and old-pattern searches after renames. Do not close while any approved diagnostic mutation from D1 remains uncleaned.\n\nMissing or unsafe original proof: UNVERIFIED; human-owned: HUMAN-PENDING with owner. Remaining symptom: return to D1; no new patch authority. Passing verification does not prove root cause.\n\nCite the literal reproduction output for any fixed claim.\n\n**3-fix abort rule:** If three independent fixes have failed to resolve the symptom, STOP and reconsider whether the architecture or the root-cause hypothesis is wrong. Do not attempt a fourth patch without first re-entering D1 with a fresh hypothesis set.\n\n**UI bugs:** Rerun the original browser reproduction post-fix. Capture screenshot\u002Fstate showing the symptom is gone. Follow `.goat-flow\u002Fskill-docs\u002Fplaybooks\u002Fbrowser-use.md`.\n\n## Debug Integrity\n\nEvery diagnose-mode report ends with this section.\n\n- **Files read:** count\n- **Hypotheses assessed:** count (CONFIRMED + ADJUSTED + ELIMINATED + UNRESOLVED); UNRESOLVED means insufficient distinguishing evidence, including untested hypotheses and tested but inconclusive hypotheses\n- **Checks executed:** count of hypothesis checks actually performed (reads, runs, or experiments), never inferred from the hypothesis total\n- **Categories covered:** which of Data\u002FLogic\u002FTiming\u002FEnvironment\u002FConfiguration were assessed\n- **Reproduction attempted:** yes \u002F no \u002F partial\n- **Evidence states:** OBSERVED (literal result) \u002F INFERRED (reasoned link) \u002F UNVERIFIED (not executed) \u002F HUMAN-PENDING: each human-owned check with its owner or role\n- **Proof class:** `RUNTIME | CONTRACT-GREP | STATIC | NOT-REPRODUCED` (per `skill-preamble.md` Proof Classification)\n- **Diagnostic mutations:** none \u002F approved and tracked \u002F cleanup incomplete\n- **Footgun retrieval:** hit (cite entry) \u002F miss\n- **What I Didn't Check:** files, paths, or components deliberately skipped with one-line reason each\n\n## Investigate Mode\n\nInvestigate mode does not require reproduction, bug hypotheses, minimisation, or causal proof.\n\n### I1 - Scope\n\nDeclare: **In scope** [files\u002Fdirs], **Out of scope** [what we skip], **Read estimate** [N files, pause at 3x].\n\n**CHECKPOINT:** \"I'll investigate [scope] reading up to [N] files. Adjust?\" When the goal and scope are explicit, continue to I2 without waiting. Pause only when the goal or boundary is ambiguous, or before exceeding the declared 3x read limit.\n\n### I2 - Read (Progressive Depth)\n\nRead in layers: (1) entry points, (2) critical path, (3) supporting files.\nFor each file log: role, connections, evidence tag (OBSERVED \u002F INFERRED).\n\n### I3 - Report\n\nRequired: **What I Didn't Read** (skipped files + reasons), **Current vs Expected State**, **Evidence tags** (OBSERVED\u002FINFERRED).\nRead `references\u002Fdiagnostic-techniques.md` → Investigate Report for the layout.\n\n**BLOCKING GATE:** Present report, pause. Human decides: go deeper, switch to diagnose, or close.\n\n## Constraints\n\n- Diagnose mode MUST write hypotheses AFTER initial read of the primary file\n- Diagnose mode MUST include at least 2 hypothesis categories\n- MUST verify fix doesn't violate architecture constraints\n- Diagnose mode MUST run D1.5 reduction before D2 or evidence a minimal, not-applicable, or unsafe disposition\n- MUST NOT run `git bisect` in reporting-only or no-write mode, or without explicit approval, a clean worktree, validated refs and predicate, and a reset plan\n\n## Output Format\n\nExisting-fix verification uses the reference report; otherwise use the applicable block.\n\n### Diagnose mode (through the current gate)\n\nKeep Quick output compact. Omit D3, D4, UI, and diagnostic-mutation fields when they are not applicable.\n\n```markdown\n## TL;DR       \u003C!-- root cause + confidence -->\n## Hypotheses  \u003C!-- #, hypothesis, category, status, file + semantic anchor -->\n## Minimal Failing Case  \u003C!-- D1.5 case\u002Fmethod or disposition; limits -->\n## Root Cause  \u003C!-- confidence; file + semantic anchor; description -->\n## Reproduction Steps  \u003C!-- Expected vs Actual -->\n## Fix Plan    \u003C!-- only if human approved D3 -->\n## Verification  \u003C!-- after D4 -->\n## UI Evidence  \u003C!-- if captured -->\n## Debug Integrity\n- Files read: [N]\n- Hypotheses assessed: [N] (CONFIRMED: [n] \u002F ADJUSTED: [n] \u002F ELIMINATED: [n] \u002F UNRESOLVED: [n])\n- Checks executed: [N]\n- Categories covered: [list]\n- Reproduction attempted: [yes\u002Fno\u002Fpartial]\n- Evidence states: OBSERVED=[n] \u002F INFERRED=[n] \u002F UNVERIFIED=[n] \u002F HUMAN-PENDING=[n]: [check - owner]\n- Proof class: [RUNTIME\u002FCONTRACT-GREP\u002FSTATIC\u002FNOT-REPRODUCED]\n- Diagnostic mutations: [none\u002Fapproved and tracked\u002Fcleanup incomplete]\n- Footgun retrieval: [hit\u002Fmiss]\n- What I Didn't Check: [files\u002Fpaths skipped + reason]\n```\n\n### Investigate mode (I1–I3)\n\nUse the I3 reference layout; diagnosis-only fields do not apply.\n",{"name":5,"description":7,"goat-flow-skill-version":37},"1.18.0","main","369a5f67ee6d91bd7cda2b7d745dd5c256980543",".claude\u002Fskills\u002Fgoat-debug",2,"https:\u002F\u002Fgithub.com\u002Fblundergoat\u002Fgoat-flow","https:\u002F\u002Fgoat-flow.com","https:\u002F\u002Fgithub.com\u002Fblundergoat","2026-11-09 18:15:19",{"source":8,"skillName":5,"commands":47,"prompt":57,"zipAvailable":58},[48,51,54],{"tool":49,"command":50},"npx","npx skills add blundergoat\u002Fgoat-flow --skill goat-debug",{"tool":52,"command":53},"bunx","bunx skills add blundergoat\u002Fgoat-flow --skill goat-debug",{"tool":55,"command":56},"pnpm","pnpm dlx skills add blundergoat\u002Fgoat-flow --skill goat-debug","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fblundergoat\u002Fgoat-flow\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fgoat-debug\u002FSKILL.md",true,[60],{"path":61,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":64,"sourceHtmlUrl":65},"references\u002Fdiagnostic-techniques.md","REFERENCE","参考文档",9517,"https:\u002F\u002Fgithub.com\u002Fblundergoat\u002Fgoat-flow\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fgoat-debug\u002Freferences\u002Fdiagnostic-techniques.md",[67,81,93,116,138,149],{"skillNo":68,"name":25,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":77,"publishedAt":32},"01M6GV2QNW1KRHYPSNXA2F0A3G","Use when you describe an outcome and need the right goat-* workflow chosen for you.","https:\u002F\u002Fgithub.com\u002Fblundergoat\u002Fgoat-flow\u002Fblob\u002Fmain\u002Fworkflow\u002Fskills\u002Fgoat\u002FSKILL.md",[72],{"categoryNo":73,"categoryName":74,"taxonomyType":75,"taxonomyTypeDesc":76},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[25,78,79,29,80],"workflow","outcome","you",{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":88,"publishedAt":32},"01M6GV2AQBX5PYWK2CT1B9D82R","goat-security","Use when assessing security implications of code changes, architecture decisions, or new features.","https:\u002F\u002Fgithub.com\u002Fblundergoat\u002Fgoat-flow\u002Fblob\u002Fmain\u002Fworkflow\u002Fskills\u002Fgoat-security\u002FSKILL.md",[87],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},[25,89,90,91,26,92,29],"goat security","security","architecture","decisions",{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":103,"publishedAt":32},"01M6GV1W3W2Q94F9GSNFC5PS7Z","goat-review","Use when reviewing a diff, PR, or set of code changes, or auditing a codebase area for quality issues. Triggers: 'review this', 'code review', 'audit X', 'look at these changes'.","https:\u002F\u002Fgithub.com\u002Fblundergoat\u002Fgoat-flow\u002Fblob\u002Fmain\u002Fworkflow\u002Fskills\u002Fgoat-review\u002FSKILL.md",[99,102],{"categoryNo":100,"categoryName":101,"taxonomyType":75,"taxonomyTypeDesc":76},"01JBSEEDCAT000000000000007","代码审查",{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},[25,104,105,29,106,107,108,109,110,111,112,113,26,114,115],"goat review","review","diff","look","triggers","at","audit","quality","code review","pr","issues","SET",{"skillNo":117,"name":118,"nameZh":6,"description":119,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":120,"categories":121,"keywords":126,"publishedAt":32},"01M6GV17R6Z0D01Q69MX2FDNQZ","goat-qa","Use when evaluating test coverage gaps, planning test strategy, or assessing testing risk for code changes.","https:\u002F\u002Fgithub.com\u002Fblundergoat\u002Fgoat-flow\u002Fblob\u002Fmain\u002Fworkflow\u002Fskills\u002Fgoat-qa\u002FSKILL.md",[122,125],{"categoryNo":123,"categoryName":124,"taxonomyType":75,"taxonomyTypeDesc":76},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},[25,127,128,129,130,131,132,26,133,134,135,29,136,137],"goat qa","qa","coverage","testing","test","coverage gaps","planning","risk","strategy","test coverage","test strategy",{"skillNo":139,"name":140,"nameZh":6,"description":141,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":142,"categories":143,"keywords":144,"publishedAt":32},"01M6GV0VC60WAVV90K1FGJBBE2","goat-plan","Use when creating, updating, reconciling, or resuming milestone plans.","https:\u002F\u002Fgithub.com\u002Fblundergoat\u002Fgoat-flow\u002Fblob\u002Fmain\u002Fworkflow\u002Fskills\u002Fgoat-plan\u002FSKILL.md",[],[25,145,146,147,29,148],"goat plan","plan","milestone","plans",{"skillNo":150,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":151,"categories":152,"keywords":154,"publishedAt":32},"01M6GV0B1S1D5C7NR86VP2BH9R","https:\u002F\u002Fgithub.com\u002Fblundergoat\u002Fgoat-flow\u002Fblob\u002Fmain\u002Fworkflow\u002Fskills\u002Fgoat-debug\u002FSKILL.md",[153],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},[23,24,25,31,30,29,28,27,26]]