test

A command that runs the current project's automated tests and reports the results. It detects the test tool from the repository, such as Maven, Gradle, npm, or pytest.

In plain words
What is it for?
Use it to check whether code changes pass the project's test suite and to produce a recorded test result for the workflow.
Why use it?
It removes the need to remember which test command a project uses. It also reports when no test runner can be reliably identified.

Command for Claude Code

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/pierry/harness-kit/test
Clone the repo
git clone --depth 1 https://github.com/Pierry/harness-kit

Made for: Claude Code.

Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 755 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.00019 $0.00755
Opus 5 $0.00010 $0.00378
Sonnet 5 $0.00004 $0.00151
Haiku 4.5 $0.00002 $0.00076

Measured 2d ago against content hash 226d79042d5f, 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 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.

.claude/commands/sse/test.md · 61 lines

What it actually says

Run test suite for current repo. Follow .claude/agents/staff-software-engineer/guides/pipeline.md for retry, approval, publish, and .claude/shared/pipeline-pattern.md for inputs (resolve-mark-proceed) and eval (adversarial).

Print header card before running and footer card after suite finishes. Format: .claude/scripts/stage-card.md.

Detect project test command (in order):

  1. Check README.md or CONTRIBUTING.md for explicit test instructions.
  2. Maven (pom.xml present): ./mvnw test or mvn test
  3. Gradle (build.gradle present): ./gradlew test
  4. npm (package.json with "test" script): npm test
  5. pytest (pyproject.toml or pytest.ini): pytest
  6. Otherwise, infer the runner from the repo: package.json scripts, build files, Makefile targets, CI config (.github/workflows/), or project conventions. If it genuinely cannot be inferred, mark NOT FOUND - NEEDS REVIEW: test runner in the report and proceed (report it). Do NOT ask the user.

Before running, write the phase start marker by running this script. Do NOT inline date/printf (command-substitution + redirect always trips the permission prompt):

.claude/scripts/marker.sh start .claude/runtime/outputs/sse/.markers/{feature_id}.test-generate.start

Run test command. Capture stdout and stderr.

Save .claude/runtime/outputs/sse/test/{feature_id}.md with:

  • command run
  • exit code
  • passed, failed counts
  • failing test names (if any)
  • duration

Document gates (run on saved report):

  • Sensor: .claude/agents/staff-software-engineer/sensors/test-structure.md (auto-run by post-write hook)
  • Eval: .claude/agents/staff-software-engineer/evals/test-quality.md (threshold 8.0)

Run the evals adversarially: dispatch a fresh evaluator via the Task tool (subagent_type: general-purpose) that did not author this test report. Hand it only the artifact path and the one rubric path; it scores against the rubrics and reports weighted totals plus the low-scoring dimensions. Below threshold (8.0) retries per pipeline.md, regenerating only the flagged dimensions.

Append approval marker only when exit code is 0 and test-quality eval is >= 8.0. Append with the Edit tool, not Bash: post-eval-sse.sh fires on Edit, and a Bash append skips token accounting and the score log. Keep score= in the shape, phase-log.py only parses markers that carry it:

<!-- approved: {YYYY-MM-DD} score={N} -->

Tests fail, return blocker with failing test names and snippet of failure output. Don't retry automatically; let user decide.

Reply with this exact shape:

Tests {passed|failed}.
  command:  {detected-test-command}
  passed:   {N}
  failed:   {M}
  duration: {seconds}s
  sensors:  test-structure ok
  eval:     test-quality {N}/10
  output:   {path/to/test/output.md}
  next:     /sse:pr (if passed) | fix failing tests (if failed)

Failed, append failures: block listing each failing test name with one-line snippet from failure output.

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. 2d ago First seen · 61 lines · 19 tokens per session scan A 226d79042d5f

Subscribe to this mod's changes

test is a command published in the GitHub repository Pierry/harness-kit (3 stars, last pushed 1mo ago), licensed MIT. It adds 19 tokens to every session and 755 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-31.