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 monkilabs/opencastle --skill vitest-testinggit clone --depth 1 https://github.com/monkilabs/opencastleWrote 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/monkilabs/opencastle/vitest-testing)<a href="https://agentmods.dev/skills/monkilabs/opencastle/vitest-testing"><img src="https://agentmods.dev/badge/skills/monkilabs/opencastle/vitest-testing/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/monkilabs/opencastle/vitest-testing"><img src="https://agentmods.dev/badge/skills/monkilabs/opencastle/vitest-testing.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.00038 | $0.00518 |
| Opus 5.5 | $0.00015 | $0.00207 |
| Sonnet 5.5 | $0.00008 | $0.00104 |
| Haiku 4.5 | $0.00004 | $0.00052 |
Grade A, and why
vitest-testing 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 11d 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
Vitest Testing
Project test configuration: .opencastle/stack/testing-config.md. Coverage thresholds, environment and setup files: the project's vitest.config.* (or the test block of vite.config.*) — read them, never assume a number.
Running
vitestalone starts watch mode in a terminal and never exits. Agents runvitest run [file] [-t "name"].- Type tests (
*.test-d.ts,expectTypeOf) run withvitest --typecheck(orvitest run --typecheck). The oldvitest typechecksubcommand is gone since 1.0. - Coverage:
vitest run --coverage. Below threshold → read the uncovered lines in the text report, add tests for those branches, re-run.
Mocking gotchas
-
vi.mock()is hoisted above every import, so its factory cannot use variables declared in the file. Declare them withvi.hoisted():const { getUser } = vi.hoisted(() => ({ getUser: vi.fn() })) vi.mock('./database', () => ({ getUser })) -
Partial mock:
vi.mock('./config', async (importOriginal) => ({ ...(await importOriginal<typeof import('./config')>()), API_URL: 'http://test' })). -
vi.spyOn(namespace, 'fn')on a module's export misses calls made inside that module, and fails in Browser Mode; mock the module instead. -
vi.restoreAllMocks()only restoresvi.spyOnspies (Vitest 3+). It does not resetvi.fn()call history; usevi.clearAllMocks(), orrestoreMocks/clearMocksin the config, so state cannot leak between tests. -
Fake timers:
vi.useFakeTimers()inbeforeEach,vi.useRealTimers()inafterEach; advance withvi.advanceTimersByTime(ms)orawait vi.advanceTimersByTimeAsync(ms)when promises are involved. -
One file needs a DOM in a
nodeproject:// @vitest-environment jsdomon its first line.
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.
- 11d ago Changed · -133 lines · -2 tokens per session a1d7947d5698
- 12d ago First seen · 163 lines · 40 tokens per session scan A c98fe36d64eb
vitest-testing is a skill published in the GitHub repository monkilabs/opencastle (80 stars, last pushed yesterday), licensed MIT. It adds 38 tokens to every session and 518 once invoked, about $0.0002 per session on Opus 5.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-10-04.
Other skills, from other repositories
testing-pyramid
Use when writing tests of any kind — unit, slice, or integration. Covers test structure, naming conventions, Mockito patterns, @WebMvcTest, @DataJpaTest, and Testcontainers setup.
testing-patterns
Testing patterns and principles. Unit, integration, mocking strategies.
angular-testing
Reviews Angular test suite conventions. Flags component tests that query the DOM by CSS class/tag instead of accessible role/label, HTTP calls in component tests hitting a real HttpClient instead of HttpTestingController, Angular Material components tested via raw DOM queries instead of Component Test Harnesses, no…
migrate-xunit-to-xunit-v3
Migrate .NET test projects from xUnit.net v2 to xunit.v3 and fix v3 breaks. Use for package/CPM conversion, OutputType=Exe, preserving the VSTest or MTP runner (including projects currently using YTest.MTP.XUnit2), incompatible TFMs, async void tests, string-to-Type attributes, custom Fact/Theory/BeforeAfterTest…
dart-test
DART Test: unit tests, integration tests, CI validation, and debugging.
principle-test-behavior-not-implementation
Apply when you write, change, or keep a test. Assert what the code's users can observe, so that the test fails when that behavior breaks and keeps passing when only the internals change.