bugfix
Skill2 starsChanged 33 days agoMITView on GitHub
Use whenever a bug is reported and a fix is asked for, however small the fix looks, even a one-line change: the regression test comes before the edit, so do not patch the code directly on a bug report. Investigate root cause, write a failing regression test (RED), implement the minimum fix, confirm the test passes (GREEN), then commit test and fix together. Fires on "fix this bug", "this is broken", "it's not working", "there's a regression", "resolve this issue", "X returns Y instead of Z, fix it", or a reference to a bug report. Not for: planning multi-step work (/aidex:plan); executing a written plan phase-by-phase (/aidex:plan-exec); recording why a fix was chosen as an ADR (/aidex:decision); pure refactors with no bug.
34 other projects use a version of this.
Adopted by
Most recently taken up by
- isanchez-aguilar/relayrace-aitheir own version, first seen Nov 8, 2026
- icarloscornejo/doertheir own version, first seen Nov 7, 2026
- ClaireAll/skillstheir own version, first seen Nov 5, 2026
- bhoon716/skill-forgetheir own version, first seen Nov 2, 2026
- Snowflake-Labs/coco-skillstheir own version, first seen Nov 1, 2026
- irahardianto/awesome-agvtheir own version, first seen Nov 1, 2026
Used with
Projects with it also use feature, refactor and 6 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
bradtraversySkillfeature
Manage current feature workflow - start, review, explain or complete
Also in 7 projects that use this
GitHubSkillrefactor
Surgical code refactoring to improve maintainability without changing behavior. Covers extracting functions, renaming variables, breaking down god functions, improving type safety, eliminating code smells, and applying design patterns. Less drastic than repo-rebuilder; use for gradual improvements.
Also in 6 projects that use this
SentrySkillspec
Produce a verified spec — problem, desired outcome, and acceptance criteria — before building. Use when given a GitHub/Linear issue link, when starting from a fuzzy in-conversation idea, or asked to "figure out what to do" / "scope this" / "what should I build" — whenever the *what* isn't yet pinned down. Grills the ambiguities, checks the premise against the code, and produces acceptance criteria you sign off on — then hands to design-first.
Also in 4 projects that use this
SentrySkillcommit
Create commit messages following Sentry conventions. Use when committing code changes, writing commit messages, or formatting git history. Follows conventional commits with Sentry-specific issue references.
Also in 8 projects that use this
Microsoft AzureSkilldocs
Also in 3 projects that use this
MicrosoftSkillpr-review
Verify the technical accuracy of a vscode-docs pull request against the VS Code source code in microsoft/vscode. Use when reviewing a docs PR for factual correctness: setting names, command IDs, default values, API shapes, keybindings, versioned availability, and described behavior.
Also in 3 projects that use this
Other versions34 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 34
- alibaba/MNN★ 16ksame name
- SparkDevNetwork/Rock★ 701same name
- oasm-platform/open-asm★ 272same name
- atelier-fashion/adlc-toolkit★ 173same name
- team-attention/hoyeon★ 173same name
- irahardianto/awesome-agv★ 157same name
- Snowflake-Labs/coco-skills★ 49same name
- mrveiss/AutoBot-AI★ 39same name
- dan-the-dev/xp-developer-skills★ 31same name
- ecodelearn/template-claude-code-open★ 25same name
24 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository21 other files it gives its agents.
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. 0 are common, 8 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 31 edited versions we read keep these.
8
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Test-driven bug fixing methodology that ensures every fix includes a regression test.
- Very specific: line 30
Write test that reproduces bug (must FAIL) — read ${CLAUDE_PLUGIN_ROOT}/skills/bugfix/references/test-patterns.md before choosing the test …
- Very specific: line 41
When the bug is a hang or a loop, the RED run executes it: Run the code under test in its own process group, kill the whole group on …
- Very specific: line 48
Run surrounding tests (no regressions) — select them, don't run everything: ${CLAUDE_PLUGIN_ROOT}/skills/audit/scripts/affected-tests.sh …
- Distinctive: line 61
Commit test + fix together
- Very specific: line 107
Follow the project's commit conventions for Step 7 (detect them.
- Distinctive: line 108
If Step 7 needs a new branch (e.g.
- Very specific: line 110
If the project tracks coverage (.context/audits/test-coverage/module-map.json exists) and the bug lived in a mapped module, note in the …
- Distinctive: line 114
If the project tracks a changelog, update it per the project's own rules
- Distinctive: line 134
When a bug is purely visual (CSS layout, spacing, colors) and cannot be tested programmatically:
- Distinctive: line 136
Document the visual issue clearly
- Distinctive: line 138
Write a smoke test if any aspect is testable (e.g., component renders, class is applied)
- Distinctive: line 139
Commit with clear description of what was visually broken
“Common” is measured: kept by at least 6 in 10 of the 31 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Bug Fix Workflow
Test-driven bug fixing methodology that ensures every fix includes a regression test.
Core Principle
Every bug fix MUST include a regression test. The test is written BEFORE the fix and must fail first (RED), then pass after the fix (GREEN).
Workflow
The bug-fix workflow is these nine steps — the agent table and prose below key to their step numbers:
- Investigate root cause (don't guess) Then sweep for siblings: grep the repo for the same defect shape (the same call, pattern or missing guard), not only the reported instance. Every match is in scope unless you can give a reason to exclude it.
- Write test that reproduces bug (must FAIL) — read
${CLAUDE_PLUGIN_ROOT}/skills/bugfix/references/test-patterns.mdbefore choosing the test type: it holds the signal→type decision matrix, the naming convention, the regression-test structure, and the cases where an automated test is the wrong call. The summary below is the first column of that matrix, not a substitute for it. The RED set covers every in-scope sibling from step 1 (a table row each, at the owning layer, not one test per scenario copy). Report a sibling table: each match asfixedorexcluded — <reason>; siblings are fixed in this change, not left as follow-up. Where the regression test goes and how many to write — one, at the owning layer — is${CLAUDE_PLUGIN_ROOT}/skills/testing/SKILL.md§ Bug regressions; read it with the matrix. - Confirm test fails for the right reason — the failure message names the buggy behavior, not an import/syntax/setup error. Verify this before writing the fix.
When the bug is a hang or a loop, the RED run executes it. Run the code under test
in its own process group, kill the whole group on timeout, and cap its CPU time with a
limit the children inherit (
RLIMIT_CPU; macOS ignores memory limits). A plaintimeout=kills only the direct child: on 2026-10-01 two RED runs left awk grandchildren that grew to ~80 GB each and took the machine down. - Implement minimum fix
- Confirm test passes — capture the GREEN output as proof (see Proof of done)
- Run surrounding tests (no regressions) — select them, don't run everything:
${CLAUDE_PLUGIN_ROOT}/skills/audit/scripts/affected-tests.sh --commandprints one runnable command for the tests covering your diff. Exit 3 means no selection is available (nomodule-map.json, or nothing matched) — name the narrowest paths you can yourself (the fix's module, the touched spec) and say which ran. The full suite gates the INTEGRATION boundary — merge to trunk, push, deploy, or the end of an unattended run — not this commit (decision/2026-08-24-full-suite-gate-moves-from-commit-to-integration). Committing on a selected run is legitimate and must never be silent: state which subset ran and that the full suite has not. A selection marked# INCOMPLETEis the one exception that still forces the full suite before the commit — an unmapped change is unknown scope, so the selection proves nothing. That same command also names, on stderr, any file in your diff that measurably breaks and has no E2E reaching it. Write that spec now, before the fix lands — against a disposable database, never dev (skills/coverage/SKILL.md § What the generated test-e2e.sh guarantees). - Commit test + fix together
- Name what prevents the class, not the instance — the regression test covers this
bug; say what stops the next one of its kind: a rule, a broader test, or a
.context/references/note. "Nothing, this was a one-off" is a valid answer, and it is written down like any other: oneclass-prevention: <answer>line in the commit body, next to the RED→GREEN proof (amend it if the answer only lands after the commit). This is a question, not a gate — it never blocks the commit. - Guided human verification, at the integration boundary — before the fix merges,
pushes or the run ends, not before the commit. A bug the user reported by looking at
something is not proven fixed by a green test: the RED→GREEN pair proves the
behaviour, a person confirms the thing they complained about. Read and follow
${CLAUDE_PLUGIN_ROOT}/skills/conventions/references/human-verification-conventions.md— it owns the four moves, the.context/proofs/<slug>/human-verification.mdartifact and itsproof_linksentry, and the recorded skip. Most bugs are not human-visible and skipping is right; it is recorded ashuman-verification: skipped — <reason>and never left absent, because absent reads the same as forgotten. For a visual/CSS-only bug this step is not optional — it is the only verification there is, and it closes on the UI evidence gate (see the exception below).
Agent Configuration
This skill uses specialized agents for parallel investigation:
| Agent | Model | Purpose | When |
aidex:bug-investigator | Sonnet | Trace root cause through code | Step 1 |
aidex:test-scout | Sonnet | Find related tests and patterns | Step 1 |
aidex:regression-checker | Sonnet | Verify no regressions after fix | Step 6 |
| Main session | Opus | Write test, write fix, decisions | Steps 2-5, 7-9 |
Agent definitions: ../../agents/ (plugin level), launched by type: subagent_type: aidex:bug-investigator, aidex:test-scout, aidex:regression-checker. Model and effort come from each definition.
Test Type Decision Guide
Summary of the matrix in test-patterns.md (step 2 reads the full file). Adapt the
categories to your stack — the framework names below are examples; the test-scout agent
detects the project's actual runners from its config files:
- Unit test: Pure functions, utilities, formatters, validators (e.g. Vitest, Jest, pytest)
- Component/integration test: UI component rendering or API endpoint behavior (e.g. Vitest + Testing Library, pytest + a test client)
- E2E test: Full user flows, multi-page interactions (e.g. Playwright, Cypress)
Integration with Other Skills
- Defer to the project's own testing helpers/patterns for how to write the test
- Follow the project's commit conventions for Step 7 (detect them;
git-commitif present) - If Step 7 needs a new branch (e.g. you were on the default branch), resolve and state its base first — default branch unless explicitly confirmed otherwise (worktree's branch-base rule)
- If the project tracks coverage (
.context/audits/test-coverage/module-map.jsonexists) and the bug lived in a mapped module, note in the wrap-up: a real bug here is evidence of a coverage hole — suggest/aidex:audit coverage-sweepand, if the fix revealed a flow with no depth coverage, aCOV-<module>-<n>finding. - If the project tracks a changelog, update it per the project's own rules
- Proof of done. The RED→GREEN pair is the proof the bug is fixed — don't
claim it without it. Record it as one commit-body line naming (a) the RED
failure reason and (b) the GREEN command + result — e.g.
RED: AssertionError expected full IBAN / GREEN: vitest 730/730. For a rare larger capture, save it under.context/proofs/<slug>/and reference it viaproof_linksperconventions(00-global.md§7.1). This is a byproduct of Steps 3 and 5, not a separate step. - Loop (opt-in): once the RED test exists and the root cause is understood, a fix that needs
many mechanical variations to land green can be spec'd as an
looploop-spec (stop condition = the RED test passes and the selected suite stays green, with the full suite once at the loop's end, not per iteration) and handed to/goalorralph-loop. Default stays the in-session RED→fix→GREEN cycle — do not make this skill a loop runner. Guardrail: a single green test rewards overfitting, not a real fix — the gate must be the test plus the Step-1 root-cause hypothesis plus the suite covering the diff (the full one at the integration boundary), ideally with a maker≠checker split, and only once the RED test failed for the right reason (Step 3). Green-one-test ≠ bug fixed.
Exception: Visual/CSS-only Bugs
When a bug is purely visual (CSS layout, spacing, colors) and cannot be tested programmatically:
- Still investigate root cause
- Document the visual issue clearly
- Fix it
- Write a smoke test if any aspect is testable (e.g., component renders, class is applied)
- Commit with clear description of what was visually broken
- Before it merges, run the UI evidence gate on step 9's proof file:
${CLAUDE_PLUGIN_ROOT}/skills/plan-exec/scripts/check-ui-evidence.sh --visual .context/proofs/<slug>/human-verification.md. The script owns the threeui-*lines "verified" needs (the owner's verdict on the before/after review page, the gate's closing line from a run with no snapshot update, the predicate review) and what each must say to pass;/ui-contractowns how to produce them. A project with no gallery harness recordsui-evidence: skipped — no gallery harness in this projectthere instead. Exit 1 or 2 means the visual fix is not verified — never report it fixed on the smoke test alone.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

