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/awattar/claude-code-best-practices/testgit clone --depth 1 https://github.com/awattar/claude-code-best-practicesWhat 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.00010 | $0.00954 |
| Opus 5 | $0.00005 | $0.00477 |
| Sonnet 5 | $0.00002 | $0.00191 |
| Haiku 4.5 | $0.00001 | $0.00095 |
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 — 130 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Claude Code User Command: Test
This command helps you run and improve the test suite for the scope specified in $ARGUMENTS.
Usage
To test specific files or features, just type:
/test <file-or-directory>
/test <feature>
To test everything, just type:
/test all
What This Command Does
- Identifies test scope based on $ARGUMENTS (file, directory, feature or all).
- Checks current test coverage and runs targeted tests first.
- Executes integration and full test suite as needed.
- Fixes failing tests and adds missing test coverage.
- Documents results and commits improvements.
Agents Used
This command leverages specialized agents for comprehensive test suite management:
- general-qa - Primary agent for comprehensive testing strategies and automation
- general-code-quality-debugger - For debugging failing tests and improving test quality
- general-backend-developer - For API testing and integration test implementation
- general-frontend-developer - For UI testing with browser automation tools
Each agent contributes specialized expertise to ensure thorough project analysis and high-quality documentation generation.
Follow these steps:
General
Follow testing best practices and TDD principles. See GitHub's language-specific testing guides at https://docs.github.com/en/actions/how-tos/use-cases-and-examples/building-and-testing
Before starting:
- Identify the project's test framework (e.g., RSpec, Jest, pytest, xUnit). Check package.json, Gemfile, requirements.txt, or project documentation.
- Determine the browser automation tool for UI tests (e.g., puppeteer, playwright, selenium, cypress). Ask if unclear.
- Identify E2E testing approach based on the application type (browser-based, API, CLI, or mixed).
- Locate test configuration files and understand the test structure.
- Check for any project-specific testing guidelines in documentation or README.
Assess
Understand the current testing landscape:
- Identify the scope:
- If $ARGUMENTS is a file/directory, focus tests there.
- If $ARGUMENTS is a feature, find all related specs.
- If $ARGUMENTS is "all", prepare for full suite run.
- Check current test coverage:
- Run coverage reports if available.
- Identify untested or poorly tested areas.
- Review existing test patterns:
- Search for similar test files as examples.
- Check scratchpads for testing guidelines.
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 · 130 lines · 10 tokens per session scan A 239a2576fb64
test is a command published in the GitHub repository awattar/claude-code-best-practices (250 stars, last pushed 3mo ago), licensed MIT. It adds 10 tokens to every session and 954 once invoked, about $0.0001 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-30.
Other commands, from other repositories
git
Git operations with intelligent commit messages and workflow optimization.
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.