test-first-change
Reduce regressions by discovering tests, running them, then editing code
When & Why to Use This Skill
The Test-First Change skill automates a rigorous Test-Driven Development (TDD) workflow for Claude, ensuring code integrity by discovering and executing tests before any modifications are made. By establishing a baseline and verifying changes post-implementation, it effectively eliminates regressions and maintains high software quality standards.
Use Cases
- Safe Refactoring: Use the skill to modify legacy codebases with confidence by automatically verifying that existing functionality remains intact throughout the refactoring process.
- Regression Prevention: Ensure that new feature additions or bug fixes do not inadvertently break existing modules by enforcing a strict 'test-before-edit' protocol.
- Automated Quality Gates: Integrate into development workflows to maintain high code coverage and stability, requiring successful test execution as a prerequisite for any AI-driven code updates.
| name | test-first-change |
|---|---|
| description | Reduce regressions by discovering tests, running them, then editing code |
| version | 1.0.0 |
| tags | [testing, tdd, quality, regression] |
Test-First Change Skill
Purpose
Ensure code changes don't introduce regressions by forcing test discovery and execution before modifications.
Process
- Discover existing tests for target code
- Run tests to establish baseline
- Make code changes
- Re-run tests to verify
- Log changes to memory
Scripts
run_tests.sh: Execute test suite with coveragediff_summary.py: Generate change summary for memory
Safety
- Never edit code before running tests
- Quarantine flaky tests
- Require 80%+ coverage on changes
Test-First Change v1.0.0