Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/barisercan/cursorrulesWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/barisercan/cursorrules/test-driven-development)<a href="https://agentmods.dev/rules/barisercan/cursorrules/test-driven-development"><img src="https://agentmods.dev/badge/rules/barisercan/cursorrules/test-driven-development/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/barisercan/cursorrules/test-driven-development"><img src="https://agentmods.dev/badge/rules/barisercan/cursorrules/test-driven-development.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01054 | $0.01054 |
| Opus 5.5 | $0.00422 | $0.00422 |
| Sonnet 5.5 | $0.00211 | $0.00211 |
| Haiku 4.5 | $0.00105 | $0.00105 |
Grade A, and why
test-driven-development scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 135 lines — stays where its author put it; the contents beside it link to each section on GitHub.
description: Enforce test-driven development with atomic steps and user verification at each stage globs: "**/*" alwaysApply: true
Test-Driven Development Rule
Enforce test-driven development practices with atomic steps and user verification.
actions:
-
type: enforce message: | TEST-DRIVEN DEVELOPMENT PROTOCOL
MANDATORY TDD WORKFLOW:
-
ALWAYS START WITH TESTS:
- Plan and write tests BEFORE writing implementation code
- Create tests for every new feature, bug fix, or change
- Follow Red-Green-Refactor cycle
-
ATOMIC TEST STEPS:
- Write ONE test at a time
- Keep each test focused on a single behavior
- Do not write long test suites all at once
- Stop after each atomic test step
-
USER VERIFICATION REQUIRED:
- After writing each test, wait for user verification
- Let user review and approve test before proceeding
- Only continue to implementation after test approval
- User must confirm each step before moving forward
-
COVERAGE REQUIREMENTS:
- Aim for full or near-full test coverage
- Cover edge cases and error scenarios
- Test both positive and negative paths
- Document any untested code with clear reasoning
-
FRAMEWORK DEPENDENCY:
- Use testing frameworks specified by user
- Follow user's testing patterns and conventions
- Ask user to specify testing approach if unclear
- Adapt to existing test structure in codebase
-
INCREMENTAL APPROACH:
- Small, verifiable steps only
- No large code blocks without tests
- Each implementation should make tests pass
- Refactor only after tests are green
-
CONTINUOUS TESTING:
- Any change to src/ directory triggers all tests
- Must ensure all tests pass before proceeding
- Fix broken tests immediately
- No code changes without verified test coverage
WORKFLOW STEPS:
- Understand requirement
- Write failing test (Red)
- STOP - Get user verification
- Write minimal code to pass test (Green)
- RUN ALL TESTS - Ensure nothing breaks
- STOP - Get user verification
- Refactor if needed (Refactor)
- RUN ALL TESTS - Verify refactor didn't break anything
- STOP - Get user verification
- Repeat for next atomic feature
AUTO-TEST TRIGGER:
- Any file modification under src/ automatically runs:
pytest tests/ -v - Must address any test failures before continuing development
- Ensures continuous validation and early error detection
-
examples:
-
input: | User: "Add a login function"
Correct TDD approach:
Step 1: "I'll write a test for login function first. Here's the failing test..." [Wait for user approval] Step 2: "Now I'll implement minimal code to make this test pass..." [Wait for user approval] Step 3: "Let's refactor and add the next test case..." output: "Following TDD with atomic steps and user verification"
-
input: | User: "Fix the bug in calculation"
Correct TDD approach:
Step 1: "I'll write a test that reproduces the bug first..." [Wait for user approval] Step 2: "Now I'll fix the code to make the test pass..." output: "Bug fix following TDD principles"
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 135 lines · 1,054 tokens per session scan A 62a2dce6c8e9
test-driven-development is a cursor rule published in the GitHub repository barisercan/cursorrules (35 stars, last pushed 1y ago), licensed MIT. It adds 1,054 tokens to every session, about $0.0042 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
mcpnuke-tests
Test conventions for mcpnuke — enforces TDD workflow.
debug-issue
When the user reports a bug, an error, or unexpected behavior. Enforces four structured phases — reproduction, failing test, root cause isolation, fix and verify — to stop guess-and-check loops.
common-testing
Testing requirements: 80% coverage, TDD workflow.
testing_rules
A testing guide covering TDD, where tests are written before code, and BDD, where expected behavior is described in Given-When-Then form.
tdd
Test-driven development — red-green-refactor cycle.
testing-standards
testing guidelines and expectations.