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/oakensoul/nextjs-cursor-promptsWrote 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/oakensoul/nextjs-cursor-prompts/test-driven)<a href="https://agentmods.dev/rules/oakensoul/nextjs-cursor-prompts/test-driven"><img src="https://agentmods.dev/badge/rules/oakensoul/nextjs-cursor-prompts/test-driven/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/oakensoul/nextjs-cursor-prompts/test-driven"><img src="https://agentmods.dev/badge/rules/oakensoul/nextjs-cursor-prompts/test-driven.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.00000 | $0.01714 |
| Opus 5 | $0.00000 | $0.00857 |
| Sonnet 5 | $0.00000 | $0.00343 |
| Haiku 4.5 | $0.00000 | $0.00171 |
Grade A, and why
test-driven 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 6d 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 — 234 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Test-Driven Development Rule
This rule enforces a test-first development process for critical code that requires high confidence and clear specification.
🎯 TDD PRINCIPLES:
- RED - Write a failing test first
- GREEN - Write minimal code to make it pass
- REFACTOR - Improve code while keeping tests green
- REPEAT - Continue the cycle for each new feature
🚫 FORBIDDEN ACTIONS:
- DO NOT write implementation before tests - tests define the specification
- DO NOT skip failing test phase - must see red before green
- DO NOT write complex logic without tests - break into testable units
- DO NOT modify multiple features in one TDD cycle
- DO NOT ignore edge cases - test error conditions and boundaries
- DO NOT skip refactoring phase - clean up code after each cycle
- DO NOT commit failing tests - complete the cycle before committing
✅ REQUIRED TDD PROCESS:
1. DEFINE the specification through tests
- Write test cases that describe expected behavior
- Include happy path, edge cases, and error conditions
- Use descriptive test names that explain the requirement
- Start with the simplest test case
2. IMPLEMENT minimally to pass tests
- Write only enough code to make tests pass
- Avoid over-engineering or premature optimization
- Keep implementation focused on test requirements
- Don't add features not covered by tests
3. REFACTOR safely with test coverage
- Improve code structure while tests remain green
- Extract functions, improve naming, optimize performance
- Run tests after each refactoring step
- Maintain the external interface defined by tests
4. EXTEND incrementally with new test cycles
- Add one new test for the next requirement
- Follow the same RED-GREEN-REFACTOR cycle
- Build complexity gradually through multiple iterations
- Maintain test coverage as features grow
🎯 WHEN TO APPLY TDD:
High-Value Targets:
- Business logic functions - calculations, validations, algorithms
- API endpoints - request/response handling, data transformation
- Data processing utilities - parsing, formatting, conversion
- Authentication/authorization - security-critical functionality
- Integration points - external API clients, database operations
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.
- 6d ago First seen · 234 lines · 0 tokens per session scan A de2831213e1f
test-driven is a cursor rule published in the GitHub repository oakensoul/nextjs-cursor-prompts (4 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,714 tokens. 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-09-03.
Other cursor rules, from other repositories
manual-review.backend
A set of rules for verifying backend-only changes and changes that use different verification channels. It separates evidence the agent can collect from checks that require a person, a production authorization, or a business decision.
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.
testing-discipline
TDD, BDD, and testing best practices — stack-agnostic.
common-testing
Testing requirements: 80% coverage, TDD workflow.
tdd
Test-driven development — red-green-refactor cycle.