agentleFS
Baba01hacker666Baba01hacker666/dummyskills/skills/regression-test-writer/SKILL.md

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.

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
  1. Distinctive:

    Use this skill when:

    line 14
  2. Very specific:

    Do not use as a throwaway manual repro script.

    line 20
  3. Very specific:

    Do not use to review diffs.

    line 21
  4. Very specific:

    If test_runner is unknown: inspect package.json, Makefile, or pyproject.toml to find it.

    line 29
  5. Very specific:

    If target_test_file is not specified: place next to existing tests matching test_*.py or *.test.ts.

    line 30
  6. Distinctive:

    Do not invent new testing libraries.

    line 31
  7. Distinctive:

    Follow these numbered actions:

    line 34
  8. Distinctive:

    Read 1 existing test in the target suite to mimic its assertion style, naming conventions, and imports.

    line 36
  9. Distinctive:

    Keep test execution fast (< 100ms) with no external network dependencies.

    line 39
  10. Distinctive:

    If the test requires database access: use existing test database fixtures or SQLite in-memory mocks.

    line 46
  11. Very specific:

    Never write assert True or vacuous tests that pass regardless of logic.

    line 47
  12. Distinctive:

    Stop and ask the user when:

    line 82
  13. Distinctive:

    No test framework is configured in the repository.

    line 83

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. If test_runner is unknown: inspect package.json, Makefile, or pyproject.toml to find it.
  2. If target_test_file is not specified: place next to existing tests matching test_*.py or *.test.ts.
  3. Do not invent new testing libraries; use whatever framework is already installed.

6. Procedure

Follow these numbered actions:

  1. Action 1: Match Existing Test Style
    • Read 1 existing test in the target suite to mimic its assertion style, naming conventions, and imports.
  2. 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.
  3. Action 3: Run Test Suite
    • Execute the targeted test using project runner.
  4. 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 True or 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.ts

Output:

### 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.04s

Download now (ZIP)

Does 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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.