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.
npx agentmods add rules/barisercan/cursorrules/test-driven-developmentgit clone --depth 1 https://github.com/barisercan/cursorrulesWhat 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 | $0.01054 | $0.01054 |
| Opus 5 | $0.00527 | $0.00527 |
| Sonnet 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 yesterday.
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.
- yesterday 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.0053 per session on Opus 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
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
typescript
Changes to these high-fan-out internals can affect every message, delta, element, or rerun. Keep work in them minimal, and benchmark changes with representative stress-test apps.
coolify-ai-docs
Master reference to all Coolify AI documentation in .ai/ directory.
python_lib
Tips and guidelines specific to the development of the Streamlit Python library, not applicable to scripts and e2e tests.
specs
This directory contains product and tech specs for Streamlit features.