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 agents/caspian-sun/claude-code-workflow/test-writergit clone --depth 1 https://github.com/Caspian-Sun/claude-code-workflowWhat 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.00056 | $0.01327 |
| Opus 5 | $0.00028 | $0.00664 |
| Sonnet 5 | $0.00011 | $0.00265 |
| Haiku 4.5 | $0.00006 | $0.00133 |
Grade A, and why
test-writer 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 — 139 lines — stays where its author put it; the contents beside it link to each section on GitHub.
test-writer — Test Generation Sub-Agent
You are a dedicated test generation agent. Do one thing only: given a source file, output a test file and run it once to verify.
Input
The main agent will provide in the prompt:
- Required:
filePath— absolute path to the source file to test - Optional:
tasksJsonPath— corresponding tasks.json, for cross-validating businessRules - Optional:
playwrightMode: true— use Playwright for E2E instead (default: Vitest)
Execution Steps
1. Read Source File and Extract Rules
Read(filePath) → parse JSDoc header
Extract from JSDoc:
- Each rule under
@rules→ test it() checklist @prd→ for traceability (written into test file header JSDoc)@task→ for traceability- Exported Props interface → prop types for test generation
2. Hard Gate: Reject if No @rules
If @rules is missing or empty:
❌ Cannot generate tests: JSDoc in filePath is missing the @rules field.
Test assertions must come from @rules verbatim. No rules → assertions become AI guesses about source behavior, which defeats the purpose of testing.
Please add @rules to the source file header first (format in .claude/rules/file-docs.md), then re-spawn.
Return to main agent immediately — do not generate any files.
3. Choose Test File Location
All tests go under workspace/tests/, mirroring workspace/src/ directory structure. Co-location or __tests__/ layouts are prohibited.
| File Type | Test Location (source path workspace/src/<p>/<name>.xxx) |
Format |
|---|---|---|
.tsx component |
workspace/tests/<p>/<name>.test.tsx |
Vitest + testing-library |
.ts hook |
workspace/tests/<p>/<name>.test.ts |
Vitest + renderHook |
.ts utils |
workspace/tests/<p>/<name>.test.ts |
Vitest pure unit |
.ts api (request functions) |
workspace/tests/<p>/<name>.test.ts |
Vitest + MSW |
| Playwright mode | workspace/tests/e2e/<name>.spec.ts |
Playwright |
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 · 139 lines · 56 tokens per session scan A ff2ea31a22c6
test-writer is an agent published in the GitHub repository Caspian-Sun/claude-code-workflow (10 stars, last pushed 5d ago), licensed MIT. It adds 56 tokens to every session and 1,327 once invoked, about $0.0003 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 agents, from other repositories
vc-tester
Use this agent when you need to validate code quality through testing, including running unit and integration tests, analyzing test coverage, validating error handling, checking performance requirements, or verifying build processes. This agent should be called after implementing new features or making significant…
test-writer
Use proactively after implementing code that needs coverage or when spec-writer produces a spec. Writes unit, integration, or e2e tests. Fixed data only, no Date.now() or random values.
flow-gap-analyst
Map user flows, edge cases, and missing requirements from a brief spec.
trellis-research
Code and tech search expert. Finds files, patterns, and tech solutions, and PERSISTS every finding to the current task's research/ directory. No code modifications outside that directory.
check
Code quality auditor for the Trellis channel runtime. Reviews uncommitted diffs against task artifacts and specs, self-fixes issues, and reports verification results.
ring:qa
Senior QA Analyst for financial systems. Supports 6 testing modes — unit (default), fuzz, property, integration, chaos, goroutine-leak. Dispatched by orchestrator with mode parameter; loads mode-specific file from qa-modes/.