Why Spec-Kit
When you let an AI agent code without a spec, the usual problems show up:- Vague requirements → the agent guesses your intent.
- The agent edits files outside the requested scope.
- Code runs but doesn’t match the business rules.
- Reviewers face thousand-line diffs with no context.
- Tests aren’t tied to acceptance criteria.
Old way vs Spec-Kit
| Old way (“vibe coding”) | With Spec-Kit |
|---|---|
| Short prompt → AI generates code → patch by hand | Detailed spec → AI plans → splits tasks → AI implements |
| Code is the documentation | Spec, plan, tasks are the documentation — code is output |
| Change a requirement = patch the code | Change a requirement = patch the spec, code is regenerated |
| Review a 1000-line dump | Review small tasks one at a time, against the spec |
The 7-step workflow
Each feature goes through seven stages, each tied to a slash command. Don’t skip steps.Set principles
/speckit.constitution — Define the project’s guiding rules (code quality, testing, UX, performance, security). Run once per project.Clarify
/speckit.clarify — Structured Q&A about ambiguous spots in the spec. Strongly recommended before planning.Technical plan
/speckit.plan — Decide tech stack, architecture, data model, API contracts. Output: plan.md, research.md, data-model.md, contracts/.Generate test cases
/speckit.testcase — Produce concrete test scenarios (precondition, input, expected output, pass criteria) linked to each SubTask, so the agent can verify itself during implementation. Output: testcase.md.Slash commands
Core commands
| Command | What it does | Output |
|---|---|---|
/speckit.constitution | Set project principles and dev guidelines | .specify/memory/constitution.md |
/speckit.specify | Define requirements and user stories (what & why) | spec.md |
/speckit.plan | Build the technical implementation plan | plan.md + supporting docs |
/speckit.tasks | Produce the actionable task list | tasks.md |
/speckit.testcase | Generate concrete test cases used to verify implementation | testcase.md (or under checklists/) |
/speckit.taskstoissues | Push the task list to GitHub Issues | GitHub Issues |
/speckit.implement | Execute the tasks to build the feature | (actual code) |
Optional commands
| Command | When to use |
|---|---|
/speckit.clarify | Before /speckit.plan — clear up underspecified areas in the spec |
/speckit.analyze | After /speckit.tasks, before /speckit.implement — check consistency across spec, plan, tasks |
/speckit.checklist | Generate a custom quality checklist to validate requirements |
Per-command guide
Prompt templates, filled-in examples, common mistakes and safety mechanisms for each command.
Spec-Kit in the workspace UI
Creating a workspace automatically scaffolds the Spec-Kit Markdown templates (spec.md, plan.md, tasks.md…) under .specify/.
When the agent runs a Spec-Kit command, the system shows a Plan Panel with:
- Context — what the agent is working on.
- Target File — the file that will be created or updated.
- Plan content — what the agent intends to write.
- Approve — accept the plan and let the agent proceed.
- Request Changes — type feedback so the agent revises the plan first.
Parse Markdown into Spec-Kit
Once the agent finishes a file (tasks.md, checklist.md…), push its contents into the database so the system can track progress as SubTasks and TestCases.
Two-tier backend processing
- Tier 1 — Regex (0 tokens): looks for markers like
[T001],[TC-001],CHK-001. With ≥3 markers, it parses directly. - Tier 2 — AI fallback: if there aren’t enough markers, the backend calls an AI to extract JSON from the file.
Clicking Parse to DB multiple times on the same file is safe — the system clears old data and recreates it (idempotent).
Plan and SubTask states
Plan:| State | Meaning |
|---|---|
draft | Spec is being written, not yet executing |
implementing | Agent is running the implement loop |
done | All SubTasks are complete |
| State | Meaning | UI color |
|---|---|---|
pending | Not started | Gray |
in_progress | Agent is working on it | Blue |
completed | Done | Green |
blocked | Stuck, needs intervention | Red |
skipped | Skipped | Yellow |
Safety mechanisms
When/speckit.implement runs, the system drives the agent in incremental execution mode: only 1–2 SubTasks per round, run unit tests, only move on when tests pass.
implement_max_loops— At most 5 self-correction attempts per SubTask (default). Beyond that the agent reportsBLOCKEDand stops instead of looping forever.[?]marker — If the agent doesn’t have enough information, it leaves a[?]note in the Markdown rather than guessing.
Standard team checklist
Apply this for every new feature: Before you start- New branch off
main. - Read
constitution.md— know the project rules. - PRD/requirement from PM in hand (don’t make it up).
- Run
/speckit.specifywith all 5 blocks (context → users → journey → requirements → success criteria). - No tech-stack mentions.
- Run
/speckit.clarify, answer every question. - Commit
spec.md.
- Run
/speckit.planwith all 5 blocks (tech → architecture → integrations → non-functional → conventions). - Audit the plan for over-engineering.
- Read
research.md,data-model.md,contracts/— sanity check. - Commit the plan files.
- Run
/speckit.tasks. - Run
/speckit.testcaseto generate verification test cases per SubTask. - Run
/speckit.analyzeto check consistency. - Click Parse to DB on both
tasks.mdandtestcase.mdafter review.
- Run
/speckit.implementphase by phase (one user story at a time). - After each phase: run the app, hit the checkpoint manually.
- Commit per phase, don’t batch.
- Hand runtime errors back to the AI; don’t hand-fix unless necessary.
- Open a PR that references
spec.mdandplan.md.
- Keep
specs/<feature>/— it’s the “why” doc for whoever joins next. - Need a change? Edit the spec first, not the code directly.
Next
Per-command guide
Prompt templates, filled examples and common mistakes for each slash command.
Create a workspace
Spin up a workspace where you can run Spec-Kit commands for a feature.