spec-kit-skill
from feiskyer/claude-code-settings
Claude Code settings, commands and agents for vibe coding
npx skills add https://github.com/feiskyer/claude-code-settings --skill spec-kit-skillSKILL.md
Spec-Kit: Constitution-Based Spec-Driven Development
Official GitHub Spec-Kit integration providing a 7-phase constitution-driven workflow for feature development.
Quick Start
This skill works with the GitHub Spec-Kit CLI to guide you through structured feature development:
- Constitution → Establish governing principles
- Specify → Define functional requirements
- Clarify → Resolve ambiguities
- Plan → Create technical strategy
- Tasks → Generate actionable breakdown
- Analyze → Validate consistency
- Implement → Execute implementation
Storage: Creates files in .specify/specs/NNN-feature-name/ directory with numbered features
When to Use
- Setting up spec-kit in a project
- Creating constitution-based feature specifications
- Working with .specify/ directory
- Following GitHub spec-kit workflow
- Constitution-driven development
Prerequisites & Setup
Check CLI Installation
First, verify if spec-kit CLI is installed:
command -v specify || echo "Not installed"
Installation
If not installed:
# Persistent installation (recommended)
uv tool install specify-cli --from git+https://github.com/github/spec-kit.git
# One-time usage
uvx --from git+https://github.com/github/spec-kit.git specify init <PROJECT_NAME>
Requirements:
- Python 3.11+
- Git
- uv package manager (install uv)
Project Initialization
If CLI is installed but project not initialized:
# Initialize in current directory
specify init . --ai claude
# Initialize new project
specify init <project-name> --ai claude
# Options:
# --force: Overwrite non-empty directories
# --script ps: Generate PowerShell scripts (Windows)
# --no-git: Skip Git initialization
🔍 Phase Detection Logic
Detecting Project State
Before proceeding, always detect the current state:
1. CLI Installed?
if command -v specify &> /dev/null || [ -x "$HOME/.local/bin/specify" ]; then
echo "CLI installed"
else
echo "CLI not installed - guide user through installation"
fi
2. Project Initialized?
if [ -d ".specify" ] && [ -f ".specify/memory/constitution.md" ]; then
echo "Project initialized"
else
echo "Project not initialized - guide user through 'specify init'"
fi
3. Current Feature
# Get latest feature directory
LATEST=$(ls -d .specify/specs/[0-9]* 2>/dev/null | sort -V | tail -1)
echo "Latest feature: $LATEST"
4. Current Phase
Detect phase by checking file existence in latest feature:
FEATURE_DIR=".specify/specs/001-feature-name"
if [ ! -f ".specify/memory/constitution.md" ]; then
echo "Phase: constitution"
elif [ ! -d "$FEATURE_DIR" ]; then
echo "Phase: specify"
elif [ -f "$FEATURE_DIR/spec.md" ] && ! grep -q "## Clarifications" "$FEATURE_DIR/spec.md"; then
echo "Phase: clarify"
elif [ ! -f "$FEATURE_DIR/plan.md" ]; then
echo "Phase: plan"
elif [ ! -f "$FEATURE_DIR/tasks.md" ]; then
echo "Phase: tasks"
elif [ -f "$FEATURE_DIR/tasks.md" ] && grep -q "\\- \\[ \\]" "$FEATURE_DIR/tasks.md"; then
echo "Phase: implement"
else
echo "Phase: complete"
fi
📜 Phase 1: Constitution
Constitution Phase
Establish foundational principles that govern all development decisions.
Purpose
Create .specify/memory/constitution.md with:
- Project values and principles
- Technical standards
- Decision-making frameworks
- Code quality expectations
- Architecture guidelines
Process
-
Gather Context
- Understand project domain
- Identify key stakeholders
- Review existing standards (if any)
-
Draft Constitution
- Core values and principles
- Technical standards
- Quality expectations
- Decision criteria
-
Structure
# Project Constitution
## Core Values
1. **[Value Name]**: [Description and implications]
2. **[Value Name]**: [Description and implications]
## Technical Principles
### Architecture
- [Principle with rationale]
### Code Quality
- [Standards and expectations]
### Performance
- [Performance criteria]
## Decision Framework
When making technical decisions, consider:
1. [Criterion with priority]
2. [Criterion with priority]
- Versioning
- Constitution can evolve
- Track changes for governance
- Review periodically
Example Content
# Project Constitution
## Core Values
1. **Simplicity Over Cleverness**: Favor straightforward solutions that are easy to understand and maintain over clever optimizations.
2. **User Experience First**: Every technical decision should improve or maintain user experience.
## Technical Principles
### Architecture
- Prefer composition over inheritance
- Keep components loosely coupled
- Design for testability
### Code Quality
- Code reviews required for all changes
- Unit test coverage > 80%
- Documentat
...