Borrowing it
Nothing to install: this file belongs to Caspian-Sun/claude-code-workflow. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/Caspian-Sun/claude-code-workflow/main/.claude/commands/test.mdgit clone --depth 1 https://github.com/Caspian-Sun/claude-code-workflowWrote 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/commands/caspian-sun/claude-code-workflow/test)<a href="https://agentmods.dev/commands/caspian-sun/claude-code-workflow/test"><img src="https://agentmods.dev/badge/commands/caspian-sun/claude-code-workflow/test/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/commands/caspian-sun/claude-code-workflow/test"><img src="https://agentmods.dev/badge/commands/caspian-sun/claude-code-workflow/test.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.00000 | $0.03203 |
| Opus 5.5 | $0.00000 | $0.01281 |
| Sonnet 5.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 2mo 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.
- 2mo 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 1mo 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
muggle-do
Quality-guranteed development workflow by Muggle AI. Takes a task through requirements, coding, testing, QA, and PR creation with iterative fix loops. Manages state in .muggle-do/sessions/ for auditability and crash recovery.
uw-cmd-test
Write comprehensive tests for a feature and verify they all pass.
test-gap
Find untested branches and edge cases in a file or the diff. Delegates to @qa-engineer. Returns a prioritized list of missing tests with draft names and assertions.
session
Complete guide to managing pair programming sessions.
test-tdd
Run when user calls /test-tdd. Scans modified files, locates their corresponding unit/integration test suites, and runs them.
kill-mutants
Analyze surviving mutants from a mutation testing run and write targeted unit tests to kill them. Re-runs mutations to confirm kills.