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/caspian-sun/claude-code-workflow/testgit 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.00000 | $0.03203 |
| Opus 5 | $0.00000 | $0.01602 |
| Sonnet 5 | $0.00000 | $0.00641 |
| Haiku 4.5 | $0.00000 | $0.00320 |
Grade A, and why
test 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 — 246 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are now acting as a Test Engineer. Generate comprehensive test cases for the specified components/functions.
Testing Frameworks
- Unit tests: Vitest + @testing-library/react
- E2E tests: Playwright (only when explicitly requested)
Test File Placement Rules (mandatory)
All test files must be placed under workspace/tests/, mirroring the workspace/src/ directory structure with a one-to-one correspondence to source files.
Prohibited: placing *.test.ts(x) files in the same directory as source files or in __tests__/ subdirectories.
Mapping examples:
| Source File | Test File |
|---|---|
workspace/src/features/list/api/listApi.ts |
workspace/tests/features/list/api/listApi.test.ts |
workspace/src/features/list/components/SearchForm.tsx |
workspace/tests/features/list/components/SearchForm.test.tsx |
workspace/src/pages/list/index.tsx |
workspace/tests/pages/list/index.test.tsx |
Test files must reference business code exclusively via the @/ alias (do not write ../../../src/...):
import SearchForm from '@/features/list/components/SearchForm';
vi.mock('@/features/list/api/listApi', () => ({ ... }));
Execution Flow
Step 0: Read Business Anchors and Extract Business Rules (mandatory)
Test expectations must come from business rules, not from AI inferences about source code behavior. Otherwise you get "tests and source code are both AI-written, mutually validating" false passes.
For each target source file:
-
Extract business anchors from the JSDoc header (see
.claude/rules/file-docs.md):@prd docs/prds/xxx.md#<anchor>→ PRD location@task docs/tasks/xxx.json#<taskId>→ task entry@rules→ multi-line business rule list
-
Read the linked documents:
- Open the PRD fragment at
@prdfor full context - Open the task entry at
@taskto read acceptance criteria - Use
@rulesdirectly as the rule list
- Open the PRD fragment at
-
Output the business rule list (show to user for alignment):
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 · 246 lines · 0 tokens per session scan A a6486c966d25
test is a command published in the GitHub repository Caspian-Sun/claude-code-workflow (10 stars, last pushed 5d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,203 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 commands, from other repositories
improve-ut
Use this command to improve test coverage after code changes.
generate-tests
Generate comprehensive tests for specified code.
uw-cmd-test
Write comprehensive tests for a feature and verify they all pass.
vibe-agents
Step 4 of the vibe-coding workflow: generate AGENTS.md + tool configs so the AI builder stays on track.
verify
Grade work that already exists and decide whether it can merge. Runs the project's current unit, integration, and E2E suites plus security scanning and type checking, scores every dimension 0-10, and returns a merge verdict with a VERIFIED-vs-CLAIMED evidence manifest. Writes no test files and edits no source. Use…
go-test
Go TDD workflow with table-driven tests.