Skip to content
Skillpedia
Documentation107k · #362

spec-driven-development

Has your agent create specifications before writing code. It's useful for organizing projects, defining scopes, and clarifying ideas before development.

What it does

This tool helps create a detailed plan (specification) before you start writing code. It ensures everyone understands what will be built, why, and how to know when it's done.

When to use it

  • ✓When starting a new project or feature.
  • ✓When ideas about what to build are unclear.
  • ✓Before making important decisions about the project's structure.

Example of what to ask your AI

“I need a plan to create a login system for a website.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/addyosmani/agent-skills/blob/main/skills/spec-driven-development/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/addyosmani/agent-skills/blob/main/skills/spec-driven-development/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

The tool guides you to define the objective, necessary commands, folder structure, code style, how to test, and what to do or not do. It works in stages with human reviews at each step.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add addyosmani/agent-skills --skill spec-driven-development

Or download just the file:

curl -L https://raw.githubusercontent.com/addyosmani/agent-skills/main/skills/spec-driven-development/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Spec-Driven Development

Overview

Write a structured specification before writing any code. The spec is the shared source of truth between you and the human engineer — it defines what we're building, why, and how we'll know it's done. Code without a spec is guessing.

When to Use

  • Starting a new project or feature
  • Requirements are ambiguous or incomplete
  • The change touches multiple files or modules
  • You're about to make an architectural decision
  • The task would take more than 30 minutes to implement

When NOT to use: Single-line fixes, typo corrections, or changes where requirements are unambiguous and self-contained.

The Gated Workflow

Spec-driven development has four phases, preceded by a scope check (Phase 0) that activates only when one request bundles several independently testable capabilities. Do not advance to the next phase until the current one is validated.

SPECIFY ──→ PLAN ──→ TASKS ──→ IMPLEMENT
   │          │        │          │
   ▼          ▼        ▼          ▼
 Human      Human    Human      Human
 reviews    reviews  reviews    reviews

Phase 0: Scope Check

Most requests describe one capability. If this one does, skip this phase and go straight to Specify — Phase 0 exists for the exception, not the rule, and it puts no hierarchy on single-capability features.

Detection. Decompose before specifying when a single requirement bundles several independently testable capabilities:

  • The requirement names distinct capabilities with their own consumers or data (e.g. identity, billing, notifications, reporting)
  • Acceptance criteria cluster into groups that could ship and be verified separately
  • One capability could be cut or replaced without rewriting the others' requirements

Propose a capability map before writing any spec. Small and reviewable — a module table plus a build order, not a project plan:

# Capability Map: [Initiative Name]

| Module id | Responsibility | Depends on |
|---|---|---|
| identity | Accounts, sessions, SSO | — |
| billing | Plans, invoices, payments | identity |
| notifications | Email and webhook fan-out | identity |
| reporting | Usage dashboards | billing, notifications |

Build order: identity → billing, notifications → reporting
  • Stable module ids. Kebab-case, chosen once, never renamed mid-initiative. Specs, plans, and downstream commands select work by these ids instead of guessing which spec is active.
  • Dependency direction, no cycles. Arrows point one way. If two modules each need the other, they are one module.
  • Interfaces live at the boundary. The map records that billing depends on identity; the contract between them belongs in the provider module's spec (see api-and-interface-design for designing it).

The map is gated like every phase. The human reviews module boundaries, dependency direction, and build order before any module spec is written. Getting the map wrong is expensive; reviewing ten lines is not.

Then recurse per module. Run Specify → Plan → Tasks → Implement for each module in dependency order. Each module gets its own spec, scoped to that module's objective, boundaries, and success criteria. Save the approved map at the project root and each module's spec alongside it, named by module id (SPEC-identity.md, SPEC-billing.md) — the map, not filename guessing, is the index of what exists.

Phase 1: Specify

Start with a high-level vision. Ask the human clarifying questions until requirements are concrete.

Surface assumptions immediately. Before writing any spec content, list what you're assuming:

ASSUMPTIONS I'M MAKING:
1. This is a web application (not native mobile)
2. Authentication uses session-based cookies (not JWT)
3. The database is PostgreSQL (based on existing Prisma schema)
4. We're targeting modern browsers only (no IE11)
→ Correct me now or I'll proceed with these.

Don't silently fill in ambiguous requirements. The spec's entire purpose is to surface misunderstandings before code gets written — assumptions are the most dangerous form of misunderstanding.

Write a spec document covering these six core areas:

  1. Objective — What are we building and why? Who is the user? What does success look like?

  2. Commands — Full executable commands with flags, not just tool names.

    Build: npm run build
    Test: npm test -- --coverage
    Lint: npm run lint --fix
    Dev: npm run dev
    

…

FAQ

When should I NOT use this tool?

Don't use it for quick fixes, like correcting a typo, or when requirements are very simple and obvious.

What is a 'capability map'?

It's a diagram showing the different parts of a larger project and how they connect, useful when a single task involves multiple independent parts.

Why is it important to state 'assumptions'?

Stating what you're assuming (e.g., database type, browser) helps prevent future misunderstandings, as it allows others to correct you before coding begins.

Details

Original description by the author

Creates specs before coding. Use when starting a new project, feature, or significant change and no specification exists yet. Use when drafting a PRD or requirements document with objectives and scope, or when requirements are unclear, ambiguous, or only exist as a vague idea. Use when a single requirement spans several independently testable capabilities and needs decomposing into a capability ma

repo: addyosmani/agent-skills

Popularity

GitHub stars
107k
Ranking position
#362
License
MIT
Updated
10/13/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills