Where the rules go
Each file starts with your project’s name, stack and where the specs are, then the six sections below, in this order.
Critical mandates
Your agent must never break these.Process mandates
How your agent keeps the specs current while it works.
The tasks rule in full:
When the SpecPilot MCP tools are connected, use them to add and move tasks. Otherwise edit.specs/planning/tasks.mddirectly and keep its table format:| ID | Type | Priority | Description |under## Backlog,## Current Sprintand## Review(Typefeat,bugorchore, PriorityP1,P2orP3, either may be empty; a table there that is| ID | Description |keeps that shape),| # | ID | Description |under## Completed, one row per task. Finished work goes from Current Sprint to Review, never straight to Completed; a Review row gets its Completed entry (number, CD ID, commit) only once it ends withApproved <date>.
Which spec to read
Your agent reads only what the task needs, so a session doesn’t start by loading every spec. The file calls this “Context: read on demand by task type”.Code philosophy
The order your agent works through before it writes code:- Need exist? No → skip. Say why.
- Already in codebase? → reuse. Not rewrite.
- Stdlib do it? → use it.
- Native or installed dep cover it? → use. No new deps.
- One line do it? → write that.
- Only then: minimum code that work.
- Never cut: validation, error handling, security, explicit requirement.
Code rules
- No abstraction, interface, factory, or pattern unless asked.
- No scaffold “for later”. Later scaffold itself.
- Delete before add.
- Shortest correct diff win.
- Fix cause, not symptom. One guard in shared function beat guard in every caller.
- Boring over clever. Clever = 3am bug.
- Read before write. Never reference code you haven’t read.
Re-anchor
If your agent loses context mid-session, it reads.specs/project/project.yaml to restore it. A ready-made prompt is in prompts.md under Re-Anchor Prompt, and /specpilot-reanchor runs it. See Slash commands.
Changing the rules
The file is yours: add your own rules or a section for your repo. SpecPilot never overwrites an instruction file that exists. After an upgrade,specpilot backfill or /specpilot-backfill adds a section or mandate that’s missing and leaves the rest as it is.
Checked against SpecPilot 2.22.0.