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/jahands/prompts/test-driven-rule-developmentgit clone --depth 1 https://github.com/jahands/promptsWhat 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.00014 | $0.01588 |
| Opus 5 | $0.00007 | $0.00794 |
| Sonnet 5 | $0.00003 | $0.00318 |
| Haiku 4.5 | $0.00001 | $0.00159 |
Grade C, and why
test-driven-rule-development scanned grade C with 1 finding 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 2d 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.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
rm -rf .cursor/rules/test-rules/ How it starts
The opening of the file, as written. The whole thing — 205 lines — stays where its author put it; the contents beside it link to each section on GitHub.
If directory exists with files, clean it completely
rm -rf .cursor/rules/test-rules/ mkdir -p .cursor/rules/test-rules/
</example>
</step>
<step>
<name>2. Create Test Scenarios</name>
<requirements>
- Design 5-7 prompts varying from simple to complex
- Include 60%+ simple rules to test if guide prevents over-structuring
- Use realistic user requests, not artificial examples
- Document expected complexity level for each prompt (simple vs complex structure)
- Include at least one borderline case to test decision-making
</requirements>
</step>
<step>
<name>3. Get User Approval</name>
<requirements>
- Present all test prompts to user for review
- Show the complete sub-agent prompt template with placeholders
- Demonstrate how the template will be filled for at least one example
- Wait for user confirmation before proceeding
- Allow user to modify prompts or template if needed
</requirements>
<example>
"Here are the 5 prompts I plan to give to sub-agents to test the guide:
-
Simple formatting rule: 'Write a rule for always using 2 spaces for indentation...'
-
Communication behavior rule: 'Write a rule that tells the LLM to...'
[... list all prompts ...]
Template for each sub-agent:
You need to write an LLM rule. First, read the rule-writing guidelines at [INSERT EXACT PATH TO GUIDE HERE], then create a rule following those guidelines.
Your task: [INSERT SPECIFIC RULE REQUEST HERE]
Write the rule to this file: [INSERT EXACT OUTPUT PATH HERE]
Important: Fill in all placeholders with exact paths before sending to sub-agents. Sub-agents should receive fully specified paths, not placeholders.
Example of how prompt #1 will look when sent to sub-agent:
You need to write an LLM rule. First, read the rule-writing guidelines at /Users/jh/.dotfiles/.cursor/rules/cursor-rules.mdc, then create a rule following those guidelines.
Your task: Write a rule for always using 2 spaces for indentation in JavaScript/TypeScript files, never tabs
Write the rule to this file: /Users/jh/.dotfiles/.cursor/rules/test-rules/indentation.mdc
Should I proceed with these prompts?"
</example>
</step>
<step>
<name>4. Run Tests After Approval</name>
<requirements>
- Create test directory: `.cursor/rules/test-rules/`
- Fill in all path placeholders with exact, absolute paths
- Use Task tool to spawn sub-agents
- Instruct agents to read guide file and create rules
- Have agents write to test files for easy review
- Run all tests in parallel for efficiency
</requirements>
<example>
Task prompt to sub-agent (with all placeholders filled): "You need to write an LLM rule. First, read the rule-writing guidelines at /exact/path/to/guide.mdc, then create a rule following those guidelines.
Your task: [specific rule request from test scenario]
Write the rule to this file: /exact/path/to/test-rules/output.mdc"
</example>
</step>
<step>
<name>5. Analyze Results</name>
<requirements>
- Read each generated rule file
- Compare actual results to expected results
- Look for patterns across all test outputs
- Document structural choices (which sections were included and why)
- Form hypotheses about why agents made certain decisions
</requirements>
<example>
Example analysis: "All 5 agents added and sections even for simple rules. Hypothesis: The guide's complex template examples may be influencing agents more than the warnings to keep things simple. Simple formatting rules included 5+ sections when only title/rules/examples were needed."
</example>
</step>
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.
- 2d ago First seen · 205 lines · 14 tokens per session scan C 1e4dd2257b68
test-driven-rule-development is a cursor rule published in the GitHub repository jahands/prompts (19 stars, last pushed 7mo ago), licensed MIT. It adds 14 tokens to every session and 1,588 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). 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.
cli-error-handling
CLI command error handling patterns.
prefer-direct-imports-over-module-mocks
Prefer extracting a testable core over vi.mock / vi.resetModules when unit tests need to reach production logic entangled with config, env, or singletons.
control-plane-descriptors
Control plane descriptor and instance implementation patterns.
family-instance-domain-actions
Family instance domain action implementation patterns.