Skip to main content
command CX Codex

test · coco-research — Claude Code command: test pipeline runner

Command for Claude Code that runs the complete test cycle: coverage analysis, test generation, and regression validation. Call it to fill coverage gaps or verify the test suite runs end-to-end.

MIT ★ 328 updated 2026-10-29

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/test.md
Open on GitHub

What test does

The command lives in .claude/commands/test.md within Claude Code. It orchestrates a multi-layer pipeline: L1 technical analysts map coverage gaps and spot critical untested paths; L2 architects and engineers write tests following existing patterns; L3 reviewers check quality and edge cases. Each stage calls scripts from ~/.claude/skills/team-gate/scripts/: brownfield_map.py scans for gaps, then run_gate.py in discover, run, and coverage modes validates the suite, and prove_red.py verifies each test fails without the implementation.

Tests go into tests/test_* files; source code is off-limits. The pipeline reads tool versions from gate files pinned in CI and halts if your local tools differ. Every new test gets a proof run: the implementation is stubbed in a throwaway worktree, and the test must fail for the right reason. Full regression runs after all Layer 2 agents finish, since their commits shifted HEAD past the last discovery step.

What it helps with

  • fill coverage gaps with tests for critical code paths
  • prove each new test catches a real regression
  • verify the test suite passes with the exact tool versions CI uses
  • map which modules lack test coverage

Example prompts for the agent

  • Add missing tests for the auth module covering authorization errors
  • Run /team test to close coverage gaps across the codebase
  • Prove the suite passes and each test catches a regression

How to install test

Manually: put the files in place

.claude/commands/test.md

Call it with /test. For all projects use ~/.claude/commands/

Questions about test

How do I install the test command in Claude Code?

Place the file in .claude/commands/test.md at your project root. The command will be available as /team test. For other platforms: ~/.codex/prompts/test.md (Codex), .github/prompts/test.prompt.md (GitHub Copilot), .gemini/commands/test.toml (Gemini CLI).

What does the test command do?

Runs a multi-layer test pipeline: maps coverage gaps, generates tests matching existing patterns, validates test quality and edge cases, proves each test fails without the implementation, and runs full regression on the merged suite.

What do I need before using this command?

Scripts from ~/.claude/skills/team-gate/scripts/ must be installed, your test environment (framework, fixtures) configured, and CI tool versions pinned in gate files. The command will block if your local tool versions differ from CI pins.

Source text

test.md · MIT
---
description: "Use when the user asks to add missing tests, close coverage gaps, or prove a suite runs. Runs the /team test pipeline: coverage analysis, test writing, then a regression gate that treats any skip as unverified. Tests only, no source."
---

# /team test: Test Pipeline

> Called by team.md router when action is `test`.

## Role Selection Bias

| Layer | Preferred Roles | Count |
|-------|----------------|-------|
| L1 | technical-analyst | 2 |
| L2 | qa-test-architect + (domain engineers) | 3-4 |
| L3 | domain-accuracy | 1-2 |
| L4 | principal-architect | 1 |

## Stage 1: Brownfield Map

```
python3 ~/.claude/skills/team-gate/scripts/brownfield_map.py --for "<the coverage gap or test task in words>" --repo-root .
```
exit 0: continue; read `.team-ship/BROWNFIELD-MAP.md` before reading any code.
exit 1: not used; a map is not a pass or fail judgement.
exit 2: UNVERIFIED; quote the gate file's summary (gates/handoff-1-map.json).

No test-pipeline aggregator exists to require this gate file; the map is the first step by instruction.

## Pipeline Customization

### Layer 1: Coverage Analysis
L1 agents focus on the following areas.
- Current test coverage map (which modules have tests, which don't)
- Critical paths that lack coverage
- Existing test patterns and conventions
- Test infrastructure setup (frameworks, fixtures, mocks)

### Layer 2: Test Writing
- **Mode:** `bypassPermissions`
- File ownership: each agent owns `tests/test_{module}*` files
- DO NOT TOUCH: source code (tests only), other agents' test files
- Follow existing test patterns (fixtures, naming, assertions)

**Toolkit integration:**
- Check team:toolkit.md for "Test-Driven Development" entry
- qa-test-architect designs the test strategy; domain engineers write module-specific tests

1. Read the owned source module to understand behavior, then identify untested edge cases and error paths.
2. Run `run_gate.py discover` to find the repository's authoritative test commands, then `run_gate.py parity` to check the local tool versions against the versions CI pins.

```
python3 ~/.claude/skills/team-gate/scripts/run_gate.py discover --repo-root .
python3 ~/.claude/skills/team-gate/scripts/run_gate.py parity --repo-root .
```
exit 0: continue and quote each gate file's summary (gates/7-discover.json, gates/7.json).
exit 1: BLOCK; parity names the tool whose version differs, quote it and align the tool before continuing.
exit 2: UNVERIFIED; the suite is not confirmed passing until the gate passes or an override receipt names the gate.

3. Run `run_gate.py run` for the baseline, before any new test is committed. Record this run's head now: step 4 commits and step 5 rewrites gates/8.json, so the head this step writes is captured here for step 6's `--base`, not read fresh from gates/8.json later.

```
python3 ~/.claude/skills/team-gate/scripts/run_gate.py run --repo-root .
```
exit 0: continue and quote the gate file's summary (gates/8.json).
exit 1: BLOCK; quote the reasons from the gate file and loop back to test writing.
exit 2: UNVERIFIED; the suite is not confirmed passing until the gate passes or an override receipt names the gate.

Provision what CI provisions. When something cannot be provisioned, record "override integration: <reason>" in your own words as the human, and run_gate's skip rule decides the rest.

4. Write the tests following existing patterns, then commit them alone: `test({module}): add missing tests for {description}`.
5. The commit in step 4 moved HEAD, and `run` refuses a discover file recorded at a different HEAD, so run `run_gate.py discover` again before `run_gate.py run`, so the new tests are checked at HEAD.

```
python3 ~/.claude/skills/team-gate/scripts/run_gate.py discover --repo-root .
python3 ~/.claude/skills/team-gate/scripts/run_gate.py run --repo-root .
```
exit 0: continue and quote each gate file's summary (gates/7-discover.json, gates/8.json); gates/8.json is rewritten and the latest receipt wins.
exit 1: BLOCK; for the command that stopped, quote its gate file's summary and loop back to test writing.
exit 2: UNVERIFIED; for the command that stopped, quote its gate file's summary; the suite is not confirmed passing until the gate passes or an override receipt names the gate.

6. Run `prove_red.py prove --base <the head recorded in gates/8.json by the baseline run in step 3> --repo-root .`. prove_red runs each new test green at HEAD, reverts the implementation in a throwaway worktree, and proves it goes red for the right reason.

```
python3 ~/.claude/skills/team-gate/scripts/prove_red.py prove --base <the head recorded in gates/8.json by the baseline run in step 3> --repo-root .
```
exit 0: continue and quote the gate file's summary (gates/9.json).
exit 1: BLOCK; a never-red or invalid-red classification, quote the reason from gates/9.json.
exit 2: UNVERIFIED; the suite is not confirmed passing until the gate passes or an override receipt names the gate.

On a tests-only change prove_red switches to its stub mode: it replaces the implementation modules the new test imports with stubs in the throwaway worktree and proves the test fails against them, recording the class valid-red-stub; a test that still passes, or imports no implementation module, is never-red with the reason "exercises no implementation module".

7. Run `prove_red.py recheck` to confirm the proved tests still hold.

```
python3 ~/.claude/skills/team-gate/scripts/prove_red.py recheck --repo-root .
```
exit 0: continue and quote the gate file's summary (gates/9-recheck.json).
exit 1: BLOCK; quote the reasons from the gate file and loop back to test writing.
exit 2: UNVERIFIED; the suite is not confirmed passing until the gate passes or an override receipt names the gate.

### Layer 3: Test Quality Review

L3 agents verify the following properties.
- Tests actually test behavior (not implementation details)
- No test interdependence or shared mutable state
- Edge cases covered (null, empty, boundary, error paths)
- Test names describe the scenario being tested

Run `run_gate.py evidence`, per the Test Evidence Protocol (`team:evidence.md`). It assembles EVIDENCE.json and renders EVIDENCE.md, so execution is confirmed rather than narrated.

```
python3 ~/.claude/skills/team-gate/scripts/run_gate.py evidence --repo-root .
```
exit 0: continue and quote `.team-ship/EVIDENCE.md`; a pass claimed without this file's entries is a finding, not a pass.
exit 1: not used; evidence exits 0 or 2.
exit 2: UNVERIFIED; the suite is not confirmed passing until the gate passes or an override receipt names the gate.

### Full Regression

Run after all Layer 2 agents complete. Their combined commits moved HEAD past the last discover, so discover again before running the merged suite.

```
python3 ~/.claude/skills/team-gate/scripts/run_gate.py discover --repo-root .
python3 ~/.claude/skills/team-gate/scripts/run_gate.py run --repo-root .
python3 ~/.claude/skills/team-gate/scripts/run_gate.py coverage --repo-root .
python3 ~/.claude/skills/team-gate/scripts/run_gate.py evidence --repo-root .
```
exit 0: continue and quote each gate file's summary (gates/7-discover.json, gates/8.json, gates/10.json) and `.team-ship/EVIDENCE.md`.
exit 1: BLOCK; for the command that stopped, quote its gate file's summary and loop back to test writing.
exit 2: UNVERIFIED; for `coverage`, no pytest-shaped command gives NOT_APPLICABLE, which still blocks unless an override receipt names gate "coverage"; for any other command that stopped, the suite is not confirmed passing until the gate passes or an override receipt names the gate.

Write `.team-ship/PR-BODY.md` with a Results section in which every sentence carries one [E<n>] tag naming an EVIDENCE.json entry, then check its claims against the evidence; a green claim without a backing entry is a finding, not a pass.

```
python3 ~/.claude/skills/team-gate/scripts/claim_evidence.py check .team-ship/PR-BODY.md --repo-root .
```
exit 0: continue and quote the gate file's summary (gates/12.json).
exit 1: BLOCK; quote the findings from gates/12.json and reword or remove each unbacked claim.
exit 2: UNVERIFIED; the claims are not confirmed until the check passes or an override receipt names the gate.

## GSD Integration

When `.planning/` exists, L2 agents check test requirements from REQUIREMENTS.md. Test files follow GSD naming conventions.

© coco-research · MIT · coco-research/coco

Similar slash commands

All slash commands for Testing and QA →

test by other authors comes first.

test SuperClaude-Org Execute unit, integration, and e2e tests with code coverage analysis and quality reporting. Auto-detects test frameworks and supports watch mode for continuous testing during development. CX Codex +1 ★ 23,950repo stars test-suite-curation kindlmann test-suite-curation is a Claude Code skill that audits a regression suite for duplicate, outdated, and low-value tests. It activates on requests to review the suite or split it into smoke, core, and extended tiers. CX Codex +1 1,300installs test-audit mblode test-audit — a skill for Claude Code, Cursor, Codex and other agents that removes low-value tests from a suite down to a measured target while keeping coverage. Runs as a focused directory audit or a whole-repo campaign with a numeric goal. CX Codex +1 283installs test-automator VoltAgent test-automator — a subagent for writing and improving automated tests. Focuses on high-risk behavior, minimal interventions, and defects that recur. CX Codex ★ 6,505repo stars test-gaps ruvnet test-gaps detects missing test coverage and suggests tests to write. Helpful right after adding a new feature or before cutting a release. CX Codex +1 755installs test-quality-analysis secondsky test-quality-analysis spots overmocking, brittle selectors, and flaky tests in test suites. The skill guides test reviews and verifies coverage thresholds across codebases. CX Codex +1 478installs test-quality-inspector bobmatnyc test-quality-inspector inspects test suites for empty assertions and missing edge cases. It guides your coding agent to verify persistence, negative paths, and input validation. CX Codex +1 385installs

From the same set82

The whole set →
brain:init brain:init is a Claude Code skill that sets up project_brain.db in the project directory and extracts structured memory from CLAUDE.local.md, docs, and notes. CX Codex +1 ★ 328repo stars pmstudio-sync The pmstudio-sync skill turns changes in source files into proposed updates for linked PRDs, decks, and notes. It waits for approval before editing. CX Codex +1 ★ 328repo stars agent-lightning A reference skill for Microsoft's Agent Lightning: instrument an agent, collect traces, then run reinforcement learning or prompt tuning on top of them. CX Codex +1 ★ 328repo stars sync-init sync-init automates project background sync every 2 hours: monitors Outlook emails, checks watched folders for changes, and refreshes documents via Claude CLI. CX Codex +1 ★ 328repo stars cognee:store cognee:store is a Claude Code skill that writes session entities, decisions and events to a Cognee knowledge graph through POST /api/v1/remember. Project agreements stay in the graph and come back on semantic search. CX Codex +1 ★ 328repo stars gsd-user-profiler The gsd-user-profiler subagent reads developer session messages and builds a behavioral profile with ratings, confidence levels, and evidence. A profiling workflow can launch it for analysis. CX Codex ★ 328repo stars mcp-specialist mcp-specialist — a subagent for building and configuring MCP servers in Claude Code. Handles architecture design, transport layer implementation, tool and resource setup, and connection troubleshooting against the MCP 2025-06-18 spec. CX Codex ★ 328repo stars gradient-text-sweep gradient-text-sweep guides Claude Code in animating gradients inside text via background-clip: text and GSAP. Fits title card sweeps, karaoke word reveals, and hue crossfades. CX Codex +1 ★ 328repo stars

Project sponsors

Companies that keep this analytics open