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/kok-o/koko-contextos-agents/testinggit clone --depth 1 https://github.com/kok-o/koko-contextos-agentsWhat 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.00032 | $0.01357 |
| Opus 5 | $0.00016 | $0.00678 |
| Sonnet 5 | $0.00006 | $0.00271 |
| Haiku 4.5 | $0.00003 | $0.00136 |
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 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.
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 — 166 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Skill: testing
Testing
Overview
Testing strategy across unit, component, integration, and end-to-end testing suites using Vitest, React Testing Library, and Playwright.
When to Use
Activate for any task involving unit tests, integration tests, E2E testing, TDD/BDD workflows, or fixing regression bugs.
Rules & Patterns
️ The ContextOS Testing Pyramid
/\
/E2E\ 10% — Playwright (Critical user journeys, auth, checkout)
/-----\
/ Integ \ 20% — API & Component Integration (RTL + MSW / Supertest)
/---------\
/ Unit \ 70% — Pure functions, Domain Entities, Utils (Vitest)
/-------------\
Negative Constraints (What NOT to Do)
- NEVER mock internal implementation details: Mock ONLY external I/O boundaries (HTTP network requests via MSW, Database via test containers or in-memory DB).
- NEVER test implementation details: In React Testing Library, query by user-facing roles (
getByRole,getByLabelText), NEVER by CSS selectors or internal component state. - NEVER write assertions without an expected failure mode: Each test must test a single logical behavior and fail if that behavior breaks.
- NEVER leave flaky tests or arbitrary sleep (
await delay(1000)): Always usewaitFor()or explicit event triggers with timeouts. - NEVER share mutable state between tests: Every test must have isolated state via
beforeEach()setup and clean reset.
AAA Standard Pattern
describe('Feature / Unit', () => {
it('should achieve expected outcome when given specific condition', async () => {
// 1. ARRANGE
const user = createTestUser({ role: 'admin' });
// 2. ACT
const result = await processOrder(user, sampleCart);
// 3. ASSERT
expect(result.status).toBe('confirmed');
});
});
Code Examples
See EXAMPLES.md for detailed anti-patterns and production testing code.
Validation Checklist
- Tests follow Arrange-Act-Assert (AAA) structure
- No brittle CSS selectors or private state inspections
- Mocks isolated strictly to network/IO boundaries (MSW)
- Fast execution (< 5s for unit suite) with zero flaky sleeps
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 · 166 lines · 32 tokens per session scan A d0cb96a22215
testing is a cursor rule published in the GitHub repository kok-o/koko-contextos-agents (2 stars, last pushed 2d ago), licensed MIT. It adds 32 tokens to every session and 1,357 once invoked, about $0.0002 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
entire-external-agent
Build standalone external agent binaries for the Entire CLI using E2E-first TDD.
testing
Android testing rules: fakes over mocks, ViewModel testing, Compose UI testing, Turbine, Truth.
functional-test-principals.rules
Purpose: Ensure all test suites — regardless of test framework — validate real, end-to-end or integration-level functionality. Tests must act as a backstop for the app. If they pass, the app works. If they fail, something meaningful is broken. This allows the agent to self-validate and iterate safely.
webdriver-management
Selenium WebDriver lifecycle management — driver factory, explicit waits, browser options, and teardown.
testing-standards
testing guidelines and expectations.
python-broken-access-control
Detect and prevent broken access control vulnerabilities in Python applications as defined in OWASP Top 10:2021-A01.