Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c7fac3686 |
+1
-1
@@ -14,7 +14,7 @@ the SKILL.md, not the table.
|
|||||||
| `clean-code` | Clean code principles with Go adaptation | Code review, refactoring, new code | claude-code, library |
|
| `clean-code` | Clean code principles with Go adaptation | Code review, refactoring, new code | claude-code, library |
|
||||||
| `code-review` | Code smell detection + Go-specific checklist | Pre-merge review | claude-code, library |
|
| `code-review` | Code smell detection + Go-specific checklist | Pre-merge review | claude-code, library |
|
||||||
| `cognitive-load` | Cognitive complexity analysis (CLI score) | Identifying hotspots, before refactoring | claude-code, library |
|
| `cognitive-load` | Cognitive complexity analysis (CLI score) | Identifying hotspots, before refactoring | claude-code, library |
|
||||||
| `debug` | Hypothesis-first debugging discipline | Any test failure or bug whose cause is not immediately obvious | claude-code, library |
|
| `debug` | Hypothesis-first debugging discipline | Any test failure or bug whose cause is not immediately obvious — or a bug report with no failure text, which this skill refuses rather than guesses at | claude-code, library |
|
||||||
| `discovery-framing` | Problem-before-solution discovery/framing method | Framing/validating a problem before any solution; opportunity sizing | claude-code, library |
|
| `discovery-framing` | Problem-before-solution discovery/framing method | Framing/validating a problem before any solution; opportunity sizing | claude-code, library |
|
||||||
| `dream` | Reflective consolidation pass over an agent's memory directory | Pruning/merging memory files, rebuilding a memory index | claude-code, library, chat |
|
| `dream` | Reflective consolidation pass over an agent's memory directory | Pruning/merging memory files, rebuilding a memory index | claude-code, library, chat |
|
||||||
| `experiment-spec` | Rigorous experiment spec — falsifiable hypothesis, quantitative acceptance, null-result protocol | Scoping a research/ML phase instead of a feature | claude-code, library |
|
| `experiment-spec` | Rigorous experiment spec — falsifiable hypothesis, quantitative acceptance, null-result protocol | Scoping a research/ML phase instead of a feature | claude-code, library |
|
||||||
|
|||||||
+28
-13
@@ -2,8 +2,8 @@
|
|||||||
name: debug
|
name: debug
|
||||||
surfaces: [claude-code, library]
|
surfaces: [claude-code, library]
|
||||||
summary: "Hypothesis-first debugging discipline"
|
summary: "Hypothesis-first debugging discipline"
|
||||||
use_when: "Any test failure or bug whose cause is not immediately obvious"
|
use_when: "Any test failure or bug whose cause is not immediately obvious — or a bug report with no failure text, which this skill refuses rather than guesses at"
|
||||||
description: Systematic hypothesis-first debugging. Generate 3-5 ranked hypotheses with verification steps before suggesting any fix. Use when encountering a bug, test failure, or unexpected behavior.
|
description: Systematic hypothesis-first debugging. Requires the failure itself — error text, stack, run id or log — and names what it needs and stops if the report has none, rather than hypothesising into a vacuum. Given evidence, generates 3-5 ranked, falsifiable hypotheses with verification steps before suggesting any fix. Use when encountering a bug, test failure, or unexpected behavior.
|
||||||
---
|
---
|
||||||
|
|
||||||
# Debug
|
# Debug
|
||||||
@@ -57,8 +57,9 @@ comments and the job log *first*.
|
|||||||
A system with boundaries (CI → build → signing, API → service → database) hides the
|
A system with boundaries (CI → build → signing, API → service → database) hides the
|
||||||
question "which component is wrong?" behind the question "why is the output wrong?".
|
question "which component is wrong?" behind the question "why is the output wrong?".
|
||||||
Specify, as a pre-step, what to log entering and leaving **each** boundary, plus
|
Specify, as a pre-step, what to log entering and leaving **each** boundary, plus
|
||||||
whether config and environment actually propagated. One run of that narrows the search
|
whether config and environment actually propagated. One run *that reproduces the failure* narrows the search to a
|
||||||
to a single component.
|
single component. On an intermittent fault a passing run narrows nothing, so leave the
|
||||||
|
instrumentation in across several runs rather than concluding from one.
|
||||||
|
|
||||||
This does not suspend Iron Law 2. Still emit 3-5 hypotheses — the boundary spec comes
|
This does not suspend Iron Law 2. Still emit 3-5 hypotheses — the boundary spec comes
|
||||||
first in the output, and each hypothesis says which boundary observation would kill it.
|
first in the output, and each hypothesis says which boundary observation would kill it.
|
||||||
@@ -74,6 +75,10 @@ than fixes that partially worked.) Each one has been narrowing a window rather t
|
|||||||
closing it, and a fourth guess buys another tenth of the rate plus a layer of
|
closing it, and a fourth guess buys another tenth of the rate plus a layer of
|
||||||
interacting guards nobody can reason about.
|
interacting guards nobody can reason about.
|
||||||
|
|
||||||
|
Intake still gates this section. A report of three failed fixes with no artifacts fires
|
||||||
|
both rules at once, and intake wins: you cannot aim hypotheses at a premise you have no
|
||||||
|
evidence about either. Ask for the log, then aim.
|
||||||
|
|
||||||
Say that explicitly — the refusal is the finding, not a preamble to it. Then aim the
|
Say that explicitly — the refusal is the finding, not a preamble to it. Then aim the
|
||||||
hypotheses one level up: the premise those fixes share is itself the thing to falsify.
|
hypotheses one level up: the premise those fixes share is itself the thing to falsify.
|
||||||
This is not an exemption from the output format. It is the format, pointed at the
|
This is not an exemption from the output format. It is the format, pointed at the
|
||||||
@@ -112,11 +117,13 @@ is a restatement of the order it sits next to.
|
|||||||
Use this format:
|
Use this format:
|
||||||
|
|
||||||
```
|
```
|
||||||
HYPOTHESIS 1 (likelihood: high): <mechanism in one sentence>
|
HYPOTHESIS 1: <mechanism in one sentence>
|
||||||
VERIFY: <exact command or file:line to inspect>
|
WHY FIRST: <what makes it likeliest — a matching symptom, a recent change, a brain entry>
|
||||||
|
VERIFY: <exact command, or the bounded observation that discriminates>
|
||||||
EXPECTED IF CORRECT: <specific output, value, or condition>
|
EXPECTED IF CORRECT: <specific output, value, or condition>
|
||||||
|
|
||||||
HYPOTHESIS 2 (likelihood: medium): <mechanism>
|
HYPOTHESIS 2: <mechanism>
|
||||||
|
WHY FIRST: <or why it ranks here rather than first>
|
||||||
VERIFY: <exact command>
|
VERIFY: <exact command>
|
||||||
EXPECTED IF CORRECT: <specific output>
|
EXPECTED IF CORRECT: <specific output>
|
||||||
|
|
||||||
@@ -138,15 +145,15 @@ End with the recommendation, not a fix.
|
|||||||
**Output:**
|
**Output:**
|
||||||
|
|
||||||
```
|
```
|
||||||
HYPOTHESIS 1 (likelihood: high): parser indexes into pages[0] before checking len(pages) > 0; empty PDFs produce a zero-page document
|
HYPOTHESIS 1: parser indexes into pages[0] before checking len(pages) > 0; empty PDFs produce a zero-page document
|
||||||
VERIFY: rg -n 'pages\[0\]' internal/parser/
|
VERIFY: rg -n 'pages\[0\]' internal/parser/
|
||||||
EXPECTED IF CORRECT: at least one site reads pages[0] without a preceding length check
|
EXPECTED IF CORRECT: at least one site reads pages[0] without a preceding length check
|
||||||
|
|
||||||
HYPOTHESIS 2 (likelihood: medium): the test fixture is a zero-byte file rather than a valid empty PDF; pdf library returns nil pages slice instead of empty
|
HYPOTHESIS 2: the test fixture is a zero-byte file rather than a valid empty PDF; pdf library returns nil pages slice instead of empty
|
||||||
VERIFY: ls -la testdata/empty.pdf && file testdata/empty.pdf
|
VERIFY: ls -la testdata/empty.pdf && file testdata/empty.pdf
|
||||||
EXPECTED IF CORRECT: file size 0 bytes or "data" rather than "PDF document"
|
EXPECTED IF CORRECT: file size 0 bytes or "data" rather than "PDF document"
|
||||||
|
|
||||||
HYPOTHESIS 3 (likelihood: low): a recently changed dependency reordered the page-extraction API; pages[0] now refers to metadata, not content
|
HYPOTHESIS 3: a recently changed dependency reordered the page-extraction API; pages[0] now refers to metadata, not content
|
||||||
VERIFY: git log --oneline -10 -- go.sum | grep -i pdf
|
VERIFY: git log --oneline -10 -- go.sum | grep -i pdf
|
||||||
EXPECTED IF CORRECT: a pdf-library bump in the last few commits
|
EXPECTED IF CORRECT: a pdf-library bump in the last few commits
|
||||||
|
|
||||||
@@ -160,6 +167,7 @@ RECOMMENDED NEXT STEP: Run VERIFY for hypothesis 1 first.
|
|||||||
| "Maybe try restarting the service" | Not a mechanism. Not falsifiable. Teaches nothing if it works. |
|
| "Maybe try restarting the service" | Not a mechanism. Not falsifiable. Teaches nothing if it works. |
|
||||||
| "Could be a race condition" | Mechanism without specifics. Which two operations race? On what state? |
|
| "Could be a race condition" | Mechanism without specifics. Which two operations race? On what state? |
|
||||||
| "Let me add some print statements and see" | Skips hypothesis generation. Generates noise, not understanding. |
|
| "Let me add some print statements and see" | Skips hypothesis generation. Generates noise, not understanding. |
|
||||||
|
| Answering "what's the fix?" from a report with no artifact | Hypothesising into a vacuum. The output looks like analysis, which is what makes it worse than saying "I need the log". |
|
||||||
| Single hypothesis presented as fact | If you are sure, write the regression test, do not run a debug skill. |
|
| Single hypothesis presented as fact | If you are sure, write the regression test, do not run a debug skill. |
|
||||||
| Mixing hypotheses with fix suggestions | The skill is diagnose-only. The fix is a TDD task on its hypothesis. |
|
| Mixing hypotheses with fix suggestions | The skill is diagnose-only. The fix is a TDD task on its hypothesis. |
|
||||||
|
|
||||||
@@ -168,7 +176,7 @@ RECOMMENDED NEXT STEP: Run VERIFY for hypothesis 1 first.
|
|||||||
The brain holds prior debug sessions across the project. Use it to skip rediscovering known failure modes.
|
The brain holds prior debug sessions across the project. Use it to skip rediscovering known failure modes.
|
||||||
|
|
||||||
**At debug start:**
|
**At debug start:**
|
||||||
- Run `brain_query` with the error message snippet + the package name. Past sessions may have logged identical or similar failures with their resolved hypotheses.
|
- Run `brain_query` with the error message snippet + the package name. On an intake stop you have neither — query the symptom and the component instead ("signed artifact missing CI"), which is worth doing precisely because it may name the artifact to ask for. Past sessions may have logged identical or similar failures with their resolved hypotheses.
|
||||||
- **A hit is evidence, so cite it inline in the hypothesis it informs** — `(brain: <entry-name>)` — rather than mentioning it once at the top. If a prior entry is why a hypothesis ranks first, the reader needs that at the hypothesis, not in a preamble. If a prior entry contradicts your ranking, say so and rank it anyway if the evidence here is better; the brain records what was true then.
|
- **A hit is evidence, so cite it inline in the hypothesis it informs** — `(brain: <entry-name>)` — rather than mentioning it once at the top. If a prior entry is why a hypothesis ranks first, the reader needs that at the hypothesis, not in a preamble. If a prior entry contradicts your ranking, say so and rank it anyway if the evidence here is better; the brain records what was true then.
|
||||||
|
|
||||||
**After a hypothesis is confirmed:**
|
**After a hypothesis is confirmed:**
|
||||||
@@ -186,7 +194,12 @@ treats `pass` as success, `fail` as failure, `skip` as neither.
|
|||||||
**At end of each phase:**
|
**At end of each phase:**
|
||||||
- `session_log` with `{session_id: "<this session's id>", skill: "debug", phase: "<phase-name>", final_status: "pass" | "fail" | "skip", message: "<one-line summary>", project_root: "<absolute path>"}`
|
- `session_log` with `{session_id: "<this session's id>", skill: "debug", phase: "<phase-name>", final_status: "pass" | "fail" | "skip", message: "<one-line summary>", project_root: "<absolute path>"}`
|
||||||
|
|
||||||
**Phases for this skill:** read-failure, generate-hypotheses, output
|
**Phases for this skill:** intake, read-failure, generate-hypotheses, output
|
||||||
|
|
||||||
|
`intake` exists so that refusing correctly is recordable. A run that stops for want of a
|
||||||
|
run id has done the right thing and logs `intake` / `pass`; without that phase the
|
||||||
|
refusal logs as a failed `read-failure`, and a metric that penalises the skill's best
|
||||||
|
behaviour teaches the next model to hypothesise into the vacuum instead.
|
||||||
|
|
||||||
**Status semantics:**
|
**Status semantics:**
|
||||||
- `pass` — the phase's intended outcome was reached.
|
- `pass` — the phase's intended outcome was reached.
|
||||||
@@ -209,7 +222,9 @@ Techniques kept in `debug/references/`, inherited from the deleted
|
|||||||
- `defense-in-depth.md` — load after a root cause is confirmed, to decide which layers
|
- `defense-in-depth.md` — load after a root cause is confirmed, to decide which layers
|
||||||
should have caught it.
|
should have caught it.
|
||||||
- `condition-based-waiting.md` — load whenever a timeout appears anywhere in the report,
|
- `condition-based-waiting.md` — load whenever a timeout appears anywhere in the report,
|
||||||
including as one of the fixes already tried. A bumped timeout is a symptom.
|
including as one of the fixes already tried. A bumped timeout is a symptom. Not during an
|
||||||
|
intake stop: if you are not analysing yet, a symptom-analysis reference is on the wrong
|
||||||
|
side of the gate.
|
||||||
- `find-polluter.sh` — run when a test passes alone and fails in the suite, or when
|
- `find-polluter.sh` — run when a test passes alone and fails in the suite, or when
|
||||||
something in the tree appears that no test admits to creating.
|
something in the tree appears that no test admits to creating.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user