test-first-change
Reduce regressions by discovering tests, running them, then editing code
When & Why to Use This Skill
The Test-First Change skill is a specialized developer tool designed to minimize software regressions and enhance code reliability. By automating a disciplined workflow of test discovery, baseline execution, and post-modification verification, it ensures that every code change is validated against existing test suites, fostering a robust Test-Driven Development (TDD) environment for AI agents.
Use Cases
- Refactoring Legacy Code: Safely update older codebases by automatically identifying and running relevant tests to ensure no breaking changes are introduced.
- Feature Implementation: Maintain high software quality during the development of new features by verifying that existing functionalities remain intact through automated regression testing.
- Bug Fixing and Validation: Confirm that a bug fix is effective and doesn't create side effects by running targeted test suites before and after the code edit.
- CI/CD Workflow Integration: Enhance the local development process by simulating a continuous integration environment where tests are the primary gatekeeper for code modifications.
| 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