agentleFS
KangaKodeKangaKode/universal-agent-bootstrap/.cursor/rules/test-first.mdc

universal-agent-bootstrap / rules

Cursor rule0 starsChanged 7 months agoMITView on GitHub

Require tests before behavioral implementation changes, with scoped exemptions for docs, config, and tiny covered fixes.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 1

    1. KangaKode/universal-agent-workflow-template★ 0100% same

    Edited · 0

    None found.

    Wrote their own version · 0

    None found.

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.

    Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository6 other files it gives its agents.

The file

We split this test-first.mdc into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    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:

    Write or update the test before implementation code.

    line 12
  2. Distinctive:

    Run the focused test and confirm it fails for the expected reason.

    line 13
  3. Distinctive:

    Write the minimum implementation needed to pass.

    line 14
  4. Distinctive:

    Run the focused test and confirm it passes.

    line 15
  5. Distinctive:

    Run the relevant wider suite before committing.

    line 16
  6. Distinctive:

    Keep tests and implementation in the same commit.

    line 37

≈ “Common” is an estimate: at least 1 in 5 of the 3,030 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.mdc
---
description: Require tests before behavioral implementation changes, with scoped exemptions for docs, config, and tiny covered fixes.
alwaysApply: true
---

# test-first

## Red-Green Cycle

For behavioral code changes, use a test-first loop:

1. Write or update the test before implementation code.
2. Run the focused test and confirm it fails for the expected reason.
3. Write the minimum implementation needed to pass.
4. Run the focused test and confirm it passes.
5. Run the relevant wider suite before committing.

## Applies To

- New product behavior or public APIs
- Bug fixes that change meaningful logic
- Refactors that may affect behavior
- Auth, security, persistence, orchestration, agent, or eval logic
- Cross-module contracts and shared utilities

## Does Not Apply To

- Planning, design docs, and review-only work
- Documentation-only edits
- Config-only or dependency metadata changes
- Formatting, generated files, and mechanical renames
- Tiny fixes already covered by existing tests
- Exploratory spikes that will be rewritten before merge

## Commit Rule

Keep tests and implementation in the same commit. If the test is hard to write,
pause and simplify the interface before adding more code.

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.