Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

spec-kit

Specification-Driven Development (SDD) toolkit for structured feature development.

Overview

Spec-Kit enforces “define before implement” - you write specifications first, generate plans, create tasks, then execute. This reduces wasted effort and validates features match requirements.

Installation

/plugin install spec-kit@claude-night-market

Skills

SkillDescriptionWhen to Use
spec-writingSpecification authoringWriting requirements from ideas
task-planningTask generationBreaking specs into tasks
speckit-orchestratorWorkflow coordinationManaging spec-to-code lifecycle

Commands

CommandDescription
/speckit-specifyCreate a new specification
/speckit-planGenerate implementation plan
/speckit-tasksGenerate ordered tasks
/speckit-implementExecute tasks
/speckit-analyzeCheck artifact consistency
/speckit-checklistGenerate custom checklist
/speckit-clarifyAsk clarifying questions
/speckit-constitutionCreate project constitution
/speckit-startupBootstrap workflow at session start

Agents

AgentDescription
spec-analyzerValidates artifact consistency
task-generatorCreates implementation tasks
implementation-executorExecutes tasks and writes code

Usage Examples

Full SDD Workflow

# 1. Create specification
/speckit-specify Add user authentication with OAuth2

# 2. Clarify requirements
/speckit-clarify

# 3. Generate plan
/speckit-plan

# 4. Create tasks
/speckit-tasks

# 5. Execute implementation
/speckit-implement

# 6. Verify consistency
/speckit-analyze

Quick Specification

/speckit-specify Add dark mode toggle

# Claude will:
# 1. Ask clarifying questions
# 2. Generate spec.md
# 3. Identify dependencies
# 4. Suggest next steps

Session Startup

/speckit-startup

# Loads:
# - Existing spec.md
# - Current plan.md
# - Outstanding tasks
# - Progress status
# - Constitution (principles/constraints)

Artifact Structure

Spec-Kit creates three main artifacts:

spec.md

# Feature: User Authentication

## Overview
OAuth2-based authentication for web application.

## Requirements
- [ ] Google OAuth integration
- [ ] Session management
- [ ] Token refresh

## Acceptance Criteria
1. Users can sign in with Google
2. Sessions persist for 7 days
3. Tokens refresh automatically

## Non-Functional Requirements
- Login latency < 2s
- 99.9% availability

plan.md

# Implementation Plan

## Phase 1: OAuth Setup
- Configure Google OAuth credentials
- Implement OAuth callback handler

## Phase 2: Session Management
- Design session schema
- Implement token storage

## Phase 3: Integration
- Connect to frontend
- Add logout functionality

tasks.md

# Tasks

## Phase 1 Tasks
- [ ] Create OAuth config module
- [ ] Implement /auth/login endpoint
- [ ] Implement /auth/callback endpoint

## Phase 2 Tasks
- [ ] Design session table schema
- [ ] Create session service
- [ ] Implement token refresh logic

Constitution

Project constitution defines principles:

/speckit-constitution

# Creates:
# - Coding standards
# - Architecture principles
# - Testing requirements
# - Documentation standards

Consistency Analysis

/speckit-analyze

# Checks:
# - spec.md requirements map to plan.md
# - plan.md phases map to tasks.md
# - No orphan tasks
# - No missing implementations

Checklist Generation

/speckit-checklist

# Generates custom checklist:
# - [ ] All acceptance criteria met
# - [ ] Tests written
# - [ ] Documentation updated
# - [ ] Security reviewed

Dependencies

Spec-Kit uses imbue for analysis:

spec-kit
    |
    v
imbue (diff-analysis, evidence-logging)

Superpowers Integration

CommandEnhancement
/speckit-clarifyUses brainstorming for questions
/speckit-planUses writing-plans for structure
/speckit-tasksUses executing-plans, systematic-debugging
/speckit-implementUses executing-plans, systematic-debugging
/speckit-analyzeUses systematic-debugging, verification-before-completion
/speckit-checklistUses verification-before-completion

Best Practices

  1. Specify First: Never skip the specification phase
  2. Clarify Ambiguity: Use /speckit-clarify liberally
  3. Small Tasks: Break into 1-2 hour chunks
  4. Verify Often: Run /speckit-analyze after changes
  5. Update Artifacts: Keep spec/plan/tasks in sync

Workflow Tips

Starting New Feature

/speckit-specify [feature description]
/speckit-clarify
/speckit-plan

Resuming Work

/speckit-startup
# Review current state
/speckit-implement

Before PR

/speckit-analyze
/speckit-checklist
  • imbue: Provides analysis patterns
  • sanctum: Integrates for PR preparation after implementation