Install any skill in seconds. Free to start, no credit card required.
Get Started Free →This skill should be used when the user reports a bug, describes unexpected behavior, says something is "broken", "not working", "failing", mentions an "error", "issue", or "problem" in code, or asks to "fix" something. Enforces test-driven bug fixing workflow.
.claude/skills/jamditis-test-first-bugs/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-08 | ✗→✓ | ▲ Improved | 27% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 115% | 0% |
| case-18 | ✗→✓ | ▲ Improved | 25% | 0% |
| case-19 | ✗→✓ | ▲ Improved | 70% | 0% |
| case-22 | ✗→✓ | ▲ Improved | 2% | 0% |
Enforce a disciplined bug-fixing workflow that prevents regression and parallelizes fix attempts.
When a bug is reported, follow these steps in order:
tests/, __tests__/, spec/, *.test.*, *.spec.* patterns)subagent_type=general-purpose to attempt fixesName the test to describe the bug:
python# Python (pytest) def test_user_login_fails_when_email_has_uppercase(): ... # Python (unittest) def test_should_handle_empty_input_without_crashing(self): ...
javascript// JavaScript (Jest/Vitest) it('should not crash when input array is empty', () => { ... }); test('handles special characters in username', () => { ... });
typescript// TypeScript describe('UserService', () => { it('returns null when user not found instead of throwing', () => { ... }); });
Every bug reproduction test follows this pattern:
pythondef test_bug_description(): # 1. ARRANGE - Set up the conditions that trigger the bug input_data = create_problematic_input() # 2. ACT - Perform the action that causes the bug result = function_under_test(input_data) # 3. ASSERT - Verify the expected (correct) behavior assert result == expected_value # This should FAIL initially
Check the project structure for existing test patterns:
bash# Find test files find . -name "*.test.*" -o -name "*.spec.*" -o -name "test_*.py" | head -20 # Find test directories ls -la tests/ __tests__/ spec/ test/ 2>/dev/null # Check package.json for test command grep -A5 '"test"' package.json
Use the Task tool to parallelize fix attempts:
Task tool parameters:
- subagent_type: "general-purpose"
- description: "Fix [bug description]"
- prompt: Include:
1. The bug description
2. The failing test location and contents
3. Suspected cause (if known)
4. Constraint: "Run the test to verify your fix works"Launch multiple subagents with different approaches:
If the project has no test infrastructure:
bash# Python pip install pytest mkdir -p tests && touch tests/__init__.py # JavaScript/TypeScript npm install --save-dev jest # or npm install --save-dev vitest # Go # Tests are built-in, create *_test.go files
After subagent reports completion:
bash# Run the specific test pytest tests/test_module.py::test_bug_description -v npm test -- --grep "bug description" go test -run TestBugDescription -v # Run full suite to check for regressions pytest npm test go test ./...
User reports: "The login function crashes when email has spaces"
Phase 1, Write failing test:
python# tests/test_auth.py def test_login_handles_email_with_spaces(): """Bug: Login crashes when email contains spaces""" auth = AuthService() # This should return an error, not crash result = auth.login("user @example.com", "password") assert result.success == False assert "invalid email" in result.error.lower()
Run test to confirm it fails:
bashpytest tests/test_auth.py::test_login_handles_email_with_spaces -v # Expected: FAILED (demonstrates the bug)
Phase 2, Launch subagent:
Task tool:
- subagent_type: "general-purpose"
- description: "Fix email space crash"
- prompt: "Fix the login crash when email contains spaces.
Bug: AuthService.login() crashes instead of returning error when email has spaces.
Failing test: tests/test_auth.py::test_login_handles_email_with_spaces
After fixing, run: pytest tests/test_auth.py::test_login_handles_email_with_spaces -v
The test must pass to confirm the fix."Phase 3, Verify:
bash# Specific test passes pytest tests/test_auth.py::test_login_handles_email_with_spaces -v # PASSED # No regressions pytest tests/test_auth.py -v # All tests pass
The bug-report-detector hook in this plugin automatically:
references/test-frameworks.md, Framework-specific test patternsreferences/common-bugs.md, Common bug patterns and test strategiesexamples/python-bug-test.py, Python pytest exampleexamples/js-bug-test.js, JavaScript Jest examplescripts/find-tests.sh, Locate test infrastructure in a project| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 1,666 | 5,577 | +235% | 1 | 1 | 0% | 208 | 1,890 | +809% | 0 | 0 | — |
case-02 | fail→fail | 3,211 | 13,828 | +331% | 1 | 1 | 0% | 182 | 1,803 | +891% | 0 | 0 | — |
case-03 | fail→fail | 21,056 | 3,817 | -82% | 1 | 1 | 0% | 3,759 | 1,731 | -54% | 0 | 0 | — |
case-04 | pass→fail | 17,494 | 3,370 | -81% | 1 | 1 | 0% | 3,647 | 1,831 | -50% | 0 | 0 | — |
case-05 | fail→fail | 1,711 | 4,290 | +151% | 1 | 1 | 0% | 295 | 1,888 | +540% | 0 | 0 | — |
case-06 | pass→fail | 4,944 | 5,385 | +9% | 1 | 1 | 0% | 949 | 1,851 | +95% | 0 | 0 | — |
case-07 | pass→pass | 10,493 | 4,918 | -53% | 1 | 1 | 0% | 1,892 | 2,445 | +29% | 0 | 0 | — |
case-08 | fail→pass | 8,722 | 2,405 | -72% | 1 | 1 | 0% | 1,561 | 1,986 | +27% | 0 | 0 | — |
case-09 | pass→pass | 8,913 | 5,719 | -36% | 1 | 1 | 0% | 1,571 | 2,607 | +66% | 0 | 0 | — |
case-10 | pass→pass | 7,123 | 3,199 | -55% | 1 | 1 | 0% | 1,335 | 2,154 | +61% | 0 | 0 | — |
case-11 | pass→pass | 12,180 | 7,719 | -37% | 1 | 1 | 0% | 2,328 | 2,994 | +29% | 0 | 0 | — |
case-12 | fail→pass | 5,904 | 3,133 | -47% | 1 | 1 | 0% | 971 | 2,090 | +115% | 0 | 0 | — |
case-13 | pass→pass | 6,461 | 2,755 | -57% | 1 | 1 | 0% | 1,056 | 2,005 | +90% | 0 | 0 | — |
case-14 | pass→pass | 18,112 | 12,539 | -31% | 1 | 1 | 0% | 2,802 | 3,633 | +30% | 0 | 0 | — |
case-15 | pass→pass | 8,186 | 4,566 | -44% | 1 | 1 | 0% | 1,637 | 2,409 | +47% | 0 | 0 | — |
case-16 | pass→pass | 8,790 | 4,684 | -47% | 1 | 1 | 0% | 1,538 | 2,439 | +59% | 0 | 0 | — |
case-17 | pass→pass | 11,130 | 8,756 | -21% | 1 | 1 | 0% | 2,282 | 3,222 | +41% | 0 | 0 | — |
case-18 | fail→pass | 10,515 | 11,585 | +10% | 1 | 1 | 0% | 2,076 | 2,603 | +25% | 0 | 0 | — |
case-19 | fail→pass | 9,965 | 7,320 | -27% | 1 | 1 | 0% | 1,671 | 2,833 | +70% | 0 | 0 | — |
case-20 | pass→pass | 2,666 | 2,167 | -19% | 1 | 1 | 0% | 514 | 1,909 | +271% | 0 | 0 | — |
case-21 | pass→pass | 39,046 | 3,590 | -91% | 1 | 1 | 0% | 1,414 | 2,193 | +55% | 0 | 0 | — |
case-22 | fail→pass | 13,035 | 4,604 | -65% | 1 | 1 | 0% | 2,364 | 2,404 | +2% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 16 counted toward the lift figure. The other 6 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +14 percentage points is the difference between those two pass rates over the 16 comparable cases. 3 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
| Model | Method | Date | Lift |
|---|---|---|---|
| gemini-3.6-flash | verified | 8/21/2026 | +14% |
Other measured skills in the registry, with their headline benchmark lift.