agentleFS
Fullive-AIFullive-AI/Anima/.cursor/rules/Test-First-For-Bugs-And-Regression.mdc

Anima / rules

Cursor rule1k starsChanged 5 months agoApache-2.0View on GitHub

For bug fixes and regression-sensitive work, use tests to reproduce, protect, and verify behavior whenever practical. Do not just patch the symptom. First understand the failing behavior, then protect against its return. Prefer tests that: After fixing a bug, also consider: A bug fix is stronger when it leaves behind proof that the bug will be caught if it returns.

We split this Test-First-For-Bugs-And-Regression.mdc into the rules it gives an agent

9 rules. About 0 are common, 9 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not just patch the symptom.

    line 9
  2. Distinctive:

    run adjacent relevant checks to guard against regressions

    line 18
  3. Distinctive:

    prefer targeted tests over broad blind runs at first

    line 22
  4. Distinctive:

    add regression coverage for real bugs when practical

    line 23
  5. Distinctive:

    test the root behavior, not just incidental implementation details

    line 24
  6. Distinctive:

    keep tests readable and aligned with project conventions

    line 26
  7. Distinctive:

    document the failure mode clearly in your reasoning

    line 41
  8. Distinctive:

    add a test if the codebase supports it and the scope allows it

    line 43
  9. Distinctive:

    After fixing a bug, also consider:

    line 47

≈ “Common” is an estimate: at least 1 in 5 of the 6,350 Cursor rule 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
Test-First-For-Bugs-And-Regression.mdc
---
alwaysApply: true
---

For bug fixes and regression-sensitive work, use tests to reproduce, protect, and verify behavior whenever practical.

## Core rule

Do not just patch the symptom. First understand the failing behavior, then protect against its return.

## Preferred workflow for bug fixes

1. identify the failing behavior clearly
2. locate or create the most targeted test that captures it
3. confirm the failure when feasible
4. implement the fix
5. re-run the test
6. run adjacent relevant checks to guard against regressions

## Testing principles

- prefer targeted tests over broad blind runs at first
- add regression coverage for real bugs when practical
- test the root behavior, not just incidental implementation details
- include edge cases if they are directly related to the failure
- keep tests readable and aligned with project conventions

## When adding a new test

Prefer tests that:

- fail before the fix
- pass after the fix
- clearly describe the intended behavior
- are narrow enough to diagnose future regressions quickly

## If a test cannot be added immediately

Then still:

- document the failure mode clearly in your reasoning
- validate the fix using the strongest available check
- add a test if the codebase supports it and the scope allows it

## Regression mindset

After fixing a bug, also consider:

- nearby code paths using the same logic
- boundary conditions
- serialization or interface effects
- consumer-facing side effects
- whether similar bugs could exist in sibling flows

## Completion rule

A bug fix is stronger when it leaves behind proof that the bug will be caught if it returns.

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.

Reviews can't be read right now.

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.