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 skills/tmj-90/gaffer/add-unit-testnpx skills add tmj-90/gaffer --skill add-unit-testgit clone --depth 1 https://github.com/tmj-90/gafferWrote 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/tmj-90/gaffer/add-unit-test)<a href="https://agentmods.dev/skills/tmj-90/gaffer/add-unit-test"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/add-unit-test.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 | $0.00054 | $0.00612 |
| Opus 5 | $0.00027 | $0.00306 |
| Sonnet 5 | $0.00011 | $0.00122 |
| Haiku 4.5 | $0.00005 | $0.00061 |
Grade A, and why
add-unit-test 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 5d 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 — 50 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Add a unit test
Add focused, behaviour-asserting unit tests for the unit named in the ticket — matching the repo's existing test framework and conventions, not introducing a new one.
Steps
- Find the unit + its existing tests. Locate the source file and any sibling test file. Read 1–2 existing tests in the repo to copy the framework, naming, and assertion style (Vitest/Jest/pytest/JUnit — use what's already there).
- Enumerate behaviours to cover from the ticket/AC: the happy path, each meaningful branch, boundary values, and the error/throws cases. Prefer behaviour ("returns empty array when no match") over implementation detail.
- Write tests in the repo's test location and naming convention, one assertion focus per test, Arrange-Act-Assert. No test without a real assertion; no over-broad mocks that assert nothing.
- Run the test command (use the repo's
testscript — see the context packet's verification commands). Iterate until green. If a test reveals a real bug, note it; fix only what the ticket scopes. - Evidence: the test command + its passing summary, and the new test file
paths. Then use the
record-evidenceskill to recordtest_outputagainst the AC and submit for review.
TypeScript specifics
- Async functions:
awaitthe call and assert on the resolved value, or useawait expect(fn()).rejects.toThrow(...)for the failure path — never leave a floating promise, or the test passes before the assertion runs. - A meaningful assertion pins the observable outcome: the returned value, a thrown
error, or a call made to a genuine collaborator with the expected arguments. Asserting
that a mock you fully control was called (
expect(mock).toHaveBeenCalled()with no argument or outcome check) tests the mock, not the unit — prefer a real return/throw assertion over an empty mock check. - Fake time and randomness (
vi.useFakeTimers()/ seeded RNG) so timing- or random-dependent behaviour is deterministic rather than flaky.
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.
- 5d ago First seen · 50 lines · 54 tokens per session scan A b2038c9ba652
add-unit-test is a skill published in the GitHub repository tmj-90/gaffer (2 stars, last pushed 4d ago), licensed Apache-2.0. It adds 54 tokens to every session and 612 once invoked, about $0.0003 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 skills, from other repositories
vc-web-testing
Web testing with Playwright, Vitest, k6. E2E/unit/integration/load/security/visual/a11y testing. Use for test automation, flakiness, Core Web Vitals, mobile gestures, cross-browser.
generate-tests
Use when the user asks to generate, create, or write unit tests for code. Analyzes the target code, produces a structured test case list for review, then generates test code. Supports Java (JUnit 5, Mockito, AssertJ).
mobile-developer
Expert knowledge in mobile app development for iOS, Android, and cross-platform solutions.
skill-creator
Create or update AnkaLoop skills. Use when designing, structuring, or packaging skills with scripts, references, and assets. This skill should be used when users want to create a new skill (or update an existing skill) that extends AnkaLoop's capabilities with specialized knowledge, workflows, or tool integrations.
gh-ci-analyzer
使用 gh CLI 分析 GitHub Actions CI 日志,提供结构化的故障诊断和报告.
security-best-practices
Security best practices and vulnerability prevention guidelines.