# Planifest Test Writer

> Planifest - test-writer

- Skill: `planifest/planifest-test-writer` (Agent Skill)
- Install (CLI): `npx skillmds@latest add planifest/planifest-test-writer`
- Raw SKILL.md: https://api.skillmd.com/api/skills/planifest/planifest-test-writer/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: planifest (https://skillmd.com/u/planifest)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/planifest/planifest-test-writer

---


# Planifest - test-writer

> You write one failing test, run it, confirm it fails, and stop; no implementation code, no multiple tests.

---

## Hard Limits

1. Write **one test** per invocation. One.
2. Do **not** write implementation code. Not even a stub. Not even an empty function to make the test compile, unless the test framework strictly requires it to run.
3. If the test passes before any implementation is written, it is invalid. The test MUST exit non-zero (RED) on first run.
4. Credentials are never in your context.
5. Do not run the full test suite; run only this one test.

## Input

- The single requirement file you are implementing: `plan/current/requirements/{req-id}-{slug}.md`
- The stack capability skill (if available for the declared stack, load it alongside this skill)
- The domain glossary at `plan/current/domain-glossary.md`: use its terms in test descriptions and variable names

## What You Produce

The test file:
- Is placed in the appropriate test directory for the stack (e.g. `src/{component-id}/tests/`, `planifest-framework/tests/`)
- Is named after the requirement: `test-{req-id}-{slug}.{ext}`
- Has a test description that includes the requirement ID: e.g. `describe('req-001-tdd-subloop-protocol: ...')` or `# req-001`
- Tests exactly the behaviour described in the requirement's acceptance criteria, one criterion per test function: the test file is the unit per requirement

## Process

1. **Write** the test file to disk.
2. **Run** the test with whatever the declared stack test runner is.
3. **Confirm RED**: the test must exit non-zero. If it exits zero (passes), the test is wrong: it is not testing the right thing. Revise and re-run.
4. **Report** the RED confirmation:
   ```
   RED ✓  req-{id}: {test-file-path}
          Exit code: {n}
          Failure: {first failure line from test output}
   ```

## Regression Tagging

If this test covers core framework behaviour that should be protected long-term (not just for this feature), add a comment at the top of the test file:

```bash
# REGRESSION-CANDIDATE: covers {what behaviour}, tagged by test-writer for human review at P7
```

This is advisory. The ship-agent will present tagged tests to the human at Step 4 for promotion confirmation.

