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/khaledsaeed18/dotclaude/write-testsgit clone --depth 1 https://github.com/KhaledSaeed18/dotclaudeWhat 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.00041 | $0.00974 |
| Opus 5 | $0.00020 | $0.00487 |
| Sonnet 5 | $0.00008 | $0.00195 |
| Haiku 4.5 | $0.00004 | $0.00097 |
Grade A, and why
write-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 2d 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 — 60 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Context
- Target file:
$1 - Runner override (optional):
$2 - Project manifest (detect runner, scripts, and deps from here):
!cat package.json
Task
Write a thorough, idiomatic test suite for $1. If no file path was given in the arguments above, ask for one and stop.
Follow this procedure:
1. Detect the toolchain — don't assume
From the manifest above (and config files if needed), determine the runner and libraries already in use. Respect $2 if the user named a runner; otherwise infer:
- Runner:
vitest,jest,node:test,mocha,ava, or@playwright/test. CheckdevDependenciesand thetestscript. - Helpers in play:
@testing-library/react+@testing-library/jest-dom(React),supertest(Express/HTTP),@nestjs/testing(NestJS),msw(network mocking). - Config:
vitest.config.*,jest.config.*,tsconfigpaths/aliases,setupTestsfiles.
If the project has no test runner installed, do not invent one silently: state what you'd add (default to Vitest for Vite/Next/library code, Jest where it's already the ecosystem norm) and ask before adding a dependency.
2. Mirror existing conventions
Find sibling tests with Glob/Grep (**/*.{test,spec}.{ts,tsx,js,jsx}) and read one or two. Match their file location (__tests__/ vs co-located *.test.ts), import style, naming, and setup/teardown patterns. New tests should look like they were written by whoever wrote the existing ones.
3. Understand the unit under test
Read $1 in full. Identify every exported function/component/class, its inputs, outputs, side effects, dependencies to mock (network, DB, clock, randomness, filesystem), and the branches that need coverage.
4. Write meaningful tests
- Cover behavior, not implementation. Assert observable outputs and effects; don't pin internal calls unless the contract is the call itself.
- Per unit, cover: the happy path, boundary/edge cases (empty, zero, negative, large, unicode), and error/failure paths (throws, rejections, invalid input).
- Structure each test Arrange–Act–Assert with a description that reads as a behavior (
it("returns 401 when the token is missing")). - Determinism is non-negotiable: fake timers for time, seed or stub randomness, no real network/DB/filesystem — mock at the boundary (
msw,supertest, in-memory fakes). Nosleep, no ordering assumptions, no shared mutable state between tests. - Stack specifics:
- React (Testing Library): query by role/label/text, never by test-id unless unavoidable; assert what the user sees; use
userEventfor interaction; wrap async UI infindBy/waitFor. Don't test internal state. - Express: drive HTTP with
supertestagainst the app instance; assert status, body, and headers; cover auth and validation failures. - NestJS: build a
Test.createTestingModule, provide mocked providers, and test services in isolation; for controllers, mock the service layer.
- React (Testing Library): query by role/label/text, never by test-id unless unavoidable; assert what the user sees; use
- Keep each test independent and runnable in any order.
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.
- 2d ago First seen · 60 lines · 41 tokens per session scan A 2ebb3a76227b
write-tests is a command published in the GitHub repository KhaledSaeed18/dotclaude (4 stars, last pushed 7d ago), licensed MIT. It adds 41 tokens to every session and 974 once invoked, about $0.0002 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 commands, from other repositories
e2e
使用 Playwright 对 Web UI 进行端到端测试(支持视频录制、Trace 录制、控制台/网络日志捕获).
auto-browse
Auto-browse — learn, optimize, and graduate browser operations or web data-mining workflows.
research-perplexity
Run a deep research query using Perplexity's /research mode via Playwright browser automation. This is an alternative to /export-to-council that uses Perplexity's dedicated research mode instead of multi-model council.
review
Compare a reference design against an implementation. Accepts Figma URL, image file, or browser URL as reference.
graphify
Turn your vault into a clustered knowledge graph with HTML and JSON outputs.
laravel-playwright
E2E Playwright patterns; use the laravel:e2e-playwright skill exactly as written.