| name | spec |
| triggers | ["spec","specs","draft spec","design doc","design document","write a spec","new spec","start spec","finish spec"] |
| description | Manage specs for spec-driven development. Specs live in the user's notes_folder under Specs/ with three lifecycle subfolders โ Drafts, Active, Done. |
| companion_skills | ["files","notes"] |
Spec lifecycle
Specs are markdown files that capture the plan for a feature or change before it is implemented. They live in the user's notes_folder, separate from regular notes, so the same process applies to every project.
What a spec must be
A spec is a detailed, thorough implementation document โ written so a coding agent can pick it up cold and ship the work without further supervision. Treat the reader as a competent engineer who has not been part of the discussion: every decision they would otherwise have to ask about should already be answered in the document.
Concretely, a good spec:
- States the problem and the constraints, not just the solution.
- Names the files, modules, functions, data structures, and interfaces involved โ with paths where they exist.
- Specifies behaviour for the happy path, edge cases, and error handling. No "handle errors appropriately" hand-waving.
- Calls out data-model changes (schemas, migrations, indexes) and config / env-var changes explicitly.
- Defines the test strategy: what tests to write, what they assert, what fixtures or mocks are needed.
- Breaks the work into ordered stages or phases, each independently completable and verifiable.
- Records decisions and the alternatives rejected, so the implementer doesn't relitigate them.
- Lists open questions explicitly โ anything left unanswered is a blocker the implementer will have to escalate, so flag it before handoff rather than burying it.
If a draft is too thin to hand off blind, it isn't ready to leave Drafts/. When drafting, push back on under-specified requests rather than producing a stub.
Layout
Default location is {notes_folder}/Specs/:
{notes_folder}/Specs/
โโโ Drafts/ # written but not yet being implemented
โโโ Active/ # implementation in progress, or partially complete
โโโ Done/ # every stage/phase fully implemented
A spec moves through these folders left-to-right. It never skips a state and rarely moves backwards (only if work is abandoned mid-flight, in which case it goes back to Drafts/).
Project specs
{notes_folder}/Specs/ is for cross-project / personal specs only. When a request explicitly names a project โ e.g., "draft a spec for the Acme retry logic" or "list Acme specs" โ the spec lives in that project's own folder, not under {notes_folder}/Specs/.
Where each project lives is deployment-specific โ the skill does not assume a layout. Resolve the project folder for the named project in this order, stopping at the first hit:
- A path the user gives in the request itself ("the spec for Acme โ its folder is
~/work/acme").
- Channel memory (
CHANNEL.md) โ channel-scoped projects often record their working directory there.
- A configured resource for that project (a
folder resource whose display_name matches, etc.).
- User memory (
USER.md) โ long-running projects usually have their root path noted there, sometimes alongside a convention like "all my projects live under <some-root>/Projects/<name>/". Honour whatever convention USER.md states.
If none of those resolve, ask the user where the project's folder is. Do not invent a path or fall back to {notes_folder}/Specs/<Project>/ โ that path is reserved for the bot's own notes.
Once the project folder is resolved, the layout is:
<project-folder>/Specs/{Drafts,Active,Done}/
Create the Specs/{Drafts,Active,Done} subfolders inside the project folder on first use without asking โ the convention is fixed.
If a request is ambiguous about whether a project is meant, default to {notes_folder}/Specs/ and ask only if the user pushes back.
Operations
The skill is invoked through natural language, not as a CLI. Recognise these intents and use the files skill for filesystem operations.
Draft a new spec
-
Ask the user for a title if not given.
-
Slugify to lowercase-with-dashes.md.
-
Refuse to overwrite if a file with the same slug exists in Drafts/, Active/, or Done/ (within the resolved project scope). Suggest a numeric suffix.
-
Write Drafts/<slug>.md with this skeleton (soft-wrapped, no hard line breaks within paragraphs):
---
created: <YYYY-MM-DD>
---
# <Title>
## Context
<why this exists, what problem it solves, links to related specs or issues>
## Goals
<what success looks like, in concrete terms>
## Non-goals
<what is explicitly out of scope>
## Design
<approach, data model, interfaces, key decisions, alternatives considered>
## Stages
- [ ] Stage 1 โ <name>
- [ ] Stage 2 โ <name>
## Open questions
<things to resolve before or during implementation>
-
Confirm with the spec's path.
Start implementing (Drafts โ Active)
- Find a unique match in
Drafts/ for the slug or fragment the user gave (case-insensitive substring on the filename).
- If zero or multiple matches, list candidates and stop.
- Move
Drafts/<file> โ Active/<file>.
- Confirm the move with the new path.
Mark done (Active โ Done)
- Resolve a unique match in
Active/.
- Read the file and check the
## Stages (or equivalent) checklist:
- If any unchecked items (
- [ ]) remain, refuse the move and list the open items. The user must either complete them, edit the spec, or explicitly override (e.g., "force it" / "move it anyway").
- Move
Active/<file> โ Done/<file>.
- Confirm the move.
List
Print three sections (Drafts, Active, Done) with the filenames under each, scoped to the resolved project (or the flat tree by default). If a section is empty, write _none_. Sort filenames alphabetically. Do not read file contents.
Show
Resolve a unique match across all three folders (search Active first, then Drafts, then Done). Print the path and the file contents.
Edit
When the user asks to edit, extend, or revise a spec, edit it in place โ do not move it between folders as a side effect of editing. State transitions are explicit.
Conventions
- Filenames:
lowercase-with-dashes.md. No dates in filenames (the filesystem mtime is enough).
- Soft-wrap prose; no hard line wrapping inside paragraphs.
- Stages tracked as a checklist (
- [ ] / - [x]) so the "done" gate can verify completion.
- Frontmatter: include at least a
created date. Add an agents: field only if the spec has non-obvious read/write quirks (per the notes skill convention).
- Specs are not committed to project repos โ they live in the user's notes_folder.
Output
Be terse. After any state-changing operation, print one line: <verb> <slug>: <old-path> โ <new-path>. After listing, print the section summary and nothing else. After drafting, print the absolute path of the created file.