---
description: Build the feature from spec.md. Tests from each rule's example first, copy the Like file, finish only when the Done-when command exits 0.
scripts:
  sh: scripts/bash/check-prerequisites.sh --json --paths-only
  ps: scripts/powershell/check-prerequisites.ps1 -Json -PathsOnly
  py: scripts/python/check_prerequisites.py --json --paths-only
---

## User Input

```text
$ARGUMENTS
```

## Outline

1. Run `{SCRIPT}` once from the repo root. Read `FEATURE_DIR` and
   `FEATURE_SPEC` from the JSON.

2. Read `.specify/memory/constitution.md`, then `FEATURE_SPEC`, then the file
   on the **Like** line. If `plan.md` or `tasks.md` exist in `FEATURE_DIR`,
   read them too: work through `tasks.md` in order and mark each task `[X]`
   when it's done.

3. If the spec still has a `[NEEDS CLARIFICATION]` marker, or Done when has no
   command, STOP and list what's missing. Don't guess.

4. For each rule, write a test from its example first, named after the rule id
   (`FR-001`). Run it and confirm it fails for the reason you expect. A rule
   about existing behaviour that must keep working is the exception: its test
   passes before and after your change.

5. Implement until those tests pass. Copy the Like file's structure, error
   handling, naming and helpers. Reuse what exists before writing anything new.

6. Respect Out of scope. Build nothing under "Don't build" and change nothing
   under "Don't touch". If the clean implementation needs either, or needs a
   rule to change, STOP and ask.

7. Run the Done-when command exactly as written. You're finished only when it
   exits 0. Never edit the command, skip a test or weaken an assertion to get
   there.

## Report

- The Done-when command and the last lines of its output.
- Every changed file, with the rule id it serves.
- Any change that serves no rule, and why. Remove it if there's no reason.
