Explore / Build the product / AI coding

AI coding · How Founders Use AI

How do I write a spec or PRD that an AI coding agent like Claude Code can build from?

Checked 17 November 2026

Write a short spec the agent can check its work against, not a long PRD: the outcome, what done looks like as testable checks, the must-haves, what is out of scope, and the stack. If you are unsure, ask Claude Code to interview you until it can write SPEC.md, then build from it in a fresh session.

On the AI map, 29 October 2026 Coding agentsApp builders

By case

  • If you build with Claude Code

    Use the interview, SPEC.md and fresh-session flow above.

    It is Anthropic's own advice for work you have not fully thought through.

    Claude Code: Included in paid Claude plans: Pro $17 a month billed yearly ($20 monthly), Max $100, Ultra $200 a month; Team $20 a seat a month billed yearly, read from claude.com on 10 November 2026

  • If you want a fixed flow from spec to plan to tasks

    Use GitHub's Spec Kit: a constitution once per project, then specify, plan, tasks and implement for each feature.

    It is free, open source and works with several coding agents.

    Spec Kit: Free and open source under the MIT licence, read from github.com on 10 November 2026

  • If you use Kiro

    Use its specs, which write requirements.md, design.md and tasks.md.

    The three files keep the requirements, the design and the task list apart and reviewable.

  • If you build in an app builder such as Lovable

    Follow its prompting guide and describe one feature at a time.

    Smaller, specific prompts give the builder less to guess.

    Lovable: Free; Pro from $25 a month for 100 credits ($21 a month billed yearly); Business from $50 a month ($42 billed yearly); Enterprise on request; prices in USD, read from docs.lovable.dev on 10 November 2026

The steps7 steps

  1. State the outcome: who uses it, the job it does, and what done looks like as checks you can test.

  2. List the must-haves, what it must not change or touch, and what is out of scope for now.

    The official page on addyosmani.com

  3. Name the stack, the data it stores and the screens or commands, briefly.

  4. If you are unsure, ask Claude Code to interview you until it could write the spec, and have it write SPEC.md.

    The official page on code.claude.com

  5. Start a fresh session to build from SPEC.md, so it begins with a clean context and a written definition of done.

    The official page on code.claude.com

  6. Have it split the spec into small tasks, do one at a time, and review each against SPEC.md.

  7. Keep standing project rules, such as build and test commands and conventions, in CLAUDE.md or AGENTS.md, not in the spec.

    The official page on code.claude.com

What goes wrong

  • Writing a long PRD of goals and personas with no checks the agent can run to know it is done.

  • Leaving out what is out of scope, so the agent adds features nobody asked for.

  • Building in the same long session where you brainstormed, so old ideas leak into the build.

  • Putting project-wide rules in each spec, where they drift apart, instead of in CLAUDE.md or AGENTS.md.

Go deeper7 sources

  • Best practices for Claude Code

    Anthropic · Guide · 2026

    The primary source for the interview-me-into-SPEC.md method: brainstorm the spec with Claude, build in a fresh session, then review the diff against the spec.

  • How to write a good spec for AI agents

    Addy Osmani · Article · Jan 2026

    A Google engineering lead's five principles: start from a short brief, let the agent draft the detail, plan in read-only mode and split big tasks.

  • Spec Kit

    GitHub · Tool · 2026

    GitHub's open-source toolkit for spec-driven development: a constitution, then specify, plan and tasks commands you run inside your coding agent.

  • Specs (Kiro docs)

    Kiro (AWS) · Guide · 2026

    Shows the three files a working spec splits into: requirements with acceptance criteria, a design doc, and a task list you track.

  • AGENTS.md

    AGENTS.md · Guide · 2026

    The open format for a README written for coding agents: setup and test commands and code style, read by Codex, Copilot and others.

  • Store instructions and memories (CLAUDE.md)

    Anthropic · Guide · 2026

    Where standing project rules go in Claude Code, and how /init drafts the file for you.

  • Prompting best practices

    Lovable · Guide · 2026

    For app-builder users: make Lovable ask clarifying questions, plan before you prompt and build component by component.