Version: 1.1.0
A complete Spec-Driven Development (SDD) workflow that transforms how you build software. Start with an idea → Create specifications → Generate plans → Execute tasks. Powered by spec-kit and OpenCode CLI, this skill ensures every line of code has a traceable requirement behind it.
bash
# Initialize spec-kit
cd my-project && specify init --here --ai opencode
# Generate all artifacts
echo "/speckit.constitution" | opencode run # Principles
echo "/speckit.specify" | opencode run # Requirements
echo "/speckit.plan" | opencode run # Architecture
echo "/speckit.tasks" | opencode run # Action items
# Delegate to subagents → then update tracking
echo "/speckit.implement" | opencode run # Marks completed tasks
This skill integrates spec-kit workflow with OpenCode for spec-driven development. Use this workflow to create specifications, plans, and tasks before coding.
These steps must be completed before using any speckit commands.
bash
uv tool install specify-cli --from git+https://github.com/github/spec-kit.git
bash
cd /root/.openclaw/workspace/my-project
specify init --here --ai opencode
After initializing, /speckit.* commands will be available in your project directory.
Execute One Command at a Time - Sequential Execution Required!
bash
echo "/speckit.constitution
Create a project constitution focused on clean code principles, simplicity, and test-driven development.
" | opencode run
✅ Creates: CONSTITUTION.md
bash
echo "/speckit.specify
Create a baseline specification for a Python function that calculates factorial numbers recursively.
" | opencode run
✅ Creates: SPECIFICATION.md
bash
echo "/speckit.plan" | opencode run
✅ Creates: PLAN.md
bash
echo "/speckit.tasks" | opencode run
✅ Creates: TASKS.md
After subagents complete implementation, update tasks.md with execution status:
Option A: Run /speckit.implement directly
bash
echo "/speckit.implement" | /root/.opencode/bin/opencode run
Result: Updates TASKS.md with executed tasks, marks as complete
Option B: Manual update if implementation done externally
bash
# Manually update TASKS.md to mark completed tasks
# or let /speckit.implement scan and update
Key Benefit: /speckit.implement maintains a living task list with execution history
text
┌─────────────────────────────────────────────────────────────────┐
│ 1. /speckit.constitution → CONSTITUTION.md (principles) │
└─────────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────────┐
│ 2. /speckit.specify → SPECIFICATION.md (requirements) │
└─────────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────────┐
│ 3. /speckit.plan → PLAN.md (implementation phases) │
└─────────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────────┐
│ 4. /speckit.tasks → TASKS.md (actionable tasks) │
└─────────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────────┐
│ 5. Subagents read all artifacts and implement │
│ - CONSTITUTION.md, SPECIFICATION.md, PLAN.md, TASKS.md │
└─────────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────────┐
│ 6. /speckit.implement → Updates TASKS.md with status │
│ - Marks [x] completed tasks │
│ - Adds timestamps and metadata │
│ - Maintains living task list │
└─────────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────────┐
│ 7. Code implementation complete with tracked progress │
└─────────────────────────────────────────────────────────────────┘
Install spec-kit: bash
uv tool install specify-cli --from git+https://github.com/github/spec-kit.git
Initialize spec-kit in your project: bash
cd ~/project
specify init --here --ai opencode
Execute workflow SEQUENTIALLY:
Create Constitution bash
echo "/speckit.constitution
Create a project constitution focused on clean code principles.
" | opencode run
Create Specification bash
echo "/speckit.specify
Create a REST API for user management.
" | opencode run
Create Plan bash
echo "/speckit.plan" | opencode run
Generate Tasks bash
echo "/speckit.tasks" | opencode run
Delegate to Subagents:
Update Tasks with Execution Status: bash
echo "/speckit.implement" | /root/.opencode/bin/opencode run
This updates TASKS.md to track what has been implemented.
bash
# Prerequisites (MUST DO FIRST!)
uv tool install specify-cli --from git+https://github.com/github/spec-kit.git
cd ~/my-new-project
specify init --here --ai opencode
# Step 1: Create Constitution
echo "/speckit.constitution
Create a project constitution focused on clean code principles.
" | opencode run
# Step 2: Create Specification
echo "/speckit.specify
Create a REST API for user management.
" | opencode run
# Step 3: Generate Plan
echo "/speckit.plan" | opencode run
# Step 4: Generate Tasks
echo "/speckit.tasks" | opencode run
# Step 5: Delegate to subagent (read all artifacts first)
# Step 6: Update tasks.md with execution status
echo "/speckit.implement" | /root/.opencode/bin/opencode run
# This updates TASKS.md marking completed tasks
bash
# Step 1: Create specification for new feature
echo "/speckit.specify
Add authentication endpoints with JWT support.
" | opencode run
# Step 2: Generate plan
echo "/speckit.plan" | opencode run
# Step 3: Generate tasks
echo "/speckit.tasks" | opencode run
# Step 4: Delegate to subagent (read all artifacts first)
# Step 5: Update tasks.md with execution status
echo "/speckit.implement" | /root/.opencode/bin/opencode run
# This updates TASKS.md marking completed tasks
❌ DO NOT try to use speckit commands before initialization:
bash
cd /root/.openclaw/workspace/new-project
echo "/speckit.constitution" | opencode run # Won't work!
✅ Do this instead:
bash
cd /root/.openclaw/workspace/new-project
specify init --here --ai opencode # DO THIS FIRST
echo "/speckit.constitution" | opencode run # NOW it works
❌ DO NOT pipe multiple commands:
bash
{ echo "/speckit.constitution"; echo "/speckit.specify"; } | opencode run
❌ DO NOT skip /speckit.implement after implementation:
bash
# Wrong: TASKS.md stays with checkboxes empty
# Right:
echo "/speckit.implement" | opencode run # Updates TASKS.md
Why: Without updating TASKS.md, you lose track of what was actually implemented vs what was planned.
❌ DO NOT execute without reading spec context:
bash
# Wrong: Subagent doesn't have spec context
sessions_spawn task="Implement authentication"
# Right: Subagent reads all artifacts
sessions_spawn task="Read CONSTITUTION.md, SPECIFICATION.md, PLAN.md, TASKS.md first."
Benefits:
Best Practice:
/speckit.implement AFTER subagents complete workPurpose: Updates TASKS.md with execution status, marking completed tasks and tracking implementation progress.
When you run /speckit.implement, the system:
bash
echo "/speckit.implement" | /root/.opencode/bin/opencode run
After running /speckit.implement, TASKS.md transforms from:
Before:
markdown
## Tasks
- [ ] Create HTML structure
- [ ] Implement CSS styling
- [ ] Add JavaScript functionality
After:
markdown
## Tasks
- [x] Create HTML structure (completed 2026-02-11 19:42 UTC)
- [ ] Implement CSS styling (in progress)
- [ ] Add JavaScript functionality (pending)
TimingActionAfter subagent completesRun /speckit.implement to track progressBefore reviewCheck which tasks are done vs pendingAfter each featureUpdate task statusEnd of sessionFinal update for audit trail
If implementation was done externally:
bash
# Edit TASKS.md manually to mark completed tasks:
- [x] Task completed
- [ ] Task pending
Or use the subagent to scan and update automatically.
/speckit.implement after EVERY subagent taskWhen using OpenCode for coding tasks, the system follows this fallback strategy:
PriorityModelProviderRolePrimaryopencode/kimi-k2.5-freeOpenCodeMain model for coding tasksFallback 1opencode/minimax-m2.1-freeOpenCodeHigh-quality alternativeFallback 2opencode/glm-4.7-freeOpenCodeEfficient standard tasksSecundárioopenrouter/xiaomi/mimo-v2-flashOpenRouterCross-provider backup
json
{
"primary": "opencode/kimi-k2.5-free",
"fallbacks": [
"opencode/minimax-m2.1-free",
"opencode/glm-4.7-free"
]
}
Cross-Provider Backup: When OpenCode models are rate-limited or unavailable, the system falls back to openrouter/xiaomi/mimo-v2-flash (OpenRouter) for cross-provider resilience.
The primary model ( kimi-k2.5-free) is used first, and if unavailable, the system automatically falls back through the other models in order.
Default Model: opencode/kimi-k2.5-free
OpenCode is the preferred coding agent for this workspace. It uses kimi-k2.5-free as the primary model with automatic fallbacks to other free models.
bash
# Basic usage (uses default kimi-k2.5-free model)
bash workdir:~/project background:true command:"opencode run \"Your task\""
# Explicit model specification (optional, defaults to kimi-k2.5-free)
bash workdir:~/project background:true command:"opencode run --model opencode/kimi-k2.5-free \"Your task\""
# If primary is unavailable, it automatically falls back:
# minimax-m2.1-free → glm-4.7-free → (openrouter/xiaomi/mimo-v2-flash as cross-provider backup)
bash
# Create temp space for chats/scratch work
SCRATCH=$(mktemp -d)
# Start agent in target directory ("little box" - only sees relevant files)
bash workdir:$SCRATCH background:true command:"<agent command>"
# Or for project work:
bash workdir:~/project/folder background:true command:"<agent command>"
# Returns sessionId for tracking
# Monitor progress
process action:log sessionId:XXX
# Check if done
process action:poll sessionId:XXX
# Send input (if agent asks a question)
process action:write sessionId:XXX data:"y"
# Kill if needed
process action:kill sessionId:XXX
Why workdir matters: Agent wakes up in a focused directory, doesn't wander off reading unrelated files.
Model: gpt-5.2-codex is the default (set in ~/.codex/config.toml)
bash
# --full-auto: sandboxed but auto-approves in workspace
bash workdir:~/project background:true command:"codex exec --full-auto \"Build a snake game with dark theme\""
# --yolo: NO sandbox, NO approvals (fastest, most dangerous)
bash workdir:~/project background:true command:"codex --yolo \"Build a snake game with dark theme\""
Avoid reviewing PRs in the live clawdbot project folder. Use the project where the PR is submitted (if it's NOT ~/Projects/clawdbot), or clone to a temp folder first.
bash
# Option 1: Review in the actual project (if NOT clawdbot)
bash workdir:~/Projects/some-other-repo background:true command:"codex review --base main"
# Option 2: Clone to temp folder for safe review (REQUIRED for clawdbot PRs!)
REVIEW_DIR=$(mktemp -d)
git clone https://github.com/clawdbot/clawdbot.git $REVIEW_DIR
cd $REVIEW_DIR && gh pr checkout 130
bash workdir:$REVIEW_DIR background:true command:"codex review --base origin/main"
Why? Checking out branches in the running Clawdbot repo can break the live instance!
bash
bash workdir:~/project background:true command:"claude \"Your task\""
bash
# Install: npm install -g @mariozechner/pi-coding-agent
bash workdir:~/project background:true command:"pi \"Your task\""
--print / -p: non-interactive; runs prompt and exits.--provider <name>: pick provider (default: google).--model <id>: pick model (default: gemini-2.5-flash).Examples:
bash
# Set provider + model, non-interactive
bash workdir:~/project background:true command:"pi --provider openai --model gpt-4o-mini -p \"Summarize src/\""
Use the tmux skill for interactive coding sessions (always, except very simple one-shot prompts). Prefer bash background mode for non-interactive runs.
For fixing multiple issues in parallel, use git worktrees (isolated branches) + tmux sessions:
bash
# 1. Clone repo to temp location
cd /tmp && git clone git@github.com:user/repo.git repo-worktrees
cd repo-worktrees
# 2. Create worktrees for each issue (isolated branches!)
git worktree add -b fix/issue-78 /tmp/issue-78 main
git worktree add -b fix/issue-99 /tmp/issue-99 main
# 3. Set up tmux sessions
SOCKET="${TMPDIR:-/tmp}/codex-fixes.sock"
tmux -S "$SOCKET" new-session -d -s fix-78
tmux -S "$SOCKET" new-session -d -s fix-99
# 4. Launch Codex in each (after pnpm install!)
tmux -S "$SOCKET" send-keys -t fix-78 "cd /tmp/issue-78 && pnpm install && codex --yolo 'Fix issue #78.'" Enter
tmux -S "$SOCKET" send-keys -t fix-99 "cd /tmp/issue-99 && pnpm install && codex --yolo 'Fix issue #99.'" Enter
# 5. Monitor progress
tmux -S "$SOCKET" capture-pane -p -t fix-78 -S -30
# 6. Cleanup
tmux -S "$SOCKET" kill-server
git worktree remove /tmp/issue-78
git worktree remove /tmp/issue-99
Why worktrees? Each Codex works in isolated branch, no conflicts. Can run 5+ parallel fixes!