/spwf:write-testsfrom spwf
Phase 3 atomic — Red phase of TDD. Read the next unchecked task, write failing tests that define the expected behaviour, then run them to confirm they fail. Tests must fail before implementation begins — a test that passes before the code exists is wrong. Use before build, or let /spwf:build invoke it. Called as a step by /spwf:build (Red phase), which is why Claude may invoke it. Do not start it unprompted: run it standalone only when the user asks.
Ships in spwf. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Red phase. Write failing tests that define the behaviour required by the next task. The tests must fail when run — that failure is the signal that they are correctly describing code that does not yet exist.
Do not implement anything. Do not fix the failures. Stop at Red.
Read openspec/changes/{change-id}/tasks.md. Find the first - [ ] item — this is what the tests will cover.
Read the relevant spec under openspec/changes/{change-id}/specs/ to understand the required behaviour precisely.
ls package.json pytest.ini pyproject.toml jest.config.* vitest.config.* 2>/dev/null
Read the config to determine: how tests are run, where test files live, and what the naming convention is.
From the task description and spec, determine what code unit will be created or changed. If the module does not yet exist, write imports as if it does — the import failure is part of Red.
Place the test file following project convention:
tests/test_{module}.py{file}.test.ts or __tests__/{file}.test.tsEach test must:
test_returns_empty_list_when_no_items, not test_functionCover at minimum:
Do not test:
{test command}
All tests must fail at this point. This is the Red check.
If a test passes before any implementation:
Fix the test until it fails for the right reason.
✗ Tests failing (Red) — ready for implementation
Test file: {path}
Failing tests:
- {test name}: {why it fails — expected vs actual}
- {test name}: {why it fails}
Failing correctly? ✓
Recommended next step: /spwf:build (opsx:apply phase)
Do not proceed to implementation. Stop here. build will invoke opsx:apply for the Green phase.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub simon-potter/spwf --plugin spwf38 skills in this plugin
/address-reviewPhase 6.5 — Address Review. Turn review feedback into action. Sources feedback from either a local report file (e.g. {branch}-review.md from /spwf:pr-review or {branch}-self-review.md from /spwf:simplify) or fetched human comments on an open PR/MR. For each item runs READ → VERIFY → EVALUATE → implement-or-push-back, in priority order (blocking → important → nit). Forbids performative agreement ("you're absolutely right"). Use after pr-review, or whenever a reviewer leaves comments./agent-optimiseCross-cutting — Audit both the project .claude/ and personal ~/.claude/ for quality issues. Covers CLAUDE.md scope and length, agent descriptions, skill frontmatter, and settings.json conflicts. Always audits both scopes. Produces a prioritised P1/P2/P3 fix list./