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/lukasrepublic/agentic-foundry/vitest-unitnpx skills add lukasrepublic/agentic-foundry --skill vitest-unitgit clone --depth 1 https://github.com/lukasrepublic/agentic-foundryWrote 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/lukasrepublic/agentic-foundry/vitest-unit)<a href="https://agentmods.dev/skills/lukasrepublic/agentic-foundry/vitest-unit"><img src="https://agentmods.dev/badge/skills/lukasrepublic/agentic-foundry/vitest-unit.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.00000 | $0.01443 |
| Opus 5 | $0.00000 | $0.00722 |
| Sonnet 5 | $0.00000 | $0.00289 |
| Haiku 4.5 | $0.00000 | $0.00144 |
Grade A, and why
vitest-unit 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 — 73 lines — stays where its author put it; the contents beside it link to each section on GitHub.
When to trigger
- Authoring a unit test for a function, React component, hook, or async handler.
- Coverage-gate work: ensuring the target package meets its coverage threshold.
- Snapshot review: deciding whether to update or reject a snapshot diff.
- Async-pattern test work: testing promises, async/await, timeouts, or event-driven code.
- Mock-strategy decisions: which layer to mock (module boundary vs. network boundary).
Procedure
-
Place test file colocated with implementation:
<file>.test.ts(non-React) or<file>.test.tsx(React components) in the same directory as the source file. This makes it obvious when a test is missing and prevents "lost test" drift. -
Test pyramid discipline: write many unit tests, fewer integration tests, fewest e2e tests. A unit test covers one function or component in isolation. If a test requires multiple real modules to be wired together, consider whether it should be an integration test.
-
Coverage threshold for the target package is
{{ profile.test_recipe.coverage_gate }}. Do not invent a threshold; use the profile's gate. Verify with the project's coverage run that the PR does not lower the threshold below the defined minimum. -
Snapshots only for stable serialization (config objects, API response shapes, serialized schemas). Never snapshot rendered React DOM — rendered output is brittle (class names, whitespace, auto-generated IDs change between builds). Replace DOM snapshots with role/testid assertions.
-
Async patterns: always
awaitreturned promises. Never use thedonecallback pattern (deprecated idiom; async/await is the supported form in Vitest). For timer-based code, usevi.useFakeTimers()+vi.runAllTimers(). -
Mocks via
vi.mockat the module boundary:vi.mock('../path/to/module')hoists the mock above imports. Scope mocks to the test file — never useglobalThisorvi.doMockfor cross-file state. Reset mocks between tests withvi.clearAllMocks()inafterEach.
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 · 73 lines · 0 tokens per session scan A 6def233a3e20
vitest-unit is a skill published in the GitHub repository lukasrepublic/agentic-foundry (1 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,443 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-31.
Other skills, from other repositories
enterprise-test-suites
Comprehensive testing matrix spanning Unit, Integration, E2E (Playwright), Contract (Pact), Chaos/Fault-Injection, Mutation, Load/Stress (k6), and Security Fuzz testing.
no-silent-pass
Write Python whose failures are visible and checks that actually fire — distinct sentinels for success and error, filters that narrow to nothing without reading as "all clear", output never discarded on a non-zero exit, and selftest cases proven red before they are trusted (mutate the fix, mutate it the other way too…
test-forge
Generate comprehensive tests across all stacks — .NET, NestJS, React, React Native, Flutter.
unit-testing
Unit testing patterns with Vitest - mocking, fixtures, isolation, and fast feedback.
spec-execution
6-phase iterative specification execution workflow covering implementation, testing, review, improvement, commit, and progress tracking with quality-gated convergence.
nw-fp-clojure
Clojure language-specific patterns, data-first modeling, REPL-driven development, and spec.