test

A command that asks a test-writing subagent to add focused behavioural tests. It can also start browser-based end-to-end tests, which check a complete user flow through the application.

In plain words
What is it for?
Use it to add unit or behavioural tests, run the end-to-end pipeline, or perform a temporary watched browser walkthrough.
Why use it?
It provides a defined way to turn a testing request into targeted tests or a browser walkthrough. Its mode rules prevent an end-to-end request from being mistaken for an ordinary unit-test request.

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/lugassawan/swe-workbench/test
Clone the repo
git clone --depth 1 https://github.com/lugassawan/swe-workbench
Per session 67 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,140 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.00067 $0.02140
Opus 5 $0.00034 $0.01070
Sonnet 5 $0.00013 $0.00428
Haiku 4.5 $0.00007 $0.00214

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

commands/test.md · 150 lines

How it starts

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

Target: $ARGUMENTS

If $ARGUMENTS contains a ticket reference, invoke swe-workbench:ticket-context first and prepend its structured summary to the delegation context below. Skip if $ARGUMENTS is free-text with no recognizable ref. (Trigger patterns are defined in that skill's "When to invoke" section.)

Mode resolution

Parse $ARGUMENTS for --mode e2e-live, --mode e2e, or --e2e. Match --mode e2e-live by exact token first — a substring match on e2e would false-trip the e2e branch since e2e-live contains e2e:

  • E2E-live mode (--mode e2e-live present): strip the flag from the target and follow the E2E-live path below.
  • E2E mode (--mode e2e or --e2e present): strip the flag from the target and follow the E2E path below. This also means a bare --e2e-live attempt (unsupported — only --mode e2e-live is recognized) must not be treated as --e2e.
  • Default mode (no flag, or any unrecognized flag such as a bare --e2e-live): follow the Unit path below with the unrecognized token left in the target text — there is no dedicated error path for unsupported flags.

E2E path (--mode e2e)

Hard gate

Before dispatching any agents, verify that Playwright MCP is available in this session by checking whether browser_snapshot (or equivalent browser_* tools under the MCP install prefix) is reachable.

If Playwright MCP is not connected, stop immediately and return:

BLOCKED: Playwright MCP not connected — run `claude mcp add playwright npx @playwright/mcp@latest`, restart Claude Code, and retry.

Do not delegate to any agent until the gate passes.

Pipeline

Dispatch the following two-agent pipeline in sequence:

  1. swe-workbench:e2e-test-writer — explores the live app via Playwright MCP, authors durable spec files, and produces a behaviour inventory + spec paths.
  2. swe-workbench:e2e-test-verifier — receives the spec paths from step 1, runs them via the project's detected E2E command, and distrusts false-greens.

Read the full file on GitHub · 150 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. 2d ago First seen · 150 lines · 67 tokens per session scan A 273984564738

Subscribe to this mod's changes

test is a command published in the GitHub repository lugassawan/swe-workbench (2 stars, last pushed 2d ago), licensed MIT. It adds 67 tokens to every session and 2,140 once invoked, about $0.0003 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.