This tutorial walks you through creating your first Spec Kit project from initialization to working implementation. You will execute the complete Spec-Driven Development workflow, creating a simple application to understand how specifications transform into running code through the /speckit.* command sequence.
For detailed installation instructions, see Installation and Setup. For comprehensive coverage of the SDD methodology and advanced features, see Spec-Driven Development Workflow and its subsections.
Before beginning, verify your environment meets the requirements:
This command executes `check_tool()` for each required tool and displays their availability status using the `StepTracker` rendering system.
Required:
The `AGENT_CONFIG` dictionary defines metadata for all 17 supported agents, including whether they require CLI tools (requires_cli field) or are IDE-based.
Sources: src/specify_cli/__init__.py1282-1321 src/specify_cli/__init__.py484-513
Initialize a project in a new directory:
Or initialize in your current directory:
The `init()` command performs these operations:
| Step | Action | Code Reference |
|---|---|---|
| Tool Detection | Validates Git availability | src/specify_cli/__init__.py1076-1079 |
| Agent Selection | Interactive selection via `select_with_arrows()` or --ai flag | src/specify_cli/__init__.py1081-1093 |
| Script Type Selection | Chooses bash (.sh) or PowerShell (.ps) variants | src/specify_cli/__init__.py1113-1125 |
| Template Download | Fetches agent-specific template ZIP via `download_template_from_github()` | src/specify_cli/__init__.py1163 |
| Extraction | Unpacks template using `download_and_extract_template()` | src/specify_cli/__init__.py751-898 |
| Permissions | Sets execute bits on .sh scripts via `ensure_executable_scripts()` | src/specify_cli/__init__.py1165 |
| Constitution Setup | Copies constitution-template.md to memory/ via `ensure_constitution_from_template()` | src/specify_cli/__init__.py1167 |
| Git Initialization | Creates repository with initial commit via `init_git_repo()` | src/specify_cli/__init__.py1170-1183 |
The `StepTracker` provides live progress updates during initialization, with each step tracked via .add(), .start(), .complete(), and .error() methods.
Sources: src/specify_cli/__init__.py981-1269 src/specify_cli/__init__.py751-898
Sources: src/specify_cli/__init__.py981-1269 src/specify_cli/__init__.py1156-1203
The `download_and_extract_template()` function creates this structure:
todo-app/
├── .specify/
│ ├── memory/
│ │ └── constitution.md # Copied from constitution-template.md
│ ├── scripts/
│ │ ├── create-new-feature.sh # Branch and spec directory creation
│ │ ├── update-agent-context.sh # Updates CLAUDE.md with tech stack
│ │ ├── check-prerequisites.sh # Validates required tools
│ │ └── common.sh # Shared utility functions
│ ├── templates/
│ │ ├── spec-template.md # Specification structure
│ │ ├── plan-template.md # Implementation plan structure
│ │ ├── tasks-template.md # Task breakdown structure
│ │ └── constitution-template.md # Constitutional principles template
│ └── specs/ # Created during /speckit.specify
│ └── 001-feature-name/
│ ├── spec.md
│ ├── plan.md
│ ├── tasks.md
│ └── contracts/ # API specifications
├── .claude/ # For Claude Code agent
│ └── commands/
│ ├── constitution.md # /speckit.constitution command
│ ├── specify.md # /speckit.specify command
│ ├── plan.md # /speckit.plan command
│ ├── tasks.md # /speckit.tasks command
│ └── implement.md # /speckit.implement command
└── CLAUDE.md # Agent context file with project info
The exact agent directory (.claude/, .gemini/, .github/, etc.) depends on the selected AGENT_CONFIG[ai_assistant]["folder"] value.
Sources: src/specify_cli/__init__.py751-898 README.md440-459
Sources: README.md246-269 README.md390-615
Navigate to the project directory and launch your AI agent (e.g., claude). Execute:
What Happens:
The constitution enforces constraints like:
Sources: README.md93-101 README.md390-404
Execute the specification command with your feature description:
What Happens:
Agent executes `create-new-feature.sh` which:
001)001-todo-app.specify/specs/001-todo-app/Agent reads `templates/spec-template.md` to understand structure
Agent writes `.specify/specs/001-todo-app/spec.md` containing:
[NEEDS CLARIFICATION] markers for ambiguous areasExample spec.md structure:
| Section | Purpose | Template Enforcement |
|---|---|---|
| Feature Overview | High-level summary | Required by spec-template.md |
| User Stories | As a [user], I want [action], So that [benefit] | Structured format enforced |
| Functional Requirements | Technical capabilities organized by category | Must be testable and specific |
| Non-Functional Requirements | Performance, security, accessibility | Quantifiable metrics required |
| Review Checklist | Validation criteria | Agent marks items as complete/incomplete |
Sources: README.md406-438 templates/spec-template.md
Before planning, resolve any [NEEDS CLARIFICATION] markers:
What Happens:
spec.md for clarification markersspec.md with clarifications in a dedicated section[NEEDS CLARIFICATION] markersThis step prevents rework during planning and implementation by addressing ambiguities early.
Sources: README.md462-488
Specify your technology stack:
What Happens:
Constitutional Validation: Agent reads `.specify/memory/constitution.md` and validates plan against principles
Planning Artifacts: Agent reads `templates/plan-template.md` and creates:
Context Update: Agent executes `update-agent-context.sh` which:
plan.mdCLAUDE.md (or equivalent agent file) with project dependenciesplan.md structure:
Sources: README.md490-529 templates/plan-template.md
Convert the plan into executable tasks:
What Happens:
[P] markers for parallel executiontasks.md example:
Tasks are ordered to respect dependencies (e.g., storage layer before UI, tests before implementation if TDD is specified in plan).
Sources: README.md576-594 templates/tasks-template.md
Run the implementation command:
What Happens:
Prerequisite Validation: Agent verifies existence of:
.specify/memory/constitution.md.specify/specs/NNN-feature-name/spec.md.specify/specs/NNN-feature-name/plan.md.specify/specs/NNN-feature-name/tasks.mdTask Execution: Agent processes tasks.md sequentially:
npm install, dotnet new)[P] markers for potential parallelizationProgress Tracking: Agent reports completion of each task and checkpoint
Error Handling: If a task fails, agent reports error context and awaits correction
Implementation output:
✓ Task 1: Created src/storage.js with localStorage wrapper
✓ Task 2: Created tests/storage.test.js with 8 test cases
✓ Checkpoint: All storage tests pass
✓ Task 3: Created index.html with semantic structure
✓ Task 4: Created src/ui.js with rendering functions
✓ Task 5: Created src/app.js with event wiring
✓ Checkpoint: Manual test - add/delete/complete tasks works
Sources: README.md596-615 README.md259-264
Sources: README.md390-615 Diagram 2 from high-level system architecture
| Command | Files Created/Modified | Purpose |
|---|---|---|
specify init | .specify/memory/constitution.md.specify/scripts/*.sh.specify/templates/*.md.claude/commands/*.mdCLAUDE.md | Bootstrap project structure with templates, scripts, and agent commands |
/speckit.constitution | .specify/memory/constitution.md | Define architectural principles and constraints |
/speckit.specify | .specify/specs/001-feature-name/spec.mdBranch: 001-feature-name | Create feature specification with user stories and requirements |
/speckit.clarify | .specify/specs/001-feature-name/spec.md | Add clarifications section to resolve ambiguities |
/speckit.plan | .specify/specs/001-feature-name/plan.md.specify/specs/001-feature-name/data-model.md.specify/specs/001-feature-name/contracts/CLAUDE.md (updated) | Create implementation plan, data models, API contracts; update agent context |
/speckit.tasks | .specify/specs/001-feature-name/tasks.md | Generate ordered task breakdown with dependencies |
/speckit.implement | src/**/*tests/**/*Application code | Generate implementation files according to task plan |
Sources: README.md440-528
After /speckit.implement completes:
Check that all expected files exist:
If tests were included in the task plan:
Execute the application and validate functionality against the acceptance criteria in spec.md:
Cross-reference behavior with the Review & Acceptance Checklist section in `specs/001-todo-app/spec.md`
Browser console errors or CLI errors should be captured and provided back to the AI agent for resolution:
Sources: README.md612-615 README.md482-488
After completing your first feature:
Create additional features by repeating the workflow:
/speckit.specify with new requirements - the agent will automatically run create-new-feature.sh to create 002-feature-name branch and directory001-*/plan.md for consistency.specify/memory/constitution.md/speckit.analyze - Cross-artifact validation (see 2.3 for details)/speckit.checklist - Custom quality gate generation (see 5.9 for details)For comprehensive understanding of the philosophy and advanced patterns:
create-new-feature.sh and numbering schemeSources: README.md238-279 README.md287-318
Refresh this wiki