Spec-Driven Development with AI: The 2026 Guide to GitHub Spec Kit
Spec-Driven Development with AI: The 2026 Guide to GitHub Spec Kit
You prompted the agent. It wrote 400 lines. Half of them solved the wrong problem. Welcome to vibe coding at scale โ the thing every team learned to regret in 2025.
Spec-driven development (SDD) is the fix that stuck. Instead of chatting at your AI agent and praying, you write a spec, the agent turns it into a plan, the plan becomes tasks, and tasks become code you actually trust. GitHub's Spec Kit made this workflow open source in late 2025 and it's now the fastest-growing approach to AI coding in 2026.
This guide walks both sides of the room: the what and why for anyone managing AI-built software, and the how โ commands, files, and prompts โ for engineers ready to ship with it today.
๐ What You'll Need
- An AI coding agent: Claude Code, GitHub Copilot (agent mode), Gemini CLI, or Cursor
- Python 3.11+ with the
uvpackage manager installed - A Git repository (greenfield or existing โ both work)
- Ten minutes to understand the four-phase loop before you run a single command
- A willingness to write specs instead of prompts โ this is the whole game
No paid license is required. Spec Kit is open source and free.
๐งญ What Spec-Driven Development Actually Is
Spec-driven development flips the traditional order of operations. Code is no longer the source of truth โ the specification is. The code is a generated artifact, and the AI agent is the thing that generates it.
That sounds academic until you see the failure mode it cures. In vibe coding, the "truth" about your system lives in a chat history that resets every time the context window fills up. The agent forgets. You forget. New features contradict old ones. SDD makes the truth a file on disk.
The four-phase loop
Every spec-driven workflow โ whether you use Spec Kit, Kiro, BMAD, or homegrown templates โ runs the same sequence:
- Specify โ You describe what to build and why, in user terms. No tech stack.
- Plan โ You add the how: architecture, libraries, data model, constraints.
- Tasks โ The agent breaks the plan into small, reviewable work units.
- Implement โ The agent executes tasks one at a time, in order, against the spec.
Each phase produces a markdown file the next phase reads. Nothing is in the agent's head alone.
๐ Spec-Driven vs Vibe Coding
Both approaches exist on the same spectrum, and neither is universally right. Pick based on the stakes.
| Aspect | Vibe Coding | Spec-Driven Development |
|---|---|---|
| Source of truth | The chat history ๐ฌ | A spec file on disk ๐ |
| Best for | Prototypes, throwaway scripts, exploration | Production code, team projects, long-lived systems |
| Speed to first output | ๐ข Fastest | ๐ก Slower start, faster finish |
| Risk of drift | ๐ด High | ๐ข Low |
| Reviewability | Hard โ what was the intent? | Easy โ spec is the answer |
| Onboarding new devs | Painful | Read the spec, done |
The honest take: start vibe, finish spec-driven. Explore an idea in a freewheeling chat. When the shape is clear, write the spec and hand it back to the agent. See Vibe Coding Explained for the other half of this story.
โ๏ธ Installing GitHub Spec Kit
Spec Kit ships as a Python CLI called Specify. Install it with uv:
# Install uv if you don't have it
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install the Specify CLI
uv tool install specify-cli --from git+https://github.com/github/spec-kit.git
Then initialize a project:
# New project
specify init my-photo-app --ai claude
# Or bolt it onto an existing repo
cd my-existing-project
specify init . --ai copilot
The --ai flag tells Spec Kit which agent you're wiring it into. Supported values in April 2026 include claude, copilot, gemini, and cursor. Each target writes slash commands into the agent's config directory so you can call /speckit.specify, /speckit.plan, etc. from inside your coding session.
What Spec Kit drops into your repo
my-photo-app/
โโโ .specify/
โ โโโ memory/
โ โ โโโ constitution.md # Project principles
โ โโโ specs/
โ โ โโโ 001-albums/
โ โ โโโ spec.md # What to build
โ โ โโโ plan.md # How to build it
โ โ โโโ tasks.md # Work breakdown
โ โโโ templates/ # Slash command scaffolds
โโโ ...your code...
Every feature lives in its own numbered folder under specs/. Specs, plans, and tasks are all plain markdown โ commit them with your code.
๐ ๏ธ The Seven Spec Kit Commands
Once Spec Kit is installed, your agent exposes seven slash commands. You'll use four of them constantly and three occasionally.
| Command | Phase | What it does |
|---|---|---|
/speckit.constitution |
Setup | Write the rules every spec must respect (style, security, quality bars) |
/speckit.specify |
1. Specify | Turn a plain-English description into a structured spec |
/speckit.clarify |
1b. Refine | Interactively surface ambiguity in the spec |
/speckit.plan |
2. Plan | Add tech stack and architecture to the spec |
/speckit.tasks |
3. Tasks | Break the plan into atomic, testable work units |
/speckit.analyze |
3b. Review | Check the plan and tasks for spec adherence |
/speckit.implement |
4. Implement | Execute tasks in order, one at a time |
You don't have to run all seven. A minimal flow is specify โ plan โ tasks โ implement. Add constitution once per project and clarify/analyze when you're unsure.
๐ฏ A Full Walkthrough: Building a Photo Album App
Let's run the loop end to end. The example is deliberately small so you can see every file it produces.
Step 1 โ Write the constitution
In your agent session, run:
/speckit.constitution
Principles:
- TypeScript only, strict mode
- No external state management libraries
- Every feature must have integration tests
- Accessibility: WCAG 2.1 AA minimum
- No telemetry without explicit user opt-in
This writes .specify/memory/constitution.md. Every future spec, plan, and task will be checked against it.
Step 2 โ Specify the feature
/speckit.specify
Build an app to organize photos into albums. Users can drag
photos between albums on the main page. Each album shows a
tiled preview of its contents, grouped by the date the
photos were taken. Photos can belong to multiple albums.
Notice what's missing: no framework, no database, no API design. That's intentional. The spec captures user value, not implementation. The agent writes spec.md with user stories, acceptance criteria, and open questions.
Step 3 โ Clarify ambiguities
/speckit.clarify
The agent re-reads spec.md and asks pointed questions: "What happens when a photo is deleted from one album but still exists in another?" Answer inline. The spec gets updated. This step alone kills more bugs than any test suite you'll ever write.
Step 4 โ Plan the implementation
/speckit.plan
Use Vite + React + TypeScript. Store metadata in SQLite via
better-sqlite3. Image files live on the local filesystem.
Drag-and-drop via dnd-kit. No backend โ this is a desktop
app built with Tauri.
Now the agent writes plan.md: data model, file structure, component tree, and which parts of the spec each piece satisfies.
Step 5 โ Generate tasks
/speckit.tasks
The agent produces tasks.md โ usually 15 to 40 small tasks, each with a title, scope, and "done when" criteria. Review it like a pull request. Delete, reorder, or rewrite tasks before moving on.
Step 6 โ Implement
/speckit.implement
The agent works through tasks.md top to bottom, one task per turn, updating the file as it goes. You review each change. If something drifts, you stop, edit the spec, and re-run /speckit.plan or /speckit.tasks for just the affected slice.
/speckit.implement unattended on a 30-task list the first time. Start with 3-5 tasks. Review. Adjust the constitution. Then scale up.
๐งฉ Where SDD Fits in Your Workflow
Spec-driven development is a tool, not a religion. Three places it pays off immediately:
Greenfield features
You're starting from zero. There's no codebase to guess at, no legacy to protect. The spec is the cheapest place to be wrong, because wrong specs cost keystrokes โ wrong code costs refactors.
Cross-team handoffs
A PM writes the spec. An engineer writes the plan. An AI agent writes the tasks. A second engineer reviews the implementation. Every step has a durable artifact and an owner. The spec becomes the contract between roles.
Legacy modernization
You're rewriting a 10-year-old module that nobody fully understands. Use /speckit.specify to reverse-engineer the current behavior into a spec first. Then write a new plan against the same spec. The spec preserves what the module does while you rebuild how it does it.
Where it doesn't fit: five-line bug fixes, ad-hoc data pulls, weekend hacks. Writing a spec for those is the engineering equivalent of filing a JIRA ticket to brush your teeth.
๐ Spec Kit vs the Other SDD Tools
Spec Kit isn't the only player. In 2026 the three serious options are:
| Tool | Maker | Best For | Catch |
|---|---|---|---|
| ๐ฅ GitHub Spec Kit | GitHub | Multi-agent teams, open source, any stack | Still maturing โ expect breaking changes |
| ๐ฅ Kiro | AWS | Teams already in the AWS ecosystem | Tied to AWS tooling and billing |
| ๐ฅ BMAD-METHOD | Community | Solo devs who want heavy templating | Steeper learning curve, opinionated |
Spec Kit wins on neutrality. It works with Claude Code, Copilot, Gemini, and Cursor without forcing you to pick one. That matters in a year where "which agent is best" changes every quarter. For more on picking agents, see AI Coding Agents Compared 2026.
๐งช Spec-Driven Development and Tests
SDD and test-driven development are natural partners, not competitors. The spec says what. Tests prove it works. The code is the thing that makes both true.
A simple rhythm that works:
/speckit.specifywritesspec.md/speckit.planadds a test strategy section toplan.md/speckit.tasksgenerates a test task before each implementation task/speckit.implementwrites the test first, then the code, then verifies
This is red-green-refactor with the agent doing the typing. The spec is what keeps the agent from writing tests that "pass but don't prove anything" โ the single most common failure mode of AI-generated TDD. If you want the deep dive, see Test-Driven Development with AI Agents.
๐ Troubleshooting
Common snags when you first adopt Spec Kit:
| Problem | Solution |
|---|---|
Agent ignores /speckit.* commands |
Re-run specify init . --ai <agent> โ slash command files may not have been written |
spec.md is too vague and the plan is garbage |
Run /speckit.clarify before /speckit.plan. Don't skip it. |
| Agent keeps drifting from the constitution | Move violated rules higher in constitution.md. Agents weight earlier rules more heavily. |
| Tasks are too big โ each one touches 10 files | Ask the agent to re-split with "break any task that modifies more than 3 files" |
uv tool install fails on corporate network |
Use uvx --from git+... specify init for a one-shot run without a global install |
| Drift between code and spec over time | Run /speckit.analyze on a schedule โ treat it like a linter for intent |
๐ฐ Cost Breakdown
Spec Kit itself is free. The cost lives entirely in the agent you pair it with.
| Component | Cost | Notes |
|---|---|---|
| ๐ GitHub Spec Kit | Free | Open source, MIT licensed |
๐ uv package manager |
Free | Astral, open source |
| Claude Code | ~$20-200/mo | Pay-as-you-go API or Anthropic Max plan |
| GitHub Copilot | $10-39/mo | Individual to Business tiers |
| Gemini CLI | Free tier + usage | Generous free tier for individual devs |
| Cursor | $20/mo Pro | Flat rate, includes agent mode |
Spec-driven workflows consume more tokens per feature than vibe coding because the agent reads spec, plan, and tasks on every turn. Budget roughly 20-40% higher API spend, offset by fewer wasted implementation cycles.
๐ What's Next
- ๐ Write your first constitution. Spend 20 minutes on this before any spec. It pays back 10x.
- ๐งฑ Try it on a throwaway feature first. Pick a small CRUD screen. Run the full loop. Feel the rhythm.
- ๐ Learn the Claude Code Workflow Guide โ it pairs naturally with Spec Kit.
- ๐ก๏ธ Read up on AI Coding Agents Security Risks before letting an agent implement unattended.
- ๐ Bookmark the official Spec Kit repo โ it ships updates weekly.
Ready to go deeper? Read the Claude Code Workflow Guide for the agent side of the loop, or see AI Coding Agents Compared 2026 to pick the right engine for your specs.