Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/d-padmanabhan/agent-engineering-handbooknpx agentmods add rules/d-padmanabhan/agent-engineering-handbook/300-testingWrote 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/d-padmanabhan/agent-engineering-handbook/300-testing)<a href="https://agentmods.dev/rules/d-padmanabhan/agent-engineering-handbook/300-testing"><img src="https://agentmods.dev/badge/rules/d-padmanabhan/agent-engineering-handbook/300-testing/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/d-padmanabhan/agent-engineering-handbook/300-testing"><img src="https://agentmods.dev/badge/rules/d-padmanabhan/agent-engineering-handbook/300-testing.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.00022 | $0.08881 |
| Opus 5.5 | $0.00009 | $0.03552 |
| Sonnet 5.5 | $0.00004 | $0.01776 |
| Haiku 4.5 | $0.00002 | $0.00888 |
Grade A, and why
300-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 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 — 1,453 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Testing Strategies & Best Practices
Audience: engineers writing and reviewing tests across languages and frameworks Goal: Create reliable, maintainable test suites that provide fast feedback and high confidence
Testing Philosophy (Core Principles)
Core Principles:
- "Test pyramid, not test ice cream cone" - More unit tests, fewer integration tests, minimal E2E tests
- "Fast feedback loop" - Tests should run quickly and fail fast with clear error messages
- "Tests are documentation" - Tests describe how code should behave, make them readable
- "Isolation is essential" - Tests should be independent, repeatable, and not depend on each other
- "Quality over quantity" - 80% coverage is good, but meaningful tests matter more than coverage percentage
- "Test behavior, not implementation" - Test what the code does, not how it does it
- "Fail fast, fail clearly" - Tests should fail with actionable error messages
- "Maintainability matters" - Tests should be easy to update when requirements change
Applying Testing Principles:
// BAD: Testing implementation, unclear, slow
it('test1', () => {
const result = service.process();
expect(result).toBeTruthy();
});
// GOOD: Testing behavior, clear, fast
it('should calculate total price with 10% discount', () => {
// Arrange
const cart = new ShoppingCart();
cart.addItem({ id: '1', price: 100 });
cart.addItem({ id: '2', price: 50 });
// Act
const total = cart.calculateTotal(0.1);
// Assert
expect(total).toBe(135); // (100 + 50) * 0.9
});
Guiding Principles
- Test Pyramid: More unit tests, fewer integration tests, minimal E2E tests
- Fast Feedback: Tests should run quickly and fail fast
- Isolation: Tests should be independent and repeatable
- Clarity: Tests are documentation - make them readable
- Coverage: Aim for 80%+ coverage, but quality > quantity
Test Pyramid
E2E Tests (Few)
- Slow, brittle, expensive
- Test critical user journeys
E2E - 5-10% of tests
Integration Tests (Some)
Integration - Medium speed
- Test component interactions
- 20-30% of tests
Unit Tests (Many)
Unit - Fast, focused, reliable
- Test individual functions/classes
- 60-70% of tests
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 · 1,453 lines · 22 tokens per session scan A 9721dc5bccaf
300-testing is a cursor rule published in the GitHub repository d-padmanabhan/agent-engineering-handbook (19 stars, last pushed 2d ago), licensed MIT. It adds 22 tokens to every session and 8,881 once invoked, about $0.0001 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
hatch3r-testing
Coverage thresholds, mocking strategy, property-based testing, mutation-score targets, flaky test quarantine, and snapshot test discipline.
testing
Cursor rule "testing" from andersonlemesc/Oryntra, covering testes oryntra, laravel (pest), python (pytest), contract tests (laravel ↔ python) and browser/e2e.
30-testing
Convenciones de testing, cobertura mínima, tipos de tests, mocks.
tester
Tester role - Unit, E2E, and visual regression testing.
go-test
Rules for writing and modifying test files (test.go) in go-crypto-wallet.
do-runner
Use the following runners.