# Spec-Driven Development with GitHub Spec Kit: The Complete Guide

*Plain English, start to finish. Checked against the official Spec Kit docs in November 2026.*

---

## Table of Contents

1. [The big idea, in one minute](#1-the-big-idea-in-one-minute)
2. [Why "vibe coding" breaks, and how specs fix it](#2-why-vibe-coding-breaks-and-how-specs-fix-it)
3. [The mental model: What → How → Steps → Code → Check](#3-the-mental-model)
4. [The full workflow at a glance](#4-the-full-workflow-at-a-glance)
5. [Installing Spec Kit](#5-installing-spec-kit)
6. [Adding Spec Kit to a project (new or existing)](#6-adding-spec-kit-to-a-project)
7. [What all those new folders are](#7-what-all-those-new-folders-are)
8. [How Spec Kit handles many features](#8-how-spec-kit-handles-many-features)
9. [Step 1: `constitution`, the permanent rules](#9-step-1--constitution)
10. [Step 2: `specify`, the WHAT](#10-step-2--specify)
11. [Step 3: `clarify`, filling the gaps](#11-step-3--clarify-optional-but-recommended)
12. [Step 4: `plan`, the HOW](#12-step-4--plan)
13. [Step 5: `checklist`, unit tests for your requirements](#13-step-5--checklist-optional)
14. [Step 6: `tasks`, the step-by-step to-do list](#14-step-6--tasks)
15. [Step 7: `analyze`, checking everything is consistent](#15-step-7--analyze-optional-but-recommended)
16. [Step 8: `implement`, writing the code](#16-step-8--implement)
17. [Step 9: `converge`, did we build what we planned?](#17-step-9--converge)
18. [The feedback loops (where the real power is)](#18-the-feedback-loops)
19. [Command names differ per AI agent](#19-command-names-differ-per-ai-agent)
20. [Best practices and common mistakes](#20-best-practices-and-common-mistakes)
21. [One-page cheat sheet](#21-one-page-cheat-sheet)
22. [Sources](#22-sources)

---

## 1. The big idea, in one minute

**Spec-Driven Development (SDD)** means: *before the AI writes any code, you write down clearly what you want and how you want it built.*

You don't type "build me a registration page" and hope for the best. You and the AI produce a small set of documents first:

| Document | Answers the question | Analogy (building a house) |
|---|---|---|
| **Constitution** | "What rules must we always follow?" | Building codes and regulations |
| **Spec** (`spec.md`) | "What should this feature do, and why?" | The client's wish list |
| **Plan** (`plan.md`) | "How will we build it technically?" | The architect's blueprint |
| **Tasks** (`tasks.md`) | "What exact steps, in what order?" | The construction schedule |
| **Code** | The actual thing | The house |

Once these documents exist, the AI has much more context, so it guesses less and gets it right more often.

> **Key shift:** In traditional development the *code* is the source of truth and docs go stale. In SDD the *spec* is the source of truth and code is generated from it. If the spec changes, you regenerate the plan, tasks and code.

**GitHub Spec Kit** is a free, open-source toolkit from GitHub that turns this idea into a repeatable process. It gives you:
- a small command-line tool called **`specify`** that sets Spec Kit up in your project, and
- a set of **slash commands** (`/speckit-specify`, `/speckit-plan`, and so on) that you run *inside your AI coding agent's chat* (Copilot, Claude Code, Cursor, Gemini CLI, Codex, Kiro CLI and many more).

Spec Kit itself costs nothing. You only pay for the AI agent you use with it.

---

## 2. Why "vibe coding" breaks, and how specs fix it

"Vibe coding" means describing something loosely and letting the AI improvise. It works for tiny demos, but falls apart on real projects because:

1. **The AI fills gaps with guesses.** You said "users can register". Is email case-sensitive? What's the minimum password length? What happens on a duplicate email? The AI decides silently, and its choices may not be yours.
2. **No memory of your standards.** Every new chat forgets that your team uses Java 21, Maven, layered architecture and JUnit 5.
3. **There's nothing to check against.** When the AI says "done", you have no list of what "done" was supposed to mean.
4. **Big asks produce big messes.** "Build the whole app" produces thousands of lines nobody reviewed.

How Spec Kit fixes each one:

| Problem | Spec Kit's fix |
|---|---|
| AI guesses | `clarify` asks you the questions *before* code exists |
| Forgets standards | The `constitution` is read automatically by every command |
| Nothing to check against | `analyze` (before coding) and `converge` (after coding) check the work against the spec |
| Too big | One feature at a time, broken into small numbered tasks |

---

## 3. The mental model

Remember this one line:

```
RULES  →  WHAT  →  (clarify)  →  HOW  →  (checklist)  →  STEPS  →  (analyze)  →  CODE  →  CHECK
constitution  specify            plan                    tasks                 implement  converge
```

- The bold ones (constitution, specify, plan, tasks, implement, converge) are the **main road**.
- The ones in brackets (clarify, checklist, analyze) are **optional quality gates**, like a quick inspection before moving on.
- The only strict requirement is that you `specify` before you `plan`. Everything else is good practice.

**The most important rule in this whole guide:**
> **`specify` = WHAT and WHY. No technology.**
> **`plan` = HOW. All the technology goes here.**

If you mention "Spring Boot controller" or "PostgreSQL table" in your spec, you're mixing the two. Keep them apart. That way you can change your tech stack later without rewriting your requirements.

---

## 4. The full workflow at a glance

| # | Command | Run how often | Optional? | Reads | Writes | Changes files? |
|---|---|---|---|---|---|---|
| 1 | `constitution` | Once per project (update rarely) | No (strongly recommended) | Your prompt + current constitution | `.specify/memory/constitution.md` | Yes |
| 2 | `specify` | Once per feature | **No** | Constitution + your feature description | `specs/NNN-name/spec.md`, `checklists/requirements.md`, `.specify/feature.json` | Yes |
| 3 | `clarify` | 0+ times per feature | Yes | `spec.md` | Updates `spec.md` (Clarifications section) | Yes |
| 4 | `plan` | Once per feature | No | Constitution + spec + your tech prompt | `plan.md`, plus maybe `research.md`, `data-model.md`, `contracts/`, `quickstart.md` | Yes |
| 5 | `checklist` | 0+ times | Yes | Spec (+ plan/tasks if they exist) | `checklists/<topic>.md` | Yes (checklist only) |
| 6 | `tasks` | Once per feature (regenerate if needed) | No | Plan + spec + supporting files | `tasks.md` | Yes |
| 7 | `analyze` | 0+ times | Yes | Spec + plan + tasks + constitution | Nothing, it prints a report | **No, read-only** |
| 8 | `implement` | 1+ times | No | `tasks.md` + everything else | **Source code**, ticks off tasks | Yes |
| 9 | `converge` | After each implement | Recommended | Code + spec + plan + tasks | Only *appends* tasks to `tasks.md` (or nothing) | Only appends tasks |

---

## 5. Installing Spec Kit

### 5.1 Prerequisites
- **Python 3.11+**
- **uv**, a fast Python package manager (recommended)
- **Git** (optional, but needed for the git extension that makes feature branches)
- **An AI coding agent** (GitHub Copilot in VS Code, Claude Code, Cursor, Gemini CLI, and so on)

### 5.2 Install `uv`
On a Mac with Homebrew:
```bash
brew install uv
```
Or use the standalone installer from the uv website (macOS/Linux use a `curl` script, Windows uses a PowerShell script). Check it worked:
```bash
uv --version
```

### 5.3 Install the `specify` CLI
The package is named **`specify-cli`**. The command it installs is **`specify`**.

From PyPI (simplest):
```bash
uv tool install specify-cli
```

Or pinned to an exact release straight from GitHub (replace `vX.Y.Z` with a real tag from the Releases page; keep the leading `v`):
```bash
uv tool install specify-cli --from git+https://github.com/github/spec-kit.git@vX.Y.Z
```

Other options: `pipx install specify-cli` or `pip install specify-cli`.

### 5.4 Check and upgrade
```bash
specify version      # is it installed, which version?
specify self check   # is there a newer release? (read-only)
uv tool install --force specify-cli   # upgrade
```

> Spec Kit changes fast (new commands like `converge` arrived in late 2026). Run `specify self check` now and then.

---

## 6. Adding Spec Kit to a project

### 6.1 A brand-new project
```bash
cd ~/Documents/spec-driven-development
specify init users-microservice
```
This creates a new folder called `users-microservice`. It will ask you:
1. **Which AI agent?** (Copilot, Claude, Gemini, Cursor, Codex, ...). Use the arrow keys and press Enter.
2. **Which script type?** `sh` (Mac/Linux), `ps` (PowerShell, Windows), or `py` (Python).

You can skip the questions by passing flags:
```bash
specify init users-microservice --integration copilot --script sh
```

Then:
```bash
cd users-microservice
ls -a        # the folders start with "." so they are hidden without -a
```

### 6.2 An existing project (brownfield)
Go into your project folder and initialize *here*:
```bash
cd users-app
specify init --here
```
(Many tutorials, including your course, use `specify init .`, which does the same thing.)

It warns: *"Current directory is not empty… files may be merged/overwritten. Continue?"* Type `y`.
**Commit your work to Git first** so you can undo anything unexpected.

Useful flags:
- `--force` skips the "not empty" confirmation
- `--non-interactive` means no prompts at all (for CI or scripts)
- `--integration claude` (or another agent) picks the agent up front

### 6.3 Switching or adding AI agents later
```bash
specify integration list             # what's available
specify integration install claude   # add another agent
specify integration use claude       # make it the default
specify integration switch cursor    # replace the default with another
specify integration status           # what's installed
```

### 6.4 Extensions (optional add-ons)
Spec Kit's core stays small, and extras come as extensions. Your course installs the **Git extension**, which automatically creates and switches to a Git branch for each feature:
```bash
specify extension add git
specify extension list
```
(The official docs also mention bundled extensions such as `bug` and `assess`, plus `specify extension search` to discover more.)

---

## 7. What all those new folders are

After `init` you get roughly this (exact contents depend on version and agent):

```
your-project/
├── .specify/                  ← Spec Kit's "engine room" (you rarely edit by hand)
│   ├── memory/
│   │   └── constitution.md    ← ⭐ your permanent project rules
│   ├── scripts/               ← helper scripts (bash / powershell / python)
│   ├── templates/             ← blank templates for spec, plan, tasks, checklist
│   ├── integrations/          ← manifest files for each AI agent you enabled
│   ├── workflows/             ← definitions of the step sequence
│   ├── integration.json       ← which agent(s) are installed / default
│   └── feature.json           ← ⭐ which feature is "active" right now
│
├── .github/                   ← (if Copilot) agent + prompt files for the slash commands
│   ├── agents/                ←   "specialists" that know how to do one step
│   └── prompts/               ←   the reusable prompts those specialists use
│   (Claude Code puts its files in .claude/, Cursor in .cursor/, and so on)
│
└── specs/                     ← created when you run your first /specify
    └── 001-user-registration/
        ├── spec.md
        ├── checklists/requirements.md
        ├── plan.md
        ├── research.md         (sometimes)
        ├── data-model.md       (sometimes)
        ├── contracts/          (sometimes, e.g. API definitions)
        ├── quickstart.md       (sometimes)
        └── tasks.md
```

What each one is for, in plain terms:

- **`memory/constitution.md`** holds the rules that apply to *every* feature. Every command reads it.
- **`templates/`**: Spec Kit never writes a document from scratch. It copies a template and fills it in, which keeps every spec, plan and task list in the same shape. Advanced teams customize these.
- **`scripts/`** are small shell scripts that do the mechanical work, such as creating the next numbered folder, copying templates and updating `feature.json`. You don't edit them.
- **`integrations/` + `.github/agents` + `.github/prompts`** are the glue that turns `/speckit-plan` into a long, carefully written prompt for *your* specific AI agent.
- **`feature.json`** is the bookmark that tells every command which feature folder to work in.

---

## 8. How Spec Kit handles many features

**Golden rule: one feature at a time.** Don't spec the whole app at once. You'll drown in review work and edge cases.

What happens when you run `/speckit-specify` for a new feature:

1. Spec Kit picks the next number and a short name, for example **`001-user-registration`**.
2. It creates **`specs/001-user-registration/`**, and every document for that feature lives there.
3. It updates **`.specify/feature.json`** to point at that folder, so that feature becomes "active".
4. If the **Git extension** is installed, it also creates and switches to a branch called `001-user-registration`.

Later commands (`clarify`, `plan`, `tasks`, ...) read `feature.json` first, which is why you never need to tell them which feature you mean.

Next feature? Run `/speckit-specify` again and you get `002-user-login`, then `003-...`, and so on.

```
specs/
├── 001-user-registration/   (done)
├── 002-user-login/          (done)
└── 003-password-reset/      ← feature.json points here now
```

> **Note:** In current versions the *active feature comes from `feature.json`, not from your Git branch.* Running `git checkout 001-user-registration` alone does **not** switch Spec Kit back. To switch, edit `.specify/feature.json` or set the environment variable `SPECIFY_FEATURE_DIRECTORY`.

**The lifecycle:**
- `constitution` runs **once per project**.
- `specify → … → converge` runs **once per feature**, again and again.

---

## 9. Step 1: `constitution`

### What it is
The constitution holds your project's **non-negotiable, long-term rules**. Think of it as the "house rules" the AI must obey in every spec, plan, task and line of code.

### What belongs in it
- Language and framework versions (e.g. *Java 21, Spring Boot 3.x, Maven*)
- Architecture (*layered: controller → service → repository; no business logic in controllers*)
- Coding standards and naming conventions
- Testing rules (*test-first; unit tests with JUnit 5; integration tests with Testcontainers; minimum coverage X%*)
- Security rules (*never log passwords; validate all input; secrets come from environment variables*)
- API design conventions, error-handling style, logging and observability
- Documentation standards
- How the constitution itself gets amended (versioning, who approves)

### What does NOT belong in it
Anything about a specific feature. "Users register with email" is a spec, not a constitution rule.

### Tip from the course (a very good habit)
Before running the command, use a chat AI to draft it with you, and **ask the AI to interview you first**:
> "Help me write a Spec Kit constitution prompt for a Spring Boot / Java 21 web app. First read the latest Spec Kit docs on the constitution command. Then **ask me questions** about build tool, architecture, testing, persistence, security, UI, and conventions. Only after I answer, write the prompt. Include only long-term rules, nothing feature-specific."

Asking questions first stops the AI from inventing your standards.

### How to run it
In your agent's chat:
```
/speckit-constitution This is a Spring Boot 3 web application on Java 21, built with Maven.
Architecture: layered (web → service → repository). Controllers contain no business logic.
Testing: test-first. Every feature needs unit tests (JUnit 5, Mockito) and at least one
integration test. Tests must fail before implementation is written.
Persistence: Spring Data JPA, schema changes only through Flyway migrations.
Security: never store or log plain-text passwords; validate all user input on the server.
UI: server-side rendered Thymeleaf templates.
Keep it simple: no extra abstraction layers or libraries without a documented reason.
```

### What happens
The AI fills in the template placeholders in `.specify/memory/constitution.md`, adds a version number and dates, and keeps the dependent templates in sync with your rules.

### Your job afterwards
**Read it carefully.** Every later step follows it, so a wrong rule here spreads into everything that comes after.

### Background: the "Nine Articles"
Spec Kit's methodology document (`spec-driven.md`) gives an example constitution with "articles" such as *Library-First*, *CLI Interface*, *Test-First (non-negotiable)*, *Simplicity* (no more than 3 projects at first), *Anti-Abstraction* (use the framework directly instead of wrapping it), and *Integration-First Testing* (prefer real databases to mocks). The plan step then runs "gates" that check the design against these articles. You don't have to copy them, but they show the *kind* of thing a constitution should say.

---

## 10. Step 2: `specify`

### What it is
It creates the **specification**: a description of *what* one feature should do and *why*, written for a product person rather than a programmer.

### Write it with user stories
A **user story** is one complete thing a person can do, from start to finish:
> *As a* **visitor**, *I want* **to register with my name, email and password**, *so that* **I can start using the app.**

Give each story a **priority**:
- **P1**: essential. Without it the feature doesn't work at all.
- **P2**: important, but the core still works without it.
- **P3**: nice to have, can wait.

Each story needs **acceptance scenarios** in **Given / When / Then** form:
> **Given** a visitor enters a valid name, a valid email and a password of at least 8 characters,
> **When** they submit the registration form,
> **Then** a new account is created and a success message is shown.

> **Given** an account already exists with that email,
> **When** someone registers with the same email,
> **Then** registration is rejected with "Email address is already in use."

Also add an **Out of Scope** list. It keeps the AI focused:
> Out of scope: login, logout/sessions, viewing/updating/deleting accounts, password reset, email verification.

### How to run it
```
/speckit-specify Build a "User Registration" feature.

User Story 1 (P1): As a visitor I want to register a new account with my name, email
address and password so that I can start using the application.

Acceptance scenarios:
1. Given valid name, valid email and a password of at least 8 characters, when I submit,
   then the account is created and I see a success message.
2. Given an email that is already registered, when I submit, then I see
   "Email address is already in use" and no account is created.
3. Given an invalid email format, when I submit, then I see a validation error.
4. Given a password shorter than 8 characters, when I submit, then I see a validation error.

Out of scope: login, logout, session management, profile view/update/delete,
password reset, email verification.
```

Notice what's **missing**: no "controller", no "JPA", no "BCrypt". Those come in `plan`.

### What it creates
- `specs/001-user-registration/spec.md` with user stories, acceptance scenarios, edge cases, **functional requirements** (numbered like `FR-001`, `FR-002`), key entities and success criteria
- `specs/001-user-registration/checklists/requirements.md`, a built-in quality checklist for the spec
- an updated `.specify/feature.json`
- a new Git branch, if the git extension is installed

Where the AI is unsure, it may write **`[NEEDS CLARIFICATION: …]`** markers in the spec. That's a good thing: it's flagging the guesses instead of hiding them.

### Your job
Read `spec.md`. Is it what you meant? Edit it directly if not. You own this document.

---

## 11. Step 3: `clarify` (optional but recommended)

### What it is
It's an interview. The AI reads your spec, finds what's **vague or missing**, and asks you up to about **five targeted questions, one at a time**. After each answer it **writes the decision straight into `spec.md`**.

### Why it matters
Every gap you don't close here becomes an AI guess later. Fixing a misunderstanding in a sentence is cheap. Fixing it in 40 files of code is expensive.

### How to run it
```
/speckit-clarify
```
or point it at an area you care about:
```
/speckit-clarify focus on security and input validation
```

### What it looks like
> **Q1: How should email uniqueness be compared?**
> A) Trim spaces; case-sensitive
> **B) Trim spaces; case-insensitive (recommended)**
> C) Trim; lowercase domain only
> Reply with a letter, "yes"/"recommended", or a short custom answer.

You type `B`. It records the decision in a **Clarifications** section (with a date) and updates the affected requirements and edge cases, then asks the next most important question.

### Tips
- Read the recommendation, but **decide yourself**. It's your product.
- You can run `clarify` several times, each time on a different area.
- It was formerly called `/quizme`.

---

## 12. Step 4: `plan`

### What it is
It turns the **what** (spec) into the **how**: a technical implementation plan.

### What goes in your prompt
Tech decisions **specific to this feature** that aren't already in the constitution:
```
/speckit-plan Implement as a server-rendered Spring MVC page at GET/POST /register using Thymeleaf.
Use a RegistrationController, a UserService and a Spring Data JPA UserRepository.
Store users in a "users" table created by a Flyway migration; unique index on lower(email).
Protect passwords with Spring Security's PasswordEncoder (BCrypt). Never return or log the hash.
Use Bean Validation (@Valid) on a RegistrationForm DTO. Use H2 for local dev, PostgreSQL in prod.
```
**Don't repeat** rules that are already in the constitution or the spec. Spec Kit pulls those in automatically.

### What it creates
- **`plan.md`**: technical context, architecture, project structure, and a **Constitution Check** section that confirms the plan doesn't break your rules (and justifies it if it has to)
- **`research.md`**: decisions it researched and why (e.g. "BCrypt vs Argon2")
- **`data-model.md`**: entities, fields, validation rules, relationships
- **`contracts/`**: API or interface definitions (endpoints, request/response shapes)
- **`quickstart.md`**: how to run and manually verify the feature

Not every feature gets all of these. It depends on complexity.

### Your job
Review the plan like a senior engineer would. Is the architecture sensible? Any over-engineering? Does it match the constitution? Edit it now, because tasks and code are built from it.

> **Tip:** Ask the agent to *"research rapidly-changing libraries mentioned in the plan and verify versions"* when you rely on new frameworks. AI knowledge can be out of date.

---

## 13. Step 5: `checklist` (optional)

### What it is
Spec Kit calls it **"unit tests for your requirements."** Normal unit tests check whether *code* works. A checklist checks whether your *requirements are well written*: complete, clear, consistent and measurable.

### How it differs from `clarify`

| `clarify` | `checklist` |
|---|---|
| Asks you questions | Produces a list of questions for *you* to review |
| **Edits** `spec.md` with your answers | **Doesn't edit** the spec, only writes a checklist file |
| Interactive conversation | A document you go through on your own |

### How to run it
```
/speckit-checklist
/speckit-checklist security
/speckit-checklist UX and accessibility
```
Example items it might generate:
- "Is the error message for a duplicate email specified exactly?"
- "Is the maximum length of the name field defined?"
- "Are requirements for what happens on a database failure defined?"

### Your job
Go through each item. If the spec doesn't answer it, **update `spec.md`** (or run `clarify` again), then tick the box. `[x]` means *"the requirement is clearly written"*, **not** *"the code is done."*

> `implement` reads your checklists before it starts. If items are still unticked, it **warns you and asks** whether to continue.

**When to run it:** after `plan` is a good default (so it can see both spec and plan), but you can run it any time after `specify`.

---

## 14. Step 6: `tasks`

### What it is
It breaks the plan into a **numbered, ordered list of small tasks** that the AI can complete one at a time.

### How to run it
```
/speckit-tasks
```
No extra prompt is needed. It reads `plan.md`, `spec.md` and any supporting files (`data-model.md`, `contracts/`, `research.md`, `quickstart.md`).

### How `tasks.md` is organized
```
Phase 1: Setup            → dependencies, config, package structure
Phase 2: Foundational     → shared building blocks everything needs (DB, security config, base entities)
Phase 3: User Story 1 (P1) → tests FIRST, then the implementation for that story
Phase 4: User Story 2 (P2) → ...
Phase N: Polish & Cross-Cutting → docs, extra validation, cleanup
+ Dependencies & execution order
+ Parallel opportunities
+ Implementation strategy (e.g. "MVP = Phase 1–3")
```

A typical line:
```
- [ ] T014 [P] [US1] Create RegistrationForm DTO with validation in src/main/java/.../web/RegistrationForm.java
```
How to read it:
- **`T014`** is the task ID
- **`[P]`** means this can run **in parallel** with other `[P]` tasks (they touch different files)
- **`[US1]`** means it belongs to **User Story 1**
- then the action and the **exact file path**

### Why it's organized by user story
Each story can be built, tested and demoed **on its own**. You could ship P1 as an MVP and add P2 later.

### Your job
Skim it. Are tests before implementation (if your constitution requires it)? Are any tasks missing or too vague? It's your build checklist, so make it right.

---

## 15. Step 7: `analyze` (optional but recommended)

### What it is
It's a **read-only consistency check** across `spec.md`, `plan.md` and `tasks.md`, measured against the constitution. You created these documents at different times, and maybe edited some by hand, so they can drift apart. `analyze` finds where they disagree.

### How to run it
```
/speckit-analyze
```

### What it looks for
- **Coverage gaps**: a requirement (e.g. `FR-004`) with no task that implements it
- **Conflicts**: the spec says "case-insensitive email" but the plan says "exact match"
- **Ambiguity**: words like "fast" or "secure" with no measurable definition
- **Duplication**: the same requirement stated twice in different ways
- **Constitution violations**: these are always treated as **CRITICAL**
- **Orphan tasks**: tasks that don't map to any requirement

### What the report looks like
- A findings table: ID, category, **severity** (CRITICAL / HIGH / MEDIUM / LOW), location, summary, recommendation
- A **coverage summary**: each requirement, whether it has tasks (yes/no), and which ones
- **Next actions**: e.g. "No critical blockers; fix HIGH/MEDIUM before implementing"

### It never edits files
You decide what to fix, and **fix it at the source**:
- requirement problem → edit `spec.md` (or `clarify`)
- design problem → edit `plan.md` (or re-run `plan`)
- missing task → edit or regenerate `tasks.md`

Then run `analyze` again until it's clean enough.

---

## 16. Step 8: `implement`

### What it is
This is where the code actually gets written. The AI goes through `tasks.md` in order, respecting dependencies and `[P]` markers, and **ticks off each task** as it finishes.

### How to run it
```
/speckit-implement
```
For bigger features, do it in chunks so you can review between them:
```
/speckit-implement Only the Setup and Foundational phases
/speckit-implement Now User Story 1
/speckit-implement Tasks T020 to T030
```

### What you'll see
The agent compiles the project, installs dependencies, runs tests and asks permission to run terminal commands. If you're working test-first, you'll see tests fail first and then pass.

### Your job (don't skip this)
1. **Run the app** (e.g. `mvn spring-boot:run`, then open `http://localhost:8080/register`).
2. **Try the acceptance scenarios by hand.** Register once. Register again with the same email and expect "already in use".
3. **Run the tests.**
4. **Read the code.** AI can still make mistakes, and you're responsible for what ships.

If something's wrong, fix the code, **or better, fix the spec or plan and regenerate** so your documents stay the source of truth.

---

## 17. Step 9: `converge`

### What it is
It's the **final audit**. It compares the **actual code** with the spec, plan and tasks, and asks: *did we really build everything we planned?*

### How to run it
```
/speckit-converge
```
Run it only after `implement` has worked through the current `tasks.md`.

### Two possible outcomes
1. **"Converged — the implementation satisfies the spec, plan, and tasks."** `tasks.md` is left unchanged and you're done.
2. **"Tasks appended."** Something is missing or incomplete. Converge **doesn't touch your code**. Instead it appends new tasks under a **Convergence** section at the bottom of `tasks.md`.

### Then the loop
```
implement → converge → (tasks appended?) → implement → converge → ... → Converged ✅
```

### Even after "Converged"
Still run tests, do manual testing and review. Converge checks *against your documents*, so if the documents were wrong, the code will be "correctly wrong."

---

## 18. The feedback loops

The commands aren't a strict one-way line. There are **three loops**, and they're where SDD really pays off:

```
Loop A (requirements quality):   specify → clarify → checklist → (edit spec) → clarify ...
Loop B (document consistency):   tasks → analyze → (fix spec/plan/tasks) → analyze ...
Loop C (implementation fidelity): implement → converge → implement → converge ... → Converged
```

**Changing your mind later?** Update the **spec** first, then re-run `plan` → `tasks` → `analyze` → `implement` → `converge`. Don't just patch code, or your documents will stop telling the truth.

---

## 19. Command names differ per AI agent

The same command is written differently depending on your agent:

| Agent | Syntax example |
|---|---|
| GitHub Copilot (default "skills" mode) | `/speckit-specify` |
| Docs / many agents (Claude Code, Cursor, Gemini, ...) | `/speckit.specify` |
| Codex, ZCode | `$speckit-specify` |
| Kimi | `/skill:speckit-specify` |

Your course uses `/speckit.constitution` in Copilot chat, and both forms are seen in the wild. **Type `/speckit` in your chat and look at the autocomplete** to see the exact names your setup uses.

**Slash commands go in the AI chat. `specify ...` commands go in the terminal.** Don't mix them up.

---

## 20. Best practices and common mistakes

### Do ✅
- **One feature per spec.** Small specs are easier to review.
- **Start each step in a fresh chat session** (as the course does). The documents carry the context, so the chat doesn't need to.
- **Review every document** before moving on. AI drafts, you decide.
- **Use priorities (P1/P2/P3) and Out of Scope** to keep the AI focused.
- **Commit to Git after each step** (spec done → commit, plan done → commit). You get history and an easy undo.
- **Fix problems at the earliest document** where they started.
- **Keep the constitution short and strict.** Real rules only, not wishes.

### Don't ❌
- ❌ Put technology in `specify` ("use a REST controller…").
- ❌ Put feature details in the `constitution`.
- ❌ Repeat constitution rules in the `plan` prompt.
- ❌ Skip `clarify` on anything important. Guesses become bugs.
- ❌ Ignore `analyze` HIGH/CRITICAL findings.
- ❌ Trust "Converged" or "Implementation complete" without running the app and the tests.
- ❌ Patch code to change behaviour without updating the spec, because then the spec stops being the truth.

### When is SDD overkill?
For a 5-line script or a throwaway prototype, the full process is too heavy. Use the short path (`specify → plan → tasks → implement`) or just code it. SDD shines on real features, team projects, and anything you'll maintain.

### Brownfield (existing code) tips
- Write a constitution that **describes how the existing code already works**, so the AI follows your current patterns.
- Specs can describe *changes* ("add password strength rule to existing registration").
- Commit before `specify init --here`, since it may merge or overwrite files.

---

## 21. One-page cheat sheet

```bash
# ---- Terminal (once) ----
brew install uv
uv tool install specify-cli
specify version
specify init my-app --integration copilot --script sh   # new project
specify init --here                                       # existing project (or: specify init .)
specify extension add git                                 # optional: auto feature branches
specify self check                                        # newer release available?
```

```text
# ---- AI chat (per project) ----
/speckit-constitution <long-term rules: stack, architecture, testing, security, conventions>

# ---- AI chat (per feature) ----
/speckit-specify   <WHAT + WHY: user stories, P1/P2/P3, Given/When/Then, out of scope>
/speckit-clarify   [focus area]          ← optional; answers go into spec.md
/speckit-plan      <HOW: framework, layers, DB, security approach for this feature>
/speckit-checklist [focus area]          ← optional; "unit tests for requirements"
/speckit-tasks                           ← tasks.md: phases, T001…, [P], [US1]
/speckit-analyze                         ← optional; read-only consistency report
/speckit-implement [scope]               ← writes code, ticks tasks
/speckit-converge                        ← audit; appends tasks if gaps → implement again
```

| Remember | |
|---|---|
| Spec = | WHAT & WHY (no tech) |
| Plan = | HOW (all tech) |
| Read-only commands | `analyze` (report only); `converge` changes no code, it only appends tasks |
| Active feature stored in | `.specify/feature.json` |
| Rules stored in | `.specify/memory/constitution.md` |
| Feature docs live in | `specs/NNN-feature-name/` |
| You are always | the reviewer and the owner |

---

## 22. Sources

- Official repo: https://github.com/github/spec-kit
- Quick Start: https://github.github.io/spec-kit/quickstart.html (and `docs/quickstart.md` on the `master` branch)
- Per-command reference (Agentic SDD): https://github.github.io/spec-kit/reference/agentic-sdd.html
- Installation: https://github.github.io/spec-kit/installation.html
- Integrations CLI & command naming: https://github.github.io/spec-kit/integrations/cli.html
- Methodology (`spec-driven.md`, the "Nine Articles"): https://github.com/github/spec-kit/blob/main/spec-driven.md
- Microsoft Developer Blog, *Diving into Spec-Driven Development with GitHub Spec Kit*: https://developer.microsoft.com/blog/spec-driven-development-spec-kit/
- Augment Code, practical Spec Kit guide: https://www.augmentcode.com/guides/github-spec-kit-practical-guide-sdd-workflow
- Your course transcript (workflow, Spring Boot user-registration example)

> Spec Kit evolves quickly. If something here doesn't match what you see, trust `specify --help`, the autocomplete in your agent chat, and the official docs above.
