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/mhmdreza-rafiei/agent-tools/testinggit clone --depth 1 https://github.com/mhmdreza-rafiei/agent-toolsWhat 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.00025 | $0.00425 |
| Opus 5 | $0.00013 | $0.00212 |
| Sonnet 5 | $0.00005 | $0.00085 |
| Haiku 4.5 | $0.00003 | $0.00042 |
Grade A, and why
testing 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 3d 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.
What it actually says
Testing
Applies when writing or changing code that should be tested. Load for features, bug fixes, refactors. Not every chat.
What must be tested
- Trust boundaries — every input parser, validator, and auth check has tests. Untested trust boundaries ship vulnerabilities.
- Branches that can fail silently — error paths, edge cases, empty inputs, off-by-one. The happy path is the last to test, not the first.
- Anything with a public contract — exported functions, API endpoints, CLI flags. If a caller can reach it, it has a test.
Coverage
- Coverage is a floor, not a goal. Aim for the trust boundaries and public contracts at 100%; ignore the rest unless the project sets a bar.
- A new line of logic leaves the smallest runnable check behind (assert- based demo or one small test). Trivial one-liners need no test.
Unit vs integration vs E2E
- Unit — pure logic, fast, no I/O. The default.
- Integration — when the bug is at the seam (DB, API, file system). Use when unit tests would mock the thing that's actually broken.
- E2E — for user-facing flows that have failed before. Don't E2E what a unit test already covers; E2E is slow and flaky.
Bug fixes
- A bug fix lands with a test that fails before the fix and passes after. No reproducer test → the bug will regress.
Do not
- Test implementation details that should be free to change.
- Mock what you don't own to the point the test proves nothing.
- Skip the failing path because it's hard to set up — that's the path that ships bugs.
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.
- 3d ago First seen · 47 lines · 25 tokens per session scan A 3a0f36ad373e
testing is a cursor rule published in the GitHub repository mhmdreza-rafiei/agent-tools (5 stars, last pushed 15d ago), licensed MIT. It adds 25 tokens to every session and 425 once invoked, about $0.0001 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-31.
Other cursor rules, from other repositories
testing-patterns
Паттерны тестирования 1С: YaXUnit, Vanessa.
verify-scope
改完代码要跑验证时读——三档验证阶梯的窄化命令配方(pytest ::/-k/--lf、vitest 点名文件/-t/--related、shoot 场景过滤)、release:gate 五段分拆与失败续跑、反空转与跨包边界。跑 release:gate / 全量 pytest / 全量 vitest / pnpm shoot 前必读。.
300-testing
Comprehensive testing guide covering unit, integration, E2E, test frameworks, patterns, and CI/CD integration.
testing
Testing conventions and Playwright patterns.
testing
Testing strategy for AI developers.
testing-guide
Cursor rule "testing-guide" from HeeGyeong/ComposeSample, covering testing guide, unit tests, ui tests, test coverage and performance testing.