spec-kit-skill
GitHub Spec-Kit integration for constitution-based spec-driven development. 7-phase workflow (constitution, specify, clarify, plan, tasks, analyze, implement). Use when working with spec-kit CLI, .specify/ directories, or creating specifications with constitution-driven development. Triggered by "spec-kit", "speckit", "constitution", "specify", references to .specify/ directory, or spec-kit commands.
git clone --depth 1 https://github.com/feiskyer/codex-settings /tmp/spec-kit-skill && cp -r /tmp/spec-kit-skill/skills/spec-kit-skill ~/.claude/skills/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](https://github.com/github/spec-kit) to guide you through structured feature development:
1. **Constitution** → Establish governing principles
2. **Specify** → Define functional requirements
3. **Clarify** → Resolve ambiguities
4. **Plan** → Create technical strategy
5. **Tasks** → Generate actionable breakdown
6. **Analyze** → Validate consistency
7. **Implement** → Execute implementation
**Storage**: Creates files in `.specify/specs/NNN-feature-name/` directory with numbered features
## References
- For detailed detection logic and status checks, see `helpers/detection-logic.md`.
- For a runnable status report, use `scripts/detect-phase.sh`.
## 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:
```bash
command -v specify || echo "Not installed"
```
### Installation
If not installed:
```bash
# 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](https://docs.astral.sh/uv/))
### Project Initialization
If CLI is installed but project not initialized:
```bash
# Initialize in current directory
specify init . --ai codex
# Initialize new project
specify init <project-name> --ai codex
# Options:
# --force: Overwrite non-empty directories
# --script ps: Generate PowerShell scripts (Windows)
# --no-git: Skip Git initialization
```
---
<details>
<summary>🔍 Phase Detection Logic</summary>
## Detecting Project State
Before proceeding, always detect the current state:
### 1. CLI Installed?
```bash
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?
```bash
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
```bash
# 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:
```bash
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
```
</details>
<details>
<summary>📜 Phase 1: Constitution</summary>
## 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
1. **Gather Context**
- Understand project domain
- Identify key stakeholders
- Review existing standards (if any)
2. **Draft Constitution**
- Core values and principles
- Technical standards
- Quality expectations
- Decision criteria
3. **Structure**
```markdown
# 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]
```
4. **Versioning**
- Constitution can evolve
- Track changes for governance
- Review periodically
### Example Content
```markdown
# 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%
- Documentation for public APIs
### Performance
- Page load < 3 seconds
- API response < 200ms
- Progressive enhancement for slower connections
## Decision Framework
When choosing between approaches:
1. Does it align with our core values?
2. Is it maintainable by the team?
3. Does it scale with our growth?
4. What's the long-term cost?
```
</details>
<details>
<summary>📝 Phase 2: Specify</summary>
## Specify Phase
Define *what* needs building and *why*, avoiding technology specifics.
### Script Usage
```bash
# Create new feature
.specify/scripts/bash/create-new-feature.sh --json "feature-name"
# Expected JSON output:
# {"BRANCH_NAME": "001-feature-name", "SPEC_FILE": "/path/to/.specify/specs/001-feature-name/spec.md"}
```
**Parse JSON**: Extract `BRANCH_NAME` and `SPEC_FILE` for subsequent operations.
### Template StructureUse when work must continue across multiple Codex sessions with `.autonomous/` tracking, resumable execution, or autonomous handoff. Use for long-running, multi-session, or resume-later tasks.
Use when work should be delegated to Claude Code CLI, especially headless `claude -p` runs, automation scripts, CI jobs, resumable sessions, or requests to use Claude/Claude Code for a task.
深度调研的多实例(多 Agent)编排工作流:把一个调研目标拆成可并行子目标,用 Codex CLI(`codex exec`)在默认 `workspace-write` 沙箱内运行子进程;联网与采集优先使用已安装的 skills,其次使用 MCP 工具;用脚本聚合子结果并分章精修,最终交付“成品报告文件路径 + 关键结论/建议摘要”。用于:系统性网页/资料调研、竞品/行业分析、批量链接/数据集分片检索、长文写作与证据整合,或用户提及“深度调研/Deep Research/Wide Research/多 Agent 并行调研/多进程调研”等场景。
Interactive feature development workflow from idea to implementation. Creates requirements (EARS format), design documents, and implementation task lists. Use when creating feature specs, requirements documents, design documents, or implementation plans. Triggered by "kiro" or references to .kiro/specs/ directory.
Generate, remix, or edit images with Nanobanana / Nano Banana 2 through the bundled Gemini CLI wrapper. Use this whenever the user wants AI image generation or editing, especially for reference-image composition, character consistency, grounded visuals that may need live web search, style transfer, marketing graphics, product mockups, social assets, or when they explicitly mention Nanobanana, Gemini image models, Google image generation, AI drawing, 图片生成, AI绘图, 图片编辑, or 生成图片.
Extract subtitles/transcripts from a YouTube video URL and save as a local file. Use when you need to extract subtitles from a YouTube video.