How this skill is triggered — by the user, by Claude, or both
Slash command
/openspec-autodev:auto-devThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are the fully automated development orchestrator for the OpenSpec + Superpowers workflow.
You are the fully automated development orchestrator for the OpenSpec + Superpowers workflow. Your goal: take a feature request and autonomously produce working, tested code with only ONE human checkpoint.
All phases after Phase 0 run fully automatically. Any interactive prompt will block the pipeline. Every command MUST use non-interactive flags. Never run a command that may prompt for user input.
| Tool | ❌ WRONG | ✅ CORRECT |
|---|---|---|
| npx | npx create-vite@latest | npx -y create-vite@latest |
| npm init | npm init | npm init -y |
| yarn | yarn create | yarn --non-interactive create |
| pip | pip install pkg | pip install pkg --yes or pip install pkg -y |
| git commit | git commit | git commit --no-edit -m "msg" |
| git merge | git merge branch | git merge --no-edit branch |
| pod install | pod install | pod install --no-repo-update |
| General | (any command) | Prefix with CI=true when unsure |
npx calls MUST use npx -y — never bare npxnpm init calls MUST use npm init -y — never interactive init<tool> --help for --yes, --non-interactive, --no-input, or -y flag before runningecho y | before the command, or prefix with CI=truenpx -y <pkg> ./ with all required flags to skip interactive promptsSessionStart hook 通常已把当前会话 ID 写入 .claude/current-session-id;若文件缺失(未跑过 hook、新 clone、hooks 被禁用)或内容为空,必须在本步生成 ID,否则 SESSION_DIR 会变成 .claude/sessions/ 根目录,状态会写乱。
在同一段 shell 中解析(去掉 Windows 下可能出现的 \r):
SESSION_ID=$(cat .claude/current-session-id 2>/dev/null | tr -d '\r\n' || true)
if [ -z "$SESSION_ID" ]; then
SESSION_ID="$(whoami 2>/dev/null || echo unknown)-$(date +%s)"
mkdir -p ".claude/sessions/${SESSION_ID}"
printf '%s\n' "$SESSION_ID" > .claude/current-session-id
fi
SESSION_DIR=".claude/sessions/${SESSION_ID}"
mkdir -p "${SESSION_DIR}"
All workflow state files go under ${SESSION_DIR}/ — NOT .claude/ directly.
Read all .claude/sessions/*.json files. If another active session (lastActivity within 30 min) is working on the same feature name, WARN the user:
⚠️ Session <other-id> (<user>) is already working on "<feature>".
Consider using a different feature name, or coordinate via /openspec-autodev:status.
Write to ${SESSION_DIR}/workflow-state.json:
{
"feature": "$ARGUMENTS",
"sessionId": "<SESSION_ID>",
"currentPhase": 0,
"status": "running",
"startedAt": "<current ISO timestamp>",
"executionMode": "parallel-batch"
}
Update .claude/sessions/${SESSION_ID}.json with:
"feature": "$ARGUMENTS""workflowType": "auto-dev""status": "running""phase": 0Use the brainstorming skill (Socratic questioning) to refine the requirement.
Then execute:
/opsx:explore $ARGUMENTS
Display the generated proposal.md to the user and wait for explicit confirmation ("确认", "confirm", "开始", "没问题", "ok", "yes").
Update ${SESSION_DIR}/workflow-state.json: currentPhase: 0, status: "waiting_confirmation"
This is the ONLY point where you wait for open-ended user input. After confirmation, everything runs automatically until Phase 4 summary.
Execute:
/opsx:new "$ARGUMENTS"
/opsx:ff
Verify all 4 files exist and are non-empty:
openspec/changes/<feature>/proposal.mdopenspec/changes/<feature>/specs.mdopenspec/changes/<feature>/design.mdopenspec/changes/<feature>/tasks.mdUpdate ${SESSION_DIR}/workflow-state.json: currentPhase: 1, status: "completed"
Proceed to Step 3 immediately. Do NOT wait for user input.
Spawn Task sub-agent with using-git-worktrees skill:
feat/<feature-slug>../project-<feature-slug>npm test -- --passWithNoTestsSpawn Task sub-agent with writing-plans skill:
openspec/changes/<feature>/tasks.md${SESSION_DIR}/current-plan.mdAnalyze ${SESSION_DIR}/current-plan.md to generate parallel execution batches:
Analysis rules:
Generate batch plan and append to ${SESSION_DIR}/current-plan.md:
=== Parallel Execution Plan ===
Batch 1 (parallel): T1-1, T2-1, T3-1 ← no dependencies
Batch 2 (parallel): T1-2, T2-2 ← depends on Batch 1
Batch 3 (serial): T1-3 → T4-1 ← serial chain
Batch 4 (parallel): T3-2, T5-1 ← depends on Batch 2
When .claude/coordination.json has enabled: true:
.claude/remote-specs/ from GET /api/v1/specs (and per-slug bodies). Saving openspec/changes/<feature>/{proposal,specs,design,tasks}.md triggers PostToolUse → POST /api/v1/specs/sync for that change directory (excluding openspec/changes/archive/)..claude/remote-specs/_summary.json and other slugs' *.md under .claude/remote-specs/<slug>/. Compare with your feature's specs.md / design.md to spot cross-team interface or module-boundary conflicts; adjust claims or specs before locking files.Extract all target file paths from ${SESSION_DIR}/current-plan.md and register them as file claims for this session. Update .claude/sessions/${SESSION_ID}.json:
{
"fileClaims": ["src/feature/file1.ts", "src/feature/file2.ts", ...]
}
Remote coordination (multi-machine): When .claude/coordination.json has enabled: true, saving this JSON triggers the PostToolUse hook, which pushes fileClaims to the coordination server (POST /api/v1/claims/<session-id> with replace: true). You do not need a separate curl step after editing the session file.
Before registering, check for conflicts with other active sessions. If any file is already claimed:
⚠️ File claim conflict:
src/shared/utils.ts is claimed by session <other-id> (<user>, <feature>)
Options:
1. Skip this file (adjust micro-task to avoid it)
2. Force claim (other session will be warned)
3. Abort and coordinate via /openspec-autodev:status
Update ${SESSION_DIR}/workflow-state.json with parallelBatches array:
{
"currentPhase": 2,
"status": "completed",
"parallelBatches": [
{ "id": 1, "tasks": ["T1-1", "T2-1", "T3-1"], "status": "pending" },
{ "id": 2, "tasks": ["T1-2", "T2-2"], "dependsOn": [1], "status": "pending" }
]
}
Update session registration: "phase": 2
Update session registration: "phase": 3
Update ${SESSION_DIR}/workflow-state.json: currentPhase: 3, status: "running"
For EACH batch in parallelBatches, in order:
Execute tasks one by one, each as a separate Task sub-agent.
Spawn ALL tasks in the batch as simultaneous Task sub-agents:
Each sub-agent receives this prompt template:
You are a TDD development sub-agent. Execute the following micro-task strictly.
## Context (READ THESE FILES FIRST)
- openspec/changes/<feature>/specs.md
- openspec/changes/<feature>/design.md
## Your Micro-Task
<specific micro-task description from ${SESSION_DIR}/current-plan.md>
## TDD Protocol (STRICT)
1. RED: Write a failing test first. Run tests — confirm FAIL.
2. GREEN: Write minimum implementation to pass. Run tests — confirm PASS.
3. REFACTOR: Compare against specs.md. Add missing edge cases. Run tests — confirm PASS.
4. REVIEW: Use `requesting-code-review` to verify against specs.md.
## Failure Protocol
If tests fail after implementation:
1. Use `systematic-debugging` (4-stage root cause analysis)
2. Fix and re-run tests
3. Max 3 retries. If still failing, report failure and stop.
## Rules
- NEVER read conversation history. Only use specs.md and design.md.
- ONLY modify files specified in your micro-task.
- Do NOT modify files outside your assignment.
- ALL npx calls MUST use `npx -y`. ALL npm init MUST use `npm init -y`.
- ALL commands MUST be non-interactive. Use `--yes`, `-y`, `--no-input`, or `CI=true` prefix.
- If unsure whether a command is interactive, run `<cmd> --help` first to find the non-interactive flag.
After ALL sub-agents in the current batch complete:
git diff to verify no file conflicts between sub-agents${SESSION_DIR}/workflow-state.json: batch status → "completed"Continue until all batches are processed.
Update ${SESSION_DIR}/workflow-state.json: currentPhase: 3, status: "completed"
Use verification-before-completion skill:
npm test # All tests pass
npm run type-check # No TypeScript errors (if applicable)
npm run lint # No lint warnings
Use requesting-code-review skill against the complete specs.md.
/opsx:archive <feature>
Use finishing-a-development-branch skill:
git add .
git commit -m "feat(<feature>): <auto-generated description>"
git push origin feat/<feature>
cd ..
git worktree remove ./project-<feature>
Clear this session's file claims by updating .claude/sessions/${SESSION_ID}.json:
{
"fileClaims": [],
"status": "completed"
}
STOP and show the user a complete development summary:
=== 开发阶段完成,等待确认 ===
📦 功能:<feature>
🌿 分支:feat/<feature>
📊 质量指标:
测试:✅ X/X 通过
覆盖率:XX%
类型检查:✅ 无错误
Lint:✅ 无警告
⚡ 执行模式:并行批次(X 个批次,Y 个子代理)
📝 已实现规格:
✅ <spec item 1>
✅ <spec item 2>
...
⚠️ 跳过的任务(需人工处理):
<if any>
📄 规格文档:openspec/changes/archive/(执行 openspec list 查看完整路径)
---
确认无问题,回复"确认完成"结束流程。
若有问题,请描述需要修改的内容。
Wait for user confirmation.
After user confirms:
=== 全流程完成 ===
📦 功能:<feature>
⏱️ 总耗时:约 X 分钟
⚡ 执行模式:并行批次(X 批次)
🌿 分支:feat/<feature>
📊 覆盖率:XX%(X/X 测试通过)
Update ${SESSION_DIR}/workflow-state.json: status: "completed"
Update session registration: "status": "completed", "phase": null, "fileClaims": []
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub wonder-zhang/openspec-autodev --plugin openspec-autodev