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 skills add phuonghx/aim-cli --skill testing-patternsgit clone --depth 1 https://github.com/phuonghx/aim-cliWrote 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/skills/phuonghx/aim-cli/testing-patterns)<a href="https://agentmods.dev/skills/phuonghx/aim-cli/testing-patterns"><img src="https://agentmods.dev/badge/skills/phuonghx/aim-cli/testing-patterns.svg" alt="Measured on agentmods" 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.00072 | $0.00961 |
| Opus 5 | $0.00036 | $0.00481 |
| Sonnet 5 | $0.00014 | $0.00192 |
| Haiku 4.5 | $0.00007 | $0.00096 |
Grade A, and why
testing-patterns 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.
How it starts
The opening of the file, as written. The whole thing — 137 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Testing Patterns
Reliable tests describe behavior clearly and fail for one understandable reason.
The test pyramid
Lots of fast, narrow tests at the bottom; a few slow, broad ones at the top.
/\ End-to-end (a few)
/ \ critical journeys only
/----\
/ \ Integration (some)
/--------\ APIs, DB queries, service seams
/ \
/------------\ Unit (many)
functions and classes
Arrange, Act, Assert
Every test reads in three beats:
- Arrange -- set up the data and preconditions.
- Act -- run the one thing under test.
- Assert -- check the result against expectations.
Choosing a test type
- Unit -- pure logic and functions; runs in milliseconds; lots of them.
- Integration -- how pieces talk to each other (API, database, services); moderate speed; a meaningful number.
- End-to-end -- complete user journeys through the real stack; slow; reserved for what truly matters.
Unit tests
What makes a good one
- Quick -- well under ~100ms each.
- Self-contained -- no network, disk, or shared state.
- Deterministic -- identical result on every run.
- Self-verifying -- asserts the outcome; no eyeballing.
- Written alongside the code, not bolted on later.
Where to aim them
Cover business rules, edge cases, and error paths. Don't bother testing framework internals, third-party libraries, or trivial accessors.
Integration tests
What to exercise
- API endpoints -- request in, response out.
- Database access -- queries and transactional behavior.
- External services -- the contract at the boundary.
Lifecycle hooks
- Before all -- open shared resources (connections, containers).
- Before each -- reset to a known state.
- After each -- tidy up what the test created.
- After all -- release the shared resources.
Mocking
Mock the edges, not the subject
Replace external APIs, networks, clocks, and randomness so tests stay deterministic. Mock the database in unit tests but use a real one for integration. Never mock the very thing you are testing, and skip mocking trivial pure functions or in-memory stores.
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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 · 137 lines · 72 tokens per session scan A 558a314f62da
testing-patterns is a skill published in the GitHub repository phuonghx/aim-cli (1 stars, last pushed 2mo ago), licensed MIT. It adds 72 tokens to every session and 961 once invoked, about $0.0004 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-09-03.
Other skills, from other repositories
temporal-python-testing
Test Temporal workflows with pytest, time-skipping, and mocking strategies. Covers unit testing, integration testing, replay testing, and local development setup. Use when implementing Temporal workflow tests or debugging test failures.
javascript-testing-patterns
Implement comprehensive testing strategies using Jest, Vitest, and Testing Library for unit tests, integration tests, and end-to-end testing with mocking, fixtures, and test-driven development. Use when writing JavaScript/TypeScript tests, setting up test infrastructure, or implementing TDD/BDD workflows.
agent-tester
Agent skill for tester - invoke with $agent-tester.
nw-test-organization-conventions
Test directory structure patterns by architecture style, language conventions, naming rules, and fixture placement. Decision tree for selecting test organization strategy.
test-automation
Execute Vitest and Playwright test suites with result collection and failure analysis.
testing
Use this skill when writing, reviewing, or improving tests in WrongStack. Triggers: user says "test", "unit test", "integration test", "e2e", "mock", "vitest", "coverage", "assert", "expect", "test strategy", "write tests".