Here is the commit message, ready to copy.

```
test(pi-prompts-chain): add static test suite and chain recipe docs

Add a deterministic, LLM-free test suite under .pi/agent/prompts/test/
that validates the c-*/p-* prompt chain system on disk:
  - chain-workflow.test.ts covers happy path, edge cases, error cases,
    cross-doc consistency, and directory sanity (100 assertions)
  - support/frontmatter.ts is a minimal YAML frontmatter parser
    tailored to the recipe format (key/value + block scalars, comment
    stripping, CRLF normalization)
  - fixtures/valid-prompt.md is a block-scalar fixture for the parser
  - package.json wires `npm test` to `node --test --experimental-strip-types`

The suite catches the realistic drift bugs the docs call out: a chain
recipe referencing a p-* that does not exist, a p-* missing
`subagent: true` / `fork: true`, and a Doc/ table row that does not
match the actual chain sequence. It runs in ~170 ms against the
on-disk tree only and requires no LLM or network.

Also add Doc/chain-commands.md and Doc/prompts.md describing the four
chain recipes and the prompt catalogue, and rewrite p-explain, p-plan,
and p-review to the structured frontmatter form so they can
participate in chains (p-plan and p-review gain subagent: true /
fork: true).

PR description:

## Summary

Add a static, deterministic test suite for the `.pi/agent/prompts/`
c-*/p-* prompt chain system, plus the Doc/ pages and the structured
prompt files the suite validates.

## Motivation

The chain recipes (`c-*.md`) reference `p-*.md` step prompts by name
in their `chain:` frontmatter, and those steps are required to declare
`subagent: true` and `fork: true` so the pi-subagents adapter can run
them as forked-context subagents. Until now there was no automated
check that:

  - every `chain:` step resolved to a real `p-*.md` file,
  - every `p-*.md` used in a chain had the required flags,
  - the Doc/ pages described the same chain sequences as the recipes.

Adding a new chain recipe, renaming a prompt, or rewriting a body
without updating the docs was an undetected footgun. The new suite
fails loudly when any of those drift apart.

## Changes

  - .pi/agent/prompts/test/chain-workflow.test.ts (new) — 100 tests
    in 11 suites, runs with `node --test --experimental-strip-types`
  - .pi/agent/prompts/test/support/frontmatter.ts (new) — minimal YAML
    frontmatter parser + `parseChain` splitter
  - .pi/agent/prompts/test/fixtures/valid-prompt.md (new) — block-scalar
    fixture for the parser self-tests
  - .pi/agent/prompts/test/package.json (new) — `npm test` wiring
  - .pi/agent/prompts/Doc/chain-commands.md (new) — chain reference
  - .pi/agent/prompts/Doc/prompts.md (new) — prompt catalogue
  - .pi/agent/prompts/{c-design-build,c-fix-commit,c-refactor-commit,
    c-security-loop}.md (new) — chain recipes
  - .pi/agent/prompts/{p-brainstorm,p-commit,p-debug,p-diagnose,p-doc,
    p-refactor,p-secaudit,p-summarize,p-test}.md (new)
  - .pi/agent/prompts/{p-explain,p-plan,p-review}.md (rewritten) —
    converted from ad-hoc body text to structured frontmatter prompts;
    p-plan and p-review gain subagent: true / fork: true

## Test plan

  - `cd .pi/agent/prompts/test && npm test` — runs the full suite
    (100/100 pass in ~170 ms)
  - The suite is independent, deterministic, and has no LLM or
    network dependency
  - Self-tests on the frontmatter parser (6) and chain parser (5)
    guard the test infrastructure itself

## Risks

  - The frontmatter parser is intentionally narrow (key/value +
    block scalars, no nested maps, no escapes). If a future recipe
    uses a YAML feature outside that subset the parser will silently
    return empty frontmatter and the suite will fail with a
    "missing description" / "chain is empty" assertion. Add a fixture
    and extend the parser before adopting richer YAML.
  - p-explain, p-plan, and p-review change from free-form bodies to
    structured templates. Anyone scripting against the old bodies
    (rare, since these are interactive) will see different output.
```

Notes on the proposal:
- **Type & scope**: `test(pi-prompts-chain)` — the dominant intent of the working tree is the test suite plus the chain system it covers. The chain recipes and docs are *infrastructure for what the test exercises*; the rewrites of `p-explain`/`p-plan`/`p-review` are required to make those prompts usable as chain steps (and thus to be valid targets of the cross-doc tests).
- **No split recommended**. Splitting the test from the recipes/docs would leave intermediate states where the suite fails on missing files. Splitting the rewrites of `p-explain`/`p-plan`/`p-review` from the new prompts would break the "every prompt used in a chain" assertion in the first commit. One logical commit is the only shape that keeps the tree green.
- **Footer**: no `BREAKING CHANGE` and no linked issue references in the diff. The change to `p-explain`/`p-plan`/`p-review` is a behavioral change to those prompts' output, but they are interactive, not script-facing, and the doc still documents them — so this is a *soft* behavior change, not a breaking API change.