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 commands/janhesters/react-router-saas-template/unit-testsgit clone --depth 1 https://github.com/janhesters/react-router-saas-templateWrote 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/commands/janhesters/react-router-saas-template/unit-tests)<a href="https://agentmods.dev/commands/janhesters/react-router-saas-template/unit-tests"><img src="https://agentmods.dev/badge/commands/janhesters/react-router-saas-template/unit-tests.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.00000 | $0.00525 |
| Opus 5 | $0.00000 | $0.00262 |
| Sonnet 5 | $0.00000 | $0.00105 |
| Haiku 4.5 | $0.00000 | $0.00052 |
Grade A, and why
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 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.
What it actually says
Unit Tests
Act as a top-tier software engineer with serious testing skills.
TestConstraints { Ensure that the test answers these 5 questions { 1. What is the unit under test? (test should be in a named describe block) 2. What is the expected behavior? ($given and $should arguments are adequate) 3. What is the actual output? (the unit under test was exercised by the test) 4. What is the expected output? ($expected and/or $should are adequate) 5. How can we find the bug? (implicitly answered if the above questions are answered correctly) }
Tests must be: - Readable - Answer the 5 questions. - Isolated/Integrated - Units under test should be isolated from each other - Tests should be isolated from each other with no shared mutable state. - For integration tests, test integration with the real system. - Thorough - Test expected edge cases - Explicit - Everything you need to know to understand the test should be part of the test itself. If you need to produce the same data structure many times for many test cases, create a factory function and invoke it from the individual tests, rather than sharing mutable fixtures between tests.
Use Vitest with describe, expect, and test.
Tests must use the "given: ..., should: ..." prose format.
Ensure that within each test case:
- There is an empty line before the actual variable assignment.
- Do NOT add an empty line between the actual and expected assignments.
- There is an empty line after the expected variable assignment before the toEqual assertion.
Use cuid2 for IDs unless specified otherwise.
Colocate tests with functions. Test files should be in the same folder as the implementation file.
If an argument is a database entity, use an existing factory function and override values as needed.
Capture the actual and the expected value in variables.
The top-level describe block should describe the component under test.
The test block should describe the case via "given: ..., should: ...".
Avoid expect.any(Constructor) in assertions. Expect specific values instead.
Always use the toEqual equality assertion.
}
Constraints { Carefully think through correct output. Avoid hallucination. This is very important to ensure software works as expected and that user safety is protected. Please do your best work. }
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 · 44 lines · 0 tokens per session scan A 0c4deced410f
unit-tests is a command published in the GitHub repository janhesters/react-router-saas-template (48 stars, last pushed 8d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 525 tokens. 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 commands, from other repositories
write-tests
Generate comprehensive test coverage for existing code.
test-tdd
Run when user calls /test-tdd. Scans modified files, locates their corresponding unit/integration test suites, and runs them.
kill-mutants
Analyze surviving mutants from a mutation testing run and write targeted unit tests to kill them. Re-runs mutations to confirm kills.
test
Generate comprehensive tests.
test
Execute a comprehensive test run for the following target.
frappe-test
Run unit and integration tests for Frappe apps with coverage reports.