test

A test-running command for software projects. It chooses which tests to run and can report coverage, which shows how much code the tests exercise.

In plain words
What is it for?
It runs all tests or selected backend, frontend, unit, integration, end-to-end, or individual-file tests. It also supports watching for changes, detailed output, coverage reports, and stopping after the first failure.
Why use it?
It avoids manually remembering different test commands and makes it easier to inspect failures and the overall condition of a test suite.

Command

Install

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.

agentmods
npx agentmods add commands/paulduvall/ai-development-patterns/test
Clone the repo
git clone --depth 1 https://github.com/PaulDuvall/ai-development-patterns
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,430 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00011 $0.01430
Opus 5 $0.00005 $0.00715
Sonnet 5 $0.00002 $0.00286
Haiku 4.5 $0.00001 $0.00143

Measured yesterday against content hash fc179cd8f9e9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

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 yesterday.

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.

examples/custom-commands/commands/test.md · 226 lines

How it starts

The opening of the file, as written. The whole thing — 226 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Test Suite Runner

You are helping a developer run tests with smart filtering, comprehensive reporting, and test suite health monitoring. Parse arguments to determine test scope, execute appropriate test commands, analyze results, and provide actionable recommendations.

Usage

/test                          # Run all tests
/test backend                  # Run backend tests only
/test frontend --watch         # Run frontend tests in watch mode
/test integration --verbose    # Run integration tests with verbose output
/test --coverage               # Run with coverage report

Implementation

1. Parse Arguments

Extract test target and flags from arguments:

Test Targets (first positional argument):

  • backend - Run backend/server tests
  • frontend - Run frontend/client tests
  • integration - Run integration tests only
  • unit - Run unit tests only
  • e2e - Run end-to-end tests
  • [specific-file] - Run specific test file
  • No argument - Run all tests

Flags (optional parameters):

  • --watch - Watch mode (re-run on file changes)
  • --coverage - Generate coverage report
  • --verbose - Detailed output with logs
  • --bail - Stop on first failure
  • --update-snapshots - Update test snapshots

2. Determine Test Command

Map arguments to appropriate test commands:

# Examples
backend           → pytest tests/backend/ -v
frontend          → npm test -- --testPathPattern=frontend
integration       → pytest tests/integration/ -v
backend --coverage → pytest tests/backend/ --cov=src/backend --cov-report=html
frontend --watch  → npm test -- --watch --testPathPattern=frontend

3. Execute Tests

Run the determined test command:

# Set up test environment
export NODE_ENV=test
export TESTING=true

# Run tests with appropriate flags
[test_command]

4. Parse Test Results

Extract key metrics from test output:

  • Total tests run
  • Tests passed/failed/skipped
  • Test duration
  • Coverage percentage (if --coverage flag used)
  • Failed test details (if any)

Read the full file on GitHub · 226 lines

Changes

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.

  1. yesterday First seen · 226 lines · 11 tokens per session scan A fc179cd8f9e9

Subscribe to this mod's changes

test is a command published in the GitHub repository PaulDuvall/ai-development-patterns (645 stars, last pushed 2d ago), licensed MIT. It adds 11 tokens to every session and 1,430 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.