Produce a spec from the current conversation and codebase understanding.
Synthesize what you already know — the interview, if any, already happened (/grilling).
Process
Explore the repo to understand the current state of the codebase, if you haven't already. Use the project's domain vocabulary throughout the spec.
Read the repo's decision memory: the
AGENTS.mdconventions already in context, plus the records bearing on this feature from whichever knowledge stores the loop config enables — ADRs for decisions already made, solutions for gotchas and approaches that failed before. The loop config translates the storage verbs: it isdocs/agents/cantrips-loop.md, and when that doc is absent the plugin defaults (defaults.md) govern. Fold whatever applies into the spec's decisions. When this feature's decisions conflict with a standing ADR — one whose status isaccepted— flag the conflict explicitly in the spec — name the ADR and the revised decision — and note that the revision routes through/compoundat loop end;/compoundis the ADR store's sole writer, so the standing record stays as written until then.Propose the test seams — the places
/implementwill drive TDD (seam vocabulary:/codebase-design). Prefer existing seams to new ones; place any new seam at the highest point you can. The fewer seams across the codebase, the better - the ideal number is one.
Check with the user that these seams match their expectations.
- Publish the spec — the publish-spec verb, translated by the loop config from step 2 — using the template below. The published body is frozen: a spec is a point-in-time decision record, and execution state lives in git and the backend, so work-status lines (pending, in-progress, done) never enter the body. Afterthoughts arrive as dated annotations through the annotate-spec verb.
Problem Statement
The problem that the user is facing, from the user's perspective.
Solution
The solution to the problem, from the user's perspective.
User Stories
A LONG, numbered list of user stories. Each user story should be in the format of:
- As an , I want a , so that
This list of user stories should be extremely extensive and cover all aspects of the feature.
Implementation Decisions
A list of implementation decisions that were made. This can include:
- The modules that will be built/modified
- The interfaces of those modules that will be modified
- Technical clarifications from the developer
- Architectural decisions
- Schema changes
- API contracts
- Specific interactions
Do NOT include specific file paths or code snippets. They may end up being outdated very quickly.
Exception: if a prototype produced a snippet that encodes a decision more precisely than prose can (state machine, reducer, schema, type shape), inline it within the relevant decision and note briefly that it came from a prototype. Trim to the decision-rich parts — not a working demo, just the important bits.
Test Seams
The seams the user approved in step 3 — where TDD will bite during implementation. For each seam: the interface under test, what behavior the tests will verify through it, and prior art (similar tests in the codebase).
Out of Scope
A description of the things that are out of scope for this spec.
Further Notes
Any further notes about the feature.
Spec published → close with a flow pointer (read flow-pointers.md for the format): /tickets (user-invoked) if the work spans multiple sessions or context windows, else /implement (user-invoked) — in a fresh context either way.