StoicBuilder

HandbookVII the BasilicaWriting a feature spec

VIIthe Basilica, Build the right thing

Writing a feature spec

1 min readUpdated 28 November

In plain words

A feature spec is a one-page document that gathers the problem, user stories, acceptance criteria, rules and non-goals for one feature, so your agent builds from one source.

Where you see it

A markdown file such as docs/specs/share-links.md in your project, or a Notion page you paste into the chat. Claude Code, Cursor and Codex read a spec file when you point at it, and it outlives the chat, so the next session starts from the same page.

docs/specs/share-links.mdconfig
# Share linksProblem: people paste screenshots of notes into email.Stories: owner creates a read-only link; owner switches it off.Criteria: a logged-out visitor sees the note, no Edit button.Rules: only the owner can share; links can't be guessed.Non-goals: editing by others, comments, expiry dates.Open: do shared notes show the author's name?
Short enough to read in a minute. Answer the Open line before building starts.

What goes wrong

  1. A spec that falls behind

    You change your mind in chat, the spec still says the old thing, and the next session follows the spec. When a decision changes, change the page.

  2. Ten pages where one would do

    A long spec buries the lines that matter, and the agent may fix on the wrong paragraph. Keep it to a page, with headings it can quote.

  3. Specifying the code instead of the behaviour

    "Add a shares table with a random-ID column" makes choices the agent may handle better. Describe what users can do and what must be true, and ask the agent to propose the how.

What to tell your agent

Copy this into Lovable, Bolt, Cursor or any agent
Read this feature spec before writing any code. List anything in it that's unclear or contradictory, propose a plan for each story in order, and treat the non-goals as off limits.

Quick check

Sign in to earn +10 XP for it

Halfway through building, you decide share links should expire after 30 days. Where does that decision go?

Got a prompt that touches writing a feature spec?

Paste it. You get a better prompt first, then the cards that explain it.

Check your own prompt

Free, no sign-up.