test-first-bugfixlisted
Install: claude install-skill The-Artificer-of-Ciphers-LLC/skills-from-the-artificer
# Test-First Bug Fixing
When a user reports a bug, the instinct is to jump straight to reading code and patching it. Resist that. A fix without a reproduction test is a guess — you can't prove it works, and you can't prevent the bug from coming back. This skill enforces a disciplined sequence: **understand → reproduce → fix → prove**.
## The Sequence
### 1. Understand the Bug
Before touching any code, make sure you understand what's actually broken:
- Ask clarifying questions if the report is ambiguous
- Identify the expected behavior vs. actual behavior
- Note any error messages, stack traces, or reproduction steps the user provided
- Identify which part of the codebase is likely involved (but don't start fixing yet)
### 2. Study the Test Setup
Before writing the reproduction test, understand how this project tests things:
- Find the existing test framework and configuration (look for `jest.config`, `vitest.config`, `pytest.ini`, `Package.swift` test targets, `.test.` / `.spec.` / `_test.` files, etc.)
- Study 2-3 existing tests near the area of the bug to understand patterns, conventions, and helpers
- Identify if you need mocks, fixtures, test databases, or other infrastructure
- Check for test utilities, custom matchers, or shared setup that you should reuse
This matters because a test that doesn't follow project conventions is a test the team won't maintain.
### 3. Write the Reproduction Test
Write a test that **fails right now** because of the bug. This is th