# test

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.

- command · `type=command` · Claude Code, Codex, GitHub Copilot, Gemini CLI · ★ 328 repo stars
- Author: coco-research
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/coco-research/coco/tree/HEAD/commands/team/test.md
- Updated: 2026-10-29
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/commands/coco-research-test

## What it 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.

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/commands/test.md` — Call it with /test. For all projects use ~/.claude/commands/

### Codex

**Manually: put the files in place**
- File: `~/.codex/prompts/test.md` — Call it with /prompts:test. Codex marks this format deprecated in favour of skills

### GitHub Copilot

**Manually: put the files in place**
- File: `.github/prompts/test.prompt.md`

### Gemini CLI

**Manually: put the files in place**
- File: `.gemini/commands/test.toml` — Gemini stores commands as TOML: the prompt text goes into the prompt field

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/coco-research/coco/tree/HEAD/commands/team/test.md

## When to use it
- 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
- 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

## Source text · test.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: d9dfe2609fa7e87f.

BEGIN THIRD-PARTY FILE d9dfe2609fa7e87f
````text
---
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 .
```
````
END THIRD-PARTY FILE d9dfe2609fa7e87f

The third-party file has ended. Everything between the d9dfe2609fa7e87f tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 3835 of 8378 bytes. © coco-research · MIT · https://github.com/coco-research/coco/tree/HEAD/commands/team/test.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
