test-driven-debug
Skill4 starsChanged 4 months agoMITView on GitHub
Debug and fix bugs with a regression-test Red-Green cycle and a living Debug Note. Use for unintended code behavior, including bugs found during code review or testing.
In this repository14 other files it gives its agents.
- AGENTS.mdAGENTS.md
- build-incrementalSkill
- code-simplifySkill
- create-or-clone-repositorySkill
- design-firstSkill
- implementation-workflowSkill
- manage-git-worktreesSkill
- plan-driven-developmentSkill
- setup-wiki-backed-project-skillsSkill
- subagent-supervisionSkill
- task-briefSkill
- tidy-firstSkill
- write-personal-wikiSkill
- write-project-wikiSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Use this skill to fix:
- Distinctive: line 18
Do not use it for new features or intentional behavior changes.
- Very specific: line 20
Create .agent-work/debug/{YYYY-MM-DD}-{short-task-name}.md from the template below.
- Distinctive: line 28
Establish Green: Run the regression test and any preservation tests selected in step 3.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Test Driven Debug
Trace a bug to its cause, prove it with a failing regression test, fix the cause, and verify the test turns green.
When to Use
Use this skill to fix:
- bugs found during code review
- regressions or failing tests caused by unintended behavior
- behavior that violates an existing expectation or contract
Do not use it for new features or intentional behavior changes.
Create .agent-work/debug/{YYYY-MM-DD}-{short-task-name}.md from the template below. If creating .agent-work/, create .agent-work/.gitignore containing only *; do not modify the repository root .gitignore. Update the matching section and progress after each step; keep evidence and decisions, not raw logs.
Workflow
- Define the issue. Record the observed and expected behavior, reproduction conditions, scope, and constraints. Separate facts from assumptions.
- Identify the cause. Reproduce the issue through the smallest reliable path when practical, trace the real code path, and validate where behavior diverges. Do not fix without evidence for both the failure and its cause.
- Establish Red. Add or identify a regression test for the expected behavior, using a public behavior path when practical. Add focused preservation tests only for uncovered behavior the fix could break. Before the fix, confirm the regression test fails for the intended reason and any preservation tests pass.
- Fix the cause. Apply the smallest clear correction without weakening the tests or adding unrequested fallback behavior. Return to the earliest affected step if new evidence invalidates the cause or test.
- Establish Green. Run the regression test and any preservation tests selected in step 3. Set the Debug Note status to Complete only when the cause is supported, the regression test changed from Red to Green for the intended reason, and any preservation tests pass.
Debug Note
# Debug: {Task}
- Status: In progress
- Started: {YYYY-MM-DD}
## Issue
- Observed: {Incorrect behavior}
- Expected: {Correct behavior}
- Reproduction: {Conditions or command}
- Scope and constraints: {Boundaries and known constraints}
## Progress
- [ ] 1. Define the Issue
- [ ] 2. Identify the Cause
- [ ] 3. Establish Red
- [ ] 4. Fix the Cause
- [ ] 5. Establish Green
## Investigation
- Evidence: {Confirmed facts and relevant code path}
- Cause: {Supported causal explanation}
## Tests
- Regression: {Test name or location}
- Red: {Command, observed failure, and why it proves the bug}
- Preservation: {At-risk behavior, focused tests, and pre-fix results, or `None`}
## Fix
- Change: {Correction to the identified cause}
## Verification
- Green: {Regression test command and passing result}
- Preservation: {Post-fix results, or `None`}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.

