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 emaraschio/cursor-commands --skill write-unit-testsgit clone --depth 1 https://github.com/emaraschio/cursor-commandsWrote 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/emaraschio/cursor-commands/write-unit-tests)<a href="https://agentmods.dev/skills/emaraschio/cursor-commands/write-unit-tests"><img src="https://agentmods.dev/badge/skills/emaraschio/cursor-commands/write-unit-tests/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/skills/emaraschio/cursor-commands/write-unit-tests"><img src="https://agentmods.dev/badge/skills/emaraschio/cursor-commands/write-unit-tests.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.00011 | $0.00413 |
| Opus 5 | $0.00005 | $0.00206 |
| Sonnet 5 | $0.00002 | $0.00083 |
| Haiku 4.5 | $0.00001 | $0.00041 |
Grade A, and why
write-unit-tests 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 6d 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
Overview
Create comprehensive unit tests for the current code and generate the test file with proper imports and setup according to the project's testing conventions.
Steps
- Test Coverage
- Test all public methods and functions
- Cover edge cases and error conditions
- Test both positive and negative scenarios
- Aim for high code coverage
- Test Structure
- Use the project's testing framework conventions
- Write clear, descriptive test names
- Follow the Arrange-Act-Assert pattern
- Group related tests logically
- Test Cases to Include
- Happy path scenarios
- Edge cases and boundary conditions
- Error handling and exception cases
- Mock external dependencies appropriately
- Test Quality
- Make tests independent and isolated
- Ensure tests are deterministic and repeatable
- Keep tests simple and focused on one thing
- Add helpful assertion messages
Write Unit Tests Checklist
- Tested all public methods and functions
- Covered edge cases and error conditions
- Tested both positive and negative scenarios
- Used the project's testing framework conventions
- Written clear, descriptive test names
- Followed the Arrange-Act-Assert pattern
- Included happy path scenarios
- Included edge cases and boundary conditions
- Mocked external dependencies appropriately
- Made tests independent and isolated
- Ensured tests are deterministic and repeatable
Guardrails
- Test observable behavior and public contracts, not implementation trivia.
- Mock only external boundaries (network, clock, filesystem); use real objects for the rest.
- Do not commit, push, merge, or run destructive commands without explicit user consent.
- Do not print, log, or commit secrets or credentials found in the code or test fixtures; flag any exposure instead.
What ships with it
3 files 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.
- 6d ago First seen · 52 lines · 11 tokens per session scan A 7b63769b9c64
write-unit-tests is a skill published in the GitHub repository emaraschio/cursor-commands (9 stars, last pushed 1mo ago), licensed MIT. It adds 11 tokens to every session and 413 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-09-03.
Other skills, from other repositories
go-testing
Trigger: Go tests, go test coverage, Bubbletea teatest, golden files. Apply focused Go testing patterns.
testing
To write thorough, isolated, idempotent tests — 80%+ coverage, external-only mocking, scenario-driven.
Add executable smoke tests for shell scripts and CLIs before refactors ship
Use Bats-core when an agent needs to turn fragile shell scripts or command-line workflows into something it can verify repeatedly after edits. The agent writes focused Bash tests for success paths, failure paths, and output contracts, then runs them locally or in CI before a refactor, release, or incident fix goes out.
test-writer
Writes tests for code that already exists: behaviour over implementation, arrange-act-assert structure, mocks only at real boundaries, and no time- or order-dependent flakiness. Use when asked to add tests, close a coverage gap on a function, component, or endpoint, or write a regression test for a bug just fixed. Not…
iterate-agent-harness
Turn an agent failure—premature stop, false completion, gamed check, missed file, broken handoff—into a durable rule/skill/hook/CI guard plus regression test. Use when "the agent stopped early again", "it gamed the test", or "add a guard so this doesn't recur". App bugs → workflow-fix-and-ship.
dev-testing
A testing guide that defines when to use unit, integration, API, and end-to-end tests. Unit tests check small pieces of code, while end-to-end tests check a full user flow.