/mokata:testfrom mokata
Writes failing tests (RED) from an approved spec using TDD. Covers each acceptance criterion at its consumer boundary with adversarial inputs. Does not write implementation.
Ships in mokata. Installing the plugin adds it to Claude Code.
Do NOT write tests until the spec is emitted and SAVED: FETCH this run's persisted, completeness-gate-passed spec with the spec_show tool (or mokata spec show) and work from what it returns; if there is none, STOP and produce + emit the spec first (/mokata:spec). Then write tests that express the desired behaviour and watch them FAIL first (RED). Do NOT write implementation here. One behaviour per test, clear names, real code over mocks. Reference the REAL names, signatures, and return types found in the code — never invent an interface; verify each symbol you call exists and has the shape you expect. Test ONLY the approved acceptance criteria — do not invent ACs or cover behaviour the approved spec doesn't state. If an AC is wrong, missing, or untestable, STOP and ask to amend the spec (so ACs and tests stay provable); never silently add or drop coverage. COVER EACH AC AT ITS CONSUMER AND UNDER ITS ADVERSARIAL INPUTS — this is the SAME AC, not extra scope, and skipping it is the most common way a green suite ships a bug. (a) THE SEAM: an AC is about behaviour a CALLER depends on, so assert it where the value is READ, not only where it is produced — find the consumers with mokata query callers|refs <symbol> and write at least one assertion against the contract AS THE CONSUMER READS IT (its shape, its length, its truthiness). A unit test that proves the producer populates a field, while the consumer reads a different field of it, passes and proves nothing. (b) THE ADVERSARIAL VALUES: for each AC, name its input domain and feed the boundary of that domain, not one comfortable example — empty, zero and other FALSY-BUT-PRESENT values, absent versus present-and-empty, the maximum, and a hostile key or name. These are the approved AC evaluated honestly; a case that changes what is REQUIRED is a new AC and still needs an amendment. If you cannot reach a consumer or a boundary, SAY which and why. Record every test run you make: mokata progress test-run --passed|--failed --command "<the command>" --test tests/test_x.py::TestX::test_y --ac <AC>=tests/test_x.py::TestX::test_y — each test by its FULL id, the node id pytest prints with -rA (or pass that output with --runner-report <file>); a bare name never proves.
Tests must be shown to FAIL before any implementation exists. Writing implementation in this step is a gate violation.
This command runs on its own — no upstream pipeline phase is required. It applies only its own gate above, and never silently skips a gate of a phase you did run.
Precondition (spec-persisted): a saved spec with at least one acceptance criterion must exist — the run's persisted spec, written by the human-gated emit after the completeness gate passes. FETCH it with the spec_show tool (or mokata spec show); it is keyed to this run, not a file you can open by name. If it's absent, STOP and produce + emit the spec first (/mokata:spec) — do not write code or tests against an unsaved spec.
At the START and END of this phase, show where the run is: print the mokata run-progress block (the ordered phases marked done/current/pending with the [done/total] count and what's next) and a one-line banner naming what's running now — e.g. mokata · test (running) then mokata · test (done). This is read-only over the persisted run-state (mokata progress / the progress MCP tool) — surface it, don't invent it. So the user never wonders whether mokata is running or which part. Where the harness has a NATIVE to-do list (a summary line + steps you can mark done / in-progress / pending), render THIS SAME run-progress there — a summary line plus one item per phase, each done / in-progress / pending — and keep it in sync as each gate passes. DERIVE those items from mokata's run-state (mokata progress / build_todo_items), never invent steps of your own; YOU render the widget (mokata drives it through this prompt — it cannot call the to-do tool itself). Where there is NO native to-do surface, fall back to printing the run-progress block above. It is one run-progress, shown on whichever channel the user is looking at. When the phase FINISHES, also print a one-line recap + the single next step — ✓ test done — <one-line recap>. Next: /mokata:`` (include the in-stage counter, e.g. [3/7 ACs], when one applies). The next step reaches the user through the / command autocomplete (click-to-fill) and your own follow-up offer — you CANNOT pre-fill the prompt box or rebind Tab, so never imply you can; just NAME the command and offer to proceed. If a gate fired, print its one-line verdict and, on a block, the single action that clears it (→ to unblock: …).
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
npx claudepluginhub jasgujral/mokata-oss --plugin mokata40 commands in this plugin
/brainstormmokata · Socratic pre-spec exploration — explore approaches WITH the user, one question at a time, and HARD-GATE the spec behind explicit approval. Runs standalone or as the front of mokata's pipeline./bugmokata · Start from a reproducer and a failing test, then fix./chainmokata · Plan a manual chain of skills to run in order — each step keeps its own gate./debugmokata · Reproduce first, capture in a failing test, then fix./decomposemokata · Split the approved spec into independent subtasks + a dependency plan, then confirm to run./developmokata · Implement the minimum to turn a failing test green.Other plugins' commands for the same job