Spec (grill → design doc)
Two phases in one skill: grill in chat, then write a spec file. Do not write glossary files, ADRs, or other markdown during the grill. The only file you create is the final design spec.
Phase 1 — Grill (chat only)
Interview relentlessly until you and the user share an understanding.
- Ask one question at a time. Wait for the answer. Never dump a questionnaire.
- Walk the design tree depth-first: resolve dependencies before downstream choices.
- For every question, offer a recommended answer (brief, opinionated).
- If a fact is in the codebase or wiki, look it up — do not ask. Decisions belong to the user; put each one to them and wait.
- Sharpen fuzzy language in chat: propose a canonical term when something is overloaded. Challenge contradictions with existing
wiki/glossary.mdterms or code. Keep vocabulary alignment in the conversation only — do not writeCONTEXT.mdor ADRs. - Do not write code or the spec file until the user confirms shared understanding (or explicitly says "write the spec").
Docs to read before / while grilling
Read these before inventing topology, trust boundaries, or domain names. Prefer wiki and patterns over stale WIP code.
| Priority | Active-project path | Use for |
|---|---|---|
| 1 | wiki/architecture/ |
Intended subsystem topology, *Api gateways, finalize/ledger/block flows |
| 2 | wiki/glossary.md |
Canonical domain terms |
| 3 | wiki/index.md |
Catalog of wiki pages |
| 4 | AGENTS.md Docs lookup |
Keyword → pattern / architecture routing |
| 5 | $patterns (references/patterns/) |
Generic code-shape patterns |
| 6 | llm-wiki/patterns/ |
Zerospin-specific patterns and case studies |
| 7 | llm-wiki.md |
How this repo's LLM wiki idea works (meta) |
| 8 | TODOS.md |
Target-vs-current naming / topology audit |
Also read the relevant source under packages/ / apps/ when the wiki is thin or the question is about current behavior.
Rule: docs describe intended topology; code may lag. Do not treat stale *Repo method names as the design target when architecture pages disagree.
Phase 2 — Spec (one file)
After the user confirms alignment:
Sketch the test seams for the change. Prefer existing seams; prefer the highest seam; aim for as few as possible (ideally one). Confirm seams with the user before writing the file.
Determine
PLAN_ROOTbefore writing.- Read root
AGENTS.mdand inspect the existing planning directories. - If repository guidance names a root, use it even when its directory does not exist yet.
- Otherwise use the one established root visible in the layout, such as
.plans/,wiki/plans/, orwiki/dev/. - Do not create a second planning tree alongside an established one.
- Ask the user only when guidance names no root and the layout is absent or ambiguous.
- Read root
Determine the new spec/plan pair's shared three-digit
XXXprefix before writing:- Inspect filenames recursively under
PLAN_ROOTfor names beginning with three digits. - Use one more than the highest prefix found anywhere under
PLAN_ROOT. - Ignore legacy filenames without a three-digit prefix when calculating the next number.
- Reuse this number if the spec is later turned into an implementation plan.
- Inspect filenames recursively under
Write one design spec:
PLAN_ROOT/specs/XXX-spec-<topic>.md
Use the allocated zero-padded prefix and a kebab-case topic. Number every list (no unordered - bullets in plan/spec docs).
Do not publish to an issue tracker. Do not create implementation plans under
PLAN_ROOT/plans/unless the user asks.When the user asks for an implementation plan from the spec:
- Read the completed spec as the source of truth.
- Create
PLAN_ROOT/plans/XXX-plan-<topic>.mdusing the spec's exactXXXand topic. - Do not allocate a second number for the implementation plan.
- Move the source spec to
PLAN_ROOT/archived/without changing its filename after the implementation plan exists.
Spec template
# <Topic> design
**Date:** YYYY-MM-DD
**Status:** Draft | Approved for planning
## Problem Statement
What is broken or missing, and why it matters, in this project's vocabulary.
## Solution
High-level shape of the fix — not implementation detail.
## User Stories
Numbered, extensive, independently checkable:
1. As a <actor>, I want <capability>, so that <benefit>
## Implementation Decisions
Settled choices from the grill (modules/interfaces at a conceptual level, contracts, schema/API shape, trade-offs). Prefer project glossary terms.
Do not include brittle file paths or large code dumps. Exception: a short prototype snippet that encodes a decision more precisely than prose (state machine, schema, type shape) — trim to the decision-rich bits.
## Testing Decisions
1. What "done" looks like at the chosen seams
2. Which modules/behaviors are tested
3. Prior art (similar specs/tests in the repo)
## Out of Scope
What this change deliberately does not cover.
## Further Notes
Anything else worth carrying forward (open questions only if the user deferred them).
Done when
- Grill asked one question at a time and waited.
- Codebase/wiki answered factual questions without bothering the user.
- User confirmed shared understanding.
- Seams were checked with the user.
- Exactly one new file exists at
PLAN_ROOT/specs/XXX-spec-<topic>.mdwith numbered lists and project vocabulary, or at the same-named archived path after its same-numbered implementation plan is written.
Anti-patterns
- Writing
CONTEXT.md,docs/adr/, or any mid-grill markdown. - Re-interviewing during Phase 2 — synthesize what was already decided.
- Inferring architecture from WIP repo glue when
wiki/architecture/says otherwise. - Dumping a questionnaire or writing the spec before the user confirms.
- Creating
PLAN_ROOT/plans/*or tickets unless asked. - Giving a derived implementation plan a different numeric prefix or topic from its source spec.