bug-reproduction
Skill9 starsChanged 4 months agoMITView on GitHub
Reproduce a bug with a failing test before fixing it. Use when investigating a bug, working a bug report or issue, or before attempting any fix — always reproduce first. Pairs with the /fix-bug workflow.
We split this skill into the rules it gives an agent
26 rules. About 0 are common, 24 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈24
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Before attempting ANY fix — always reproduce first
- Very specific: line 15
When using the /fix-bug command
- Distinctive: line 27
Read the bug description carefully.
- Distinctive: line 30
Trigger conditions: When does it occur? (specific input, state, timing)
- Distinctive: line 32
Check for additional context:
- Distinctive: line 39
Search for the affected code path:
- Distinctive: line 52
Read the code and trace the execution path from trigger to failure.
- Distinctive: line 56
Write a test that:
- Distinctive: line 76
Run the test and confirm it fails:
- Distinctive: line 83
Check that the test fails for the RIGHT reason:
- Distinctive: line 86
If the test passes, the bug is not reproduced — revisit Step 1
- Distinctive: line 90
After implementing the fix:
- Distinctive: line 91
Run the reproduction test — it should now PASS
- Distinctive: line 92
Run the full test suite — no regressions
- Distinctive: line 104
Don't mock the bug away — test the real code path
- Distinctive: line 105
Don't write a test that passes — it must FAIL first
- Distinctive: line 106
Don't fix the bug before writing the test
- Distinctive: line 107
Don't write overly broad tests — isolate the specific bug
- Distinctive: line 108
Don't skip running the test before fixing — you need to SEE it fail
- Distinctive: line 109
Don't assume the first failure is the right failure — verify the error relates to the bug
- Distinctive: line 115
When the bug involves UI behavior that can't easily be unit tested, create a test plan document:
- Distinctive: line 136
Prefer screenshots over selector-based assertions (less fragile)
- Distinctive: line 137
Run browser checks in subagents for isolation
- Distinctive: line 138
Document visual references with file paths
- Very specific: line 149
CLI bugs: Run dotcontext init or dotcontext update --templates in a temp directory and check output
- Distinctive: line 151
Template bugs: Check that files are downloaded correctly and contain expected content
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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
Skill: Bug Reproduction
When to Use
- You encounter a bug that needs fixing
- You're working on a bug report or issue
- Before attempting ANY fix — always reproduce first
- When using the
/fix-bugcommand
Test Framework
- Framework: Manual testing + shellcheck (bash CLI project, no unit test framework)
- Run command:
bash -n dotcontext(syntax check),shellcheck dotcontext(lint) - Test directory: N/A — testing is manual via
dotcontext initin a temp directory
How to Reproduce a Bug
Step 1: Understand the Bug
Read the bug description carefully. Identify:
- Expected behavior: What should happen?
- Actual behavior: What happens instead?
- Trigger conditions: When does it occur? (specific input, state, timing)
Check for additional context:
- Error logs or stack traces
- Screenshots or recordings
- Related GitHub issues or PRs
Step 2: Locate the Code
Search for the affected code path:
# Search by error message
grep -r "error message text" src/
# Search by function/method name
grep -r "functionName" src/
# Search by route/endpoint
grep -r "/api/endpoint" src/Read the code and trace the execution path from trigger to failure.
Step 3: Write a Failing Test
Write a test that:
- Sets up the conditions that trigger the bug
- Performs the action that causes the failure
- Asserts the EXPECTED (correct) behavior
The test must FAIL — proving the bug exists.
# Example pattern (adapt to your framework):
describe("bug: [short description]") {
it("should [expected behavior] when [condition]") {
// Arrange: set up the conditions
// Act: perform the action that triggers the bug
// Assert: check for correct behavior (this should FAIL)
}
}Step 4: Verify the Failure
Run the test and confirm it fails:
# Run the specific test
[test command] [test file]Check that the test fails for the RIGHT reason:
- The assertion should fail because of the bug, not because of a typo in the test
- The error message should relate to the actual bug behavior
- If the test passes, the bug is not reproduced — revisit Step 1
Step 5: Fix and Verify
After implementing the fix:
- Run the reproduction test — it should now PASS
- Run the full test suite — no regressions
# Run reproduction test
[test command] [test file]
# Run full suite
[test command]Anti-Patterns
- Don't mock the bug away — test the real code path
- Don't write a test that passes — it must FAIL first
- Don't fix the bug before writing the test
- Don't write overly broad tests — isolate the specific bug
- Don't skip running the test before fixing — you need to SEE it fail
- Don't assume the first failure is the right failure — verify the error relates to the bug
UI Bugs
Markdown Test Plans
When the bug involves UI behavior that can't easily be unit tested, create a test plan document:
## Test Plan: [Bug Description]
### Steps to Reproduce
1. Navigate to [URL/page]
2. [Action 1]
3. [Action 2]
4. Expected: [what should happen]
5. Actual: [what happens instead]
### Validation Method
- [ ] Screenshot comparison
- [ ] DOM element assertion
- [ ] Network request validation
- [ ] Console error checkBrowser Validation
- Prefer screenshots over selector-based assertions (less fragile)
- Run browser checks in subagents for isolation
- Document visual references with file paths
E2E Test Patterns
- E2E Framework: N/A (CLI tool — test via manual invocation)
- Run command:
dotcontext init --yes --no-setupin a temp directory - Test directory: N/A
Examples from This Codebase
This project is a bash CLI with markdown command templates. Bug reproduction involves:
- CLI bugs: Run
dotcontext initordotcontext update --templatesin a temp directory and check output - Command template bugs: Invoke the slash command in Claude Code and verify behavior
- Template bugs: Check that files are downloaded correctly and contain expected content
- Syntax validation:
bash -n dotcontextcatches syntax errors
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- DodoraApp/DodoStream★ 243same name
- petrkindlmann/qa-skills★ 209same name
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 repository7 other files it gives its agents.
- templates/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- templates/CLAUDE.mdCLAUDE.md
- add-cli-subcommandSkill
- add-new-commandSkill
- batch-operationsSkill
- git-platformSkill
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.

