This repository contains the Spec Kit Workflow System - a specification-driven development framework for Claude Code.
This repository provides a framework that can be integrated into any software project. It is NOT a standalone application, but rather a set of tools, templates, and workflows.
.
├── .claude/
│ ├── settings.json # Claude Code hooks (Beads integration)
│ ├── README.md # Configuration documentation
│ ├── commands/ # Slash command definitions for Claude Code
│ │ ├── speckit.specify.md # Create feature specifications
│ │ ├── speckit.clarify.md # Resolve ambiguities
│ │ ├── speckit.plan.md # Create technical plans
│ │ ├── speckit.tasks.md # Generate task lists
│ │ ├── speckit.implement.md # Execute implementation
│ │ ├── speckit.analyze.md # Cross-artifact validation
│ │ ├── speckit.checklist.md # Quality checklists
│ │ ├── speckit.constitution.md # Project principles
│ │ ├── speckit.fix.md # Quick fixes (bypasses full workflow)
│ │ ├── speckit.taskstoissues.md # Convert tasks to GitHub issues
│ │ ├── speckit-workflow-v2.md # Full workflow orchestration
│ │ └── speckit-orchestrate.md # Quick workflow
│ ├── agents/ # Specialized sub-agent definitions
│ │ ├── openapi-spec-author.md # API design and contract validation
│ │ ├── backend-api-engineer.md # Backend TDD implementation
│ │ ├── frontend-react-engineer.md # Frontend React/TypeScript
│ │ ├── integration-tester.md # E2E and integration testing
│ │ ├── spec-validator.md # Spec quality validation
│ │ ├── consistency-checker.md # Cross-artifact consistency
│ │ └── beads-sync.md # Beads synchronization
│ └── skills/ # On-demand context skills
│ ├── spec-kit-workflow/ # Workflow phase guidance
│ ├── beads-integration/ # Persistent memory patterns
│ ├── spec-validation/ # Spec quality validation
│ └── project-standards/ # Constitution principles (on-demand)
├── .specify/
│ ├── memory/
│ │ └── constitution.md # Template for project architectural principles
│ ├── scripts/bash/ # Automation scripts
│ │ ├── common.sh # Shared utilities
│ │ ├── check-prerequisites.sh # Validate workflow state
│ │ ├── create-new-feature.sh # Initialize feature branches
│ │ ├── create-beads-epic.sh # Create Pivotal-style Beads epics
│ │ ├── create-beads-issues.sh # Bulk import tasks with dependencies
│ │ ├── setup-plan.sh # Initialize planning artifacts
│ │ └── update-agent-context.sh # Update context files
│ └── templates/ # Document templates
│ ├── spec-template.md # Feature specification structure
│ ├── plan-template.md # Technical plan structure
│ ├── tasks-template.md # Task list format
│ ├── checklist-template.md # Quality checklist format
│ └── agent-file-template.md # Agent context file
├── README.md # Framework documentation
└── LICENSE # MIT License
Spec Kit + Beads implements practices from Pivotal Labs (VMware Tanzu Labs):
| Pivotal Practice | Spec Kit Implementation |
|---|---|
| TDD | test-gate.sh enforces 100% test pass after edits |
| User Stories | spec.md with P0/P1/P2/P3 priorities |
| Story Types | Beads --type epic/task/bug |
| Story States | Beads --status todo/in-progress/done |
| Acceptance Criteria | spec.md sections → Beads epic description |
| IPM (Planning) | /speckit.specify → /speckit.plan → /speckit.tasks |
| Dependencies | Automatic P0 → P1 → P2 → P3 blocking |
# 1. Create spec with Problem Statement, Business Value, Acceptance Criteria
/speckit.specify Add payment processing
# 2. Create plan with Architectural Vision
/speckit.plan
# 3. Create Pivotal-style epic (extracts from spec.md + plan.md)
./.specify/scripts/bash/create-beads-epic.sh specs/001-feature P0
# 4. Generate tasks
/speckit.tasks
# 5. Bulk import tasks with P0→P1→P2 dependencies
EPIC_ID=$(cat specs/001-feature/.beads-epic-id)
./.specify/scripts/bash/create-beads-issues.sh specs/001-feature/tasks.md $EPIC_ID
# 6. Drive implementation from Beads
bd ready # Shows P0 tasks first, then P1 as P0 completesSpec Kit integrates with Specmatic for contract-driven development, enabling parallel frontend/backend implementation with API contracts as the source of truth.
The .mcp.json configures three MCP servers:
- Linear: Issue tracking and project management
- Specmatic: Contract testing, backward compatibility, service virtualization
- Playwright: E2E testing and browser automation
Before any API changes are finalized:
# Validate OpenAPI changes don't break existing consumers
specmatic backward-compatibility-check --target-path ./specs/<feature>/contracts/openapi.yamlRules:
- Adding optional fields: ✅ ALLOWED
- Adding new endpoints: ✅ ALLOWED
- Removing endpoints/fields: ❌ BREAKING
- Changing field types: ❌ BREAKING
Phase 1: API Design
├── openapi-spec-author agent
├── Specmatic backward-compatibility-check
└── Gate: No breaking changes
Phase 2: Parallel Implementation (Backend + Frontend simultaneously)
├── backend-api-engineer
│ └── Uses Specmatic for contract testing
├── frontend-react-engineer
│ └── Uses Specmatic stub server for mocking
└── Both work from same OpenAPI contract
Phase 3: Integration
├── integration-tester agent
├── Playwright for E2E tests
└── Validates full flow
Spec Kit provides specialized agents for different implementation tracks:
| Agent | Role | Tools |
|---|---|---|
openapi-spec-author |
API design, OpenAPI specs, backward compatibility | Specmatic MCP |
backend-api-engineer |
Backend implementation, TDD, contract testing | Specmatic MCP |
frontend-react-engineer |
React/TypeScript, accessibility, mock backends | Specmatic + Playwright MCP |
integration-tester |
E2E testing, performance validation, smoke tests | Playwright MCP |
Sub-agents are invoked during /speckit.implement:
# Standard implementation (sequential)
/speckit.implement
# Parallel implementation with sub-agents
/speckit.implement --parallelEach sub-agent:
- Invokes the
project-standardsskill for constitution guidance - Updates Beads with progress (
bd update,bd note) - Follows TDD (tests first, then implementation)
- Validates against OpenAPI contract
Skills provide on-demand context without polluting the main context window:
| Skill | Purpose | Auto-Invokes When |
|---|---|---|
spec-kit-workflow |
Workflow phase guidance | Discussing features, planning |
beads-integration |
Persistent memory patterns | Task tracking, session persistence |
spec-validation |
Spec quality validation | Reviewing specs, before planning |
project-standards |
Constitution principles | Writing code, making decisions |
For simple changes that don't need full workflow:
/speckit.fix Fix typo in README
/speckit.fix Change button color from blue to green
/speckit.fix Add missing import in UserProfileThis bypasses specify → plan → tasks → implement for trivial fixes while still respecting test gates and project standards.
When making changes to Spec Kit itself:
- Modify templates: Edit files in
.specify/templates/ - Update scripts: Modify bash scripts in
.specify/scripts/bash/ - Enhance commands: Edit slash command files in
.claude/commands/ - Update documentation: Keep README.md and CLAUDE.md in sync
To use Spec Kit in your project:
-
Copy framework files:
cd your-project cp -r /path/to/speckit/.specify ./ mkdir -p .claude/commands cp -r /path/to/speckit/.claude/commands/speckit*.md ./.claude/commands/ cp /path/to/speckit/.claude/settings.json ./.claude/
-
Create project-specific CLAUDE.md: See README.md for example template
-
Customize constitution: Edit
.specify/memory/constitution.mdwith your project's principles -
Start using commands:
/speckit.specify Your first feature description
- Create new command file in
.claude/commands/speckit.newcommand.md - Follow the existing command structure:
- YAML frontmatter with description and handoffs
- Clear outline of command behavior
- Examples and error handling
- Update README.md with command documentation
Templates in .specify/templates/ define the structure of generated documents:
- spec-template.md: User-facing feature specification (WHAT/WHY)
- plan-template.md: Technical implementation plan (HOW)
- tasks-template.md: Executable task list with dependencies
- checklist-template.md: Quality validation checklist
- agent-file-template.md: Agent context and instructions
When modifying templates:
- Maintain clear section headers
- Preserve placeholder syntax
[PLACEHOLDER] - Keep templates technology-agnostic (except plan-template.md)
- Update corresponding slash commands if structure changes
Bash scripts in .specify/scripts/bash/ handle workflow automation:
- common.sh: Shared functions used by other scripts
- check-prerequisites.sh: Validates workflow state and paths
- create-new-feature.sh: Initializes feature branches and directories
- setup-plan.sh: Prepares planning phase artifacts
- update-agent-context.sh: Refreshes agent context files
When modifying scripts:
- Maintain compatibility with both git and non-git repositories
- Use JSON output format for programmatic consumption
- Handle errors gracefully with clear messages
- Update corresponding slash commands if interfaces change
-
Create a test project:
mkdir test-project && cd test-project git init
-
Copy Spec Kit files:
cp -r ../speckit/.specify ./ cp -r ../speckit/.claude/commands/speckit*.md ./.claude/commands/ -
Test full workflow:
/speckit.specify Add sample feature for testing /speckit.plan /speckit.tasks -
Verify outputs:
- Check
specs/001-sample-feature/spec.mdstructure - Validate
plan.mdcompleteness - Verify
tasks.mdformat and dependencies
- Check
Before submitting changes:
- All bash scripts run without errors
- Templates generate valid markdown
- Slash commands follow existing patterns
- Documentation is updated
- Examples in README.md are accurate
Spec Kit is designed to support complex features that span multiple hours or sessions. Follow these practices for continuity:
When resuming work on an existing feature:
-
Re-read all artifacts at session start:
Read: spec.md → plan.md → tasks.md (in that order) -
Check progress state:
- Review completed tasks (checked items in
tasks.md) - Identify current task (first unchecked item)
- Note any blockers or discoveries logged in Beads
- Review completed tasks (checked items in
-
Update timestamps in
tasks.mdheader:## Progress - Started: 2025-01-15 09:00 - Last session: 2025-01-15 14:30 - Current session: 2025-01-16 10:00 - Velocity: ~3 tasks/hour
For long-running tasks, operate with maximum autonomy:
- Resolve ambiguities autonomously rather than stopping to ask for clarification
- Proceed through milestones without prompting for "next steps"
- Make reasonable technical decisions aligned with constitution principles
- Document decisions in the relevant artifact (plan.md for architecture, tasks.md for implementation notes)
When you encounter a decision point:
- Check constitution.md for guidance
- Review similar patterns in existing code
- Make the decision and document it
- Continue working
Only stop to ask the user when:
- The decision has significant cost/risk implications
- Multiple valid approaches exist with major trade-offs
- The requirement is genuinely ambiguous and blocks all progress
At natural stopping points (end of phase, major milestone, session end):
-
Update all living documents:
- Mark completed tasks in
tasks.md - Add implementation notes to
plan.mdif architecture evolved - Log discoveries in Beads
- Mark completed tasks in
-
Commit frequently with descriptive messages:
git commit -m "feat(auth): implement JWT validation middleware [T003]" -
Write breadcrumbs for next session:
## Session Notes - Completed: T001-T005 (auth foundation) - In progress: T006 (rate limiting) - middleware skeleton done - Next: Add Redis backend for rate limit counters - Blocker: None
For tasks spanning 4+ hours:
- Break into sub-milestones mentally (don't expand tasks.md excessively)
- Commit at each sub-milestone even if task isn't complete
- Update Beads with progress notes every 1-2 hours
- Keep artifacts synchronized - if you discover something, document it immediately
- Spec: WHAT the feature does and WHY it matters (user-focused, technology-agnostic)
- Plan: HOW to implement (technical, includes frameworks, architecture, dependencies)
- Tasks: WHEN and in what ORDER (executable, dependency-ordered, with file paths)
Each phase has validation:
- Specify: Spec must be testable, unambiguous, technology-agnostic
- Clarify: Maximum 3 high-impact questions to resolve ambiguities
- Checklist: Domain-specific validation (security, accessibility, etc.)
- Analyze: Cross-artifact consistency check
- Implement: Tests must pass before marking tasks complete
Tasks organized by priority:
- P1: MVP - Minimum viable product
- P2: Important - Should have
- P3: Nice to have - Could have
This enables:
- Independent implementation and testing
- Incremental delivery
- Clear MVP definition
- Cross-platform compatibility (works on macOS, Linux, Windows with Git Bash)
- No additional dependencies
- Easy to read and modify
- Integrates well with git workflows
.claude/: Claude Code-specific integration (slash commands).specify/: Framework core (templates, scripts, principles)- Separation allows non-Claude-Code integrations in the future
- Prevents branch name collisions
- Creates clear ordering and history
- Enables quick feature lookup
- Simplifies cross-referencing
- Bash: Follow Google Shell Style Guide
- Markdown: Use GitHub-flavored markdown
- Templates: Keep language clear and concise
Format: <type>: <description>
Types:
feat: New feature or enhancementfix: Bug fixdocs: Documentation changesrefactor: Code restructuringtest: Test additions or modificationschore: Maintenance tasks
Examples:
feat: Add --parallel flag to speckit.tasksfix: Handle missing spec.md gracefully in check-prerequisites.shdocs: Update README with new workflow examples
- Create feature branch:
###-short-description - Make changes with clear commits
- Update relevant documentation
- Test manually in a sample project
- Submit PR with description of changes
- Review and update templates quarterly
- Keep bash scripts compatible with latest bash versions
- Update documentation for Claude Code changes
- Add new domain checklists as needed
- Use semantic versioning:
MAJOR.MINOR.PATCH - Major: Breaking changes to workflow or command interfaces
- Minor: New features, new commands, template enhancements
- Patch: Bug fixes, documentation updates
For questions or issues:
- Check README.md for usage documentation
- Review existing slash commands for examples
- Examine bash scripts for automation details
- Open GitHub issue for bugs or feature requests
MIT License - See LICENSE file for details.
- Python 3.11+ (backend), TypeScript 5.x/React 18 (frontend) + FastAPI 0.104+, SQLAlchemy 2.0, scikit-learn 1.3+, pandas 2.0+, React 18, React Query, Tailwind CSS (001-market-inventory-predictor)
- PostgreSQL 15+ (primary database), Redis 7+ (caching, session storage) (001-market-inventory-predictor)
- 001-market-inventory-predictor: Added Python 3.11+ (backend), TypeScript 5.x/React 18 (frontend) + FastAPI 0.104+, SQLAlchemy 2.0, scikit-learn 1.3+, pandas 2.0+, React 18, React Query, Tailwind CSS