Skip to main content
SpecPilot writes the same rules into the instruction file of each AI IDE you set up. Your agent reads that file at the start of every session, so these rules apply to everything it does in the project.

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.md directly and keep its table format: | ID | Type | Priority | Description | under ## Backlog, ## Current Sprint and ## Review (Type feat, bug or chore, Priority P1, P2 or P3, 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 with Approved <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:
  1. Need exist? No → skip. Say why.
  2. Already in codebase? → reuse. Not rewrite.
  3. Stdlib do it? → use it.
  4. Native or installed dep cover it? → use. No new deps.
  5. One line do it? → write that.
  6. Only then: minimum code that work.
  7. Never cut: validation, error handling, security, explicit requirement.
Step 7 is the floor: your agent never trims those to make a diff shorter.

Code rules

  1. No abstraction, interface, factory, or pattern unless asked.
  2. No scaffold “for later”. Later scaffold itself.
  3. Delete before add.
  4. Shortest correct diff win.
  5. Fix cause, not symptom. One guard in shared function beat guard in every caller.
  6. Boring over clever. Clever = 3am bug.
  7. 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.