regression-test-writer
Skill0 starsChanged 2 months agoMITView on GitHub
Authors an automated regression test that fails before a bug fix and passes after it.
In this repository49 other files it gives its agents.
- bug-reproducerSkill
- claim-checkerSkill
- command-failure-diagnoserSkill
- config-risk-reviewerSkill
- csv-validatorSkill
- deployment-checklist-makerSkill
- diff-reviewerSkill
- factual-summarizerSkill
- field-extractorSkill
- api-contract-testerSkill
- database-migration-helperSkill
- security-vulnerability-fixerSkill
- git-commit-stagerSkill
- git-conflict-resolverSkill
- github-actions-debuggerSkill
- github-issue-triagerSkill
- github-pr-creatorSkill
- github-pr-reviewerSkill
- go-code-qualitySkill
- go-lint-and-vetSkill
- go-testingSkill
- json-schema-converterSkill
- lint-and-typecheckSkill
- meaning-preserving-editorSkill
- meeting-notes-to-actionsSkill
- minimal-bug-fixSkill
- option-comparatorSkill
- py-code-qualitySkill
- py-lint-and-typecheckSkill
- py-testingSkill
- readme-writerSkill
- release-notes-drafterSkill
- repo-inspectorSkill
- research-briefSkill
- reversible-cleanup-plannerSkill
- rust-clippy-checkSkill
- rust-code-qualitySkill
- rust-testingSkill
- small-refactorSkill
- status-updateSkill
- step-by-step-tutorialSkill
- step-decomposerSkill
- tabular-analyzerSkill
- task-briefSkill
- test-runner-debuggerSkill
- ts-code-qualitySkill
- ts-lint-and-typecheckSkill
- ts-testingSkill
- skill-templateSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 8 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Use this skill when:
- Very specific: line 20
Do not use as a throwaway manual repro script.
- Very specific: line 21
Do not use to review diffs.
- Very specific: line 29
If test_runner is unknown: inspect package.json, Makefile, or pyproject.toml to find it.
- Very specific: line 30
If target_test_file is not specified: place next to existing tests matching test_*.py or *.test.ts.
- Distinctive: line 31
Do not invent new testing libraries.
- Distinctive: line 34
Follow these numbered actions:
- Distinctive: line 36
Read 1 existing test in the target suite to mimic its assertion style, naming conventions, and imports.
- Distinctive: line 39
Keep test execution fast (< 100ms) with no external network dependencies.
- Distinctive: line 46
If the test requires database access: use existing test database fixtures or SQLite in-memory mocks.
- Very specific: line 47
Never write assert True or vacuous tests that pass regardless of logic.
- Distinctive: line 82
Stop and ask the user when:
- Distinctive: line 83
No test framework is configured in the repository.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Regression Test Writer
Adds a clean, automated regression test to the existing test suite. Ensures fixed bugs never return undetected.
1. Purpose
Lock in a bug fix with an automated test case. A "Regression Test" tests the exact boundary condition that previously caused a failure, running in CI alongside existing tests.
2. When to Use
Use this skill when:
- A bug fix has been prepared or applied.
- Adding test coverage for newly discovered edge cases.
- Preventing regressions during ongoing refactors.
3. When Not to Use
- Do not use as a throwaway manual repro script; use
bug-reproducer. - Do not use to review diffs; use
diff-reviewer.
4. Required Inputs
bug_description: What failed and under what input.target_test_file: Existing test file or new test path.test_runner: The project test command (e.g.npm test,pytest).
5. Missing-Input Behavior
- If
test_runneris unknown: inspectpackage.json,Makefile, orpyproject.tomlto find it. - If
target_test_fileis not specified: place next to existing tests matchingtest_*.pyor*.test.ts. - Do not invent new testing libraries; use whatever framework is already installed.
6. Procedure
Follow these numbered actions:
- Action 1: Match Existing Test Style
- Read 1 existing test in the target suite to mimic its assertion style, naming conventions, and imports.
- Action 2: Author Focused Test Case
- Name the test descriptively (e.g.,
test_divide_by_zero_raises_error). - Keep test execution fast (< 100ms) with no external network dependencies.
- Name the test descriptively (e.g.,
- Action 3: Run Test Suite
- Execute the targeted test using project runner.
- Action 4: Emit Test Documentation
- Format using Section 8.
7. Decision Rules
- If the test requires database access: use existing test database fixtures or SQLite in-memory mocks.
- Never write
assert Trueor vacuous tests that pass regardless of logic.
8. Output Format
Emit the test summary using this template:
### Regression Test: [Test Name]
- **Test File**: `[path to test file]`
- **Framework**: [e.g., Jest, Vitest, Pytest, Go testing]
- **Execution Command**: `[command to run just this test]`
#### Test Implementation
```[language]
[Test function code]Execution Evidence
[Terminal test output confirming pass]
## 9. Verification Checklist
- [ ] Test code adheres to existing project testing conventions.
- [ ] Test has explicit assertions that would fail if bug was reintroduced.
- [ ] Test executes deterministically without network calls.
- [ ] Test suite passes cleanly.
## 10. Common Failures and Recovery
| Failure Symptom | Cause | Recovery Action |
| :--- | :--- | :--- |
| Test passes even on broken code | Asserting on wrong value | Re-verify that assertion checks the specific fixed property. |
| Test breaks CI due to missing mock | Calling real external API | Mock the network request using project's mock library. |
## 11. Stop or Escalation Conditions
Stop and ask the user when:
- No test framework is configured in the repository.
## 12. Examples
### Example 1: Successful Execution
**Input:**
```text
Bug: Empty string in parseCSV() caused unhandled crash. Fixed in src/csv.ts.
Framework: Vitest
File: tests/csv.test.tsOutput:
### Regression Test: parseCSV handles empty string cleanly
- **Test File**: `tests/csv.test.ts`
- **Framework**: Vitest
- **Execution Command**: `npx vitest run tests/csv.test.ts`
#### Test Implementation
```typescript
it('returns empty array when input is empty string', () => {
const result = parseCSV('');
expect(result).toEqual([]);
});Execution Evidence
✓ tests/csv.test.ts (1)
✓ returns empty array when input is empty string
Test Files 1 passed (1)
Tests 1 passed (1)
### Example 2: Ambiguous or Missing Input
**Input:**
```text
Add a test.Output:
### Regression Test: Halted - Missing Target
- **Status**: Halted
Please specify:
1. The bug or behavior to test.
2. The target test file or module name.Example 3: Expected Final Output
Output:
### Regression Test: User age negative boundary
- **Test File**: `tests/test_validation.py`
- **Framework**: Pytest
- **Execution Command**: `pytest tests/test_validation.py -k test_negative_age`
#### Test Implementation
```python
def test_negative_age_raises_validation_error():
with pytest.raises(ValidationError, match="Age must be positive"):
validate_user_profile({"name": "Test", "age": -5})Execution Evidence
tests/test_validation.py::test_negative_age_raises_validation_error PASSED [100%]
1 passed in 0.04sDoes 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.

