Loading...
Loading...
Spec-driven development pipeline orchestrator. Given a URL or text description, automatically generates specs, implements code, runs codex review, applies security gate, executes tests, syncs docs, and notifies via Telegram. Triggers on: /start-workflow, start workflow, build feature, implement feature, spec-driven, start pipeline.
npx skill4agent add celery8911/workflow-skills start-workflow/start-workflow
/start-workflow {url | text description}
/start-workflow --resume
/start-workflow --resume <run_id>| Param | Description |
|---|---|
| (none) | Prompt the user to enter their requirement |
| Feature requirement — URL to a spec/issue, or plain text description |
| Auto-find recent runs and let user pick one to resume |
| Resume a specific previous run from its last completed phase |
/start-workflow --resumels -dt /tmp/workflow-*/state.json 2>/dev/null | head -10run_idfeature_namephasestatusstarted_at找到以下未完成的 workflow:
— health-check — 中断于 coding(2026-04-12 14:32)ab12cd34 — user-auth — 中断于 code-review(2026-04-11 09:15)ef56gh78请回复编号选择要恢复的 run,或回复 n 取消:
run_id没有找到可恢复的 workflow run。请直接用开始新的任务。/start-workflow {需求}
statusDONE/start-workflow请描述你想要实现的功能,或者粘贴一个需求链接(GitHub Issue、文档 URL 等):
input_rawissues/42user-auth-revamphealth-check功能名称:(如需修改请直接回复新名称,确认则回复 ok)health-check
~/.claude/skills/.claude/skills/SKILL_DIR=$(find \
.claude/skills ~/.claude/skills \
.cursor/skills ~/.cursor/skills \
.windsurf/skills ~/.windsurf/skills \
.cline/skills ~/.cline/skills \
.agents/skills ~/.agents/skills \
-maxdepth 1 -name start-workflow -type d 2>/dev/null | head -1)
SKILLS_BASE="$SKILL_DIR/skills"$SKILL_DIR$SKILLS_BASEbash "$SKILL_DIR/setup.sh"~/.claude/.envTG_CHAT_IDgit rev-parse --git-dir 2>/dev/null当前目录不是 git 仓库,openspec 需要 git 环境。是否现在初始化?(会执行和一个空 commit)git init
git init.gitignore# Dependencies
node_modules/
.venv/
__pycache__/
*.pyc
# Lock files (tracked but excluded from review diffs)
# package-lock.json and yarn.lock are intentionally committed
# Build output
dist/
build/
.next/
out/
# Environment
.env
.env.local
.env.*.local
# Editor & OS
.DS_Store
.idea/
.vscode/
*.swpgit add .gitignore
git commit -m "chore: init with .gitignore"RUN_DIR=$(python3 "$SKILL_DIR/scripts/bootstrap.py" \
"{feature_name}" "{input_raw}" "{tg_chat_id}")
python3 "$SKILL_DIR/scripts/detect-input.py" "$RUN_DIR/state.json"--resume <run_id>RUN_DIR=/tmp/workflow-<run_id>status: done--resume$SKILLS_BASE/spec-writer/SKILL.mdRUN_DIRPROJECT_DIRstate.fetched_contentstate['phases']['spec-writer']['status'] = 'done'
state['phase'] = 'coding'{specs_dir}/tasks.mdgit add -A && git commit -m "feat: {task_name}"state.phases.coding.last_taskstate['phases']['coding']['status'] = 'done'
state['phase'] = 'code-review'$SKILLS_BASE/code-reviewer/SKILL.mdRUN_DIRPROJECT_DIR{specs_dir}/specs{specs_dir}/designauthauthenticationauthorizationpaymentbillingPIIpersonal dataencryptionadminprivilegesudorootstate.phases.security-gate.status = skippedMSG_ID=$(python3 "$SKILL_DIR/scripts/tg-send.py" \
"$TG_CHAT_ID" \
"⚠️ *需要安全审批*\n\n功能:{feature_name}({run_id})\n\n未解决问题:\n{findings_list}\n\n回复 /approve 继续,或 /deny 终止。")
python3 "$SKILL_DIR/scripts/tg-poll-approval.py" \
"$TG_CHAT_ID" "$MSG_ID" --timeout 3600
APPROVAL_EXIT=$?
# 0=approved, 1=denied, 2=timeout→treat as denied$SKILLS_BASE/test-runner/SKILL.mdRUN_DIRPROJECT_DIRcd "$PROJECT_DIR"
openspec archive "{feature_name}" --yes 2>&1
ARCHIVE_EXIT=$?openspec archive.openspec/changes/{feature_name}/git add -A
git commit -m "chore: archive openspec change {feature_name}"state.phases.openspec-archive.status$SKILLS_BASE/doc-syncer/SKILL.mdRUN_DIRPROJECT_DIRstate['status'] = 'DONE'
state['phase'] = 'done'
state['completed_at'] = datetime.now(timezone.utc).isoformat()TG_CHAT_ID{specs_dir}/proposal{specs_dir}/tasks$RUN_DIR/review-round-*.txtpython3 "$SKILL_DIR/scripts/tg-send.py" \
"$TG_CHAT_ID" \
"✅ *工作流完成*\n\n📦 *{feature_name}*({run_id})\n⏱ 耗时:{duration}\n\n🎯 *功能概述*\n{proposal_summary}\n\n✅ *已实现*\n{tasks_summary}\n\n🔍 *代码审查*({review_rounds} 轮)\n{review_findings_summary}\n\n🧪 *测试*:{test_result_summary}\n\n📁 归档:{archive_status} | 📝 文档:{doc_sync_status}"python3 - "$RUN_DIR/state.json" << 'PYEOF'
import json, os, sys
state_file = sys.argv[1]
state = json.load(open(state_file, encoding='utf-8'))
# modify state...
tmp = state_file + '.tmp.' + str(os.getpid())
with open(tmp, 'w', encoding='utf-8') as f:
json.dump(state, f, ensure_ascii=False, indent=2)
os.replace(tmp, state_file)
PYEOFstate.status = ERRORstate.error = <message>--resume