一键导入
specflow-resume
從 .specflow/state.json 讀取 SpecFlow 流程進度,重建狀態後繼續執行。在 /clear context 之後、或重開 session 時用來接續工作。觸發關鍵字:"resume", "繼續", "接續"。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
從 .specflow/state.json 讀取 SpecFlow 流程進度,重建狀態後繼續執行。在 /clear context 之後、或重開 session 時用來接續工作。觸發關鍵字:"resume", "繼續", "接續"。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
啟動完整的 specflow 專案流程。使用者只需與 spec agent 對話確認需求和架構,之後 tech-lead → (engineer + qa 並行) → verify → release 全部自動背景執行。觸發關鍵字:"start", "開始", "啟動專案", "新專案"。
啟動實作流程(Lane 制:每個類型同時最多 1 個 agent)。Backend / Frontend / Pipeline 各自 1 個 engineer,加 1 個 QA、1 個 UI Designer,共最多 5 個 background agent。觸發關鍵字:"implement", "實作", "開發"。
啟動 QA 撰寫 Playwright e2e tests。根據 spec .md 中的 acceptance criteria 撰寫 Playwright 測試,與 engineer 同時進行。觸發關鍵字:"qa", "測試", "test", "e2e"。
對當前 sprint 進行三維度驗證:Completeness(完整性)、Correctness(正確性)、Coherence(一致性)。在 QA 通過後、release 前執行。觸發關鍵字:"verify", "驗證", "檢查"。
為已完成的專案新增需求變更(Change Request)。spec-writer 評估影響範圍 → 建立 CR 文件 + 新 Sprint milestone → 走原本的 tech-lead → engineer + qa → verify 流程。觸發關鍵字:"change", "新需求", "需求變更", "CR", "後續功能", "新增功能"。
更新本機 SpecFlow 安裝到 upstream 最新版。Fetch 最新 .claude/ 與 CLAUDE.md,顯示變更摘要,保留本地自訂後套用。觸發關鍵字:"update", "升級", "更新 specflow"。
| name | specflow:resume |
| description | 從 .specflow/state.json 讀取 SpecFlow 流程進度,重建狀態後繼續執行。在 /clear context 之後、或重開 session 時用來接續工作。觸發關鍵字:"resume", "繼續", "接續"。 |
| user-invocable | true |
| allowed-tools | Read, Bash, Agent, AskUserQuestion |
SpecFlow 流程跨多個 phase 可能持續好幾小時,對話 context 會被 /clear 或溢出截斷。
所有持久狀態都寫在 .specflow/state.json + GitHub Issues,這個 skill 從這些 source of truth 重建狀態繼續跑。
bash .claude/scripts/state.sh show
如果檔案不存在 → 告知使用者「沒有進行中的流程,請用 /specflow:start 開始」。
對照 state.json 與當前 GitHub 狀態(避免依賴可能過時的 in_flight_agents):
# 當前 sprint milestone
gh api "repos/:owner/:repo/milestones?state=open&sort=title" --jq '[.[] | select(.title | startswith("Sprint"))][0]'
# Sprint 內未關閉的 issue
gh issue list --milestone "$SPRINT" --state open --json number,title,labels,assignees
# 進行中的 PR
gh pr list --state open --json number,title,headRefName,statusCheckRollup,reviewDecision
用簡短格式(不要 dump 整個 state.json):
📍 接續 Sprint {N}(phase: {phase})
進行中:
- PR #47 (engineer, feature F-002) — review 第 2/3 輪
- PR #48 (qa) — APPROVED, waiting merge
- Issue #51 (bug) — open
下一步:{next_action}
AskUserQuestion({
questions: [{
question: "要從這裡繼續嗎?",
header: "Resume",
multiSelect: false,
options: [
{ label: "繼續 (Recommended)", description: "從 next_action 接著跑" },
{ label: "重新評估", description: "我想看更多細節再決定" },
{ label: "重來這個 phase", description: "把當前 phase 重跑一次" }
]
}]
})
決策前先讀 lane_closed + GitHub 即時狀態,避免重啟已完成的 lane:
LANE_CLOSED=$(bash .claude/scripts/state.sh get lane_closed)
SPRINT_TEST_OUTCOME=$(bash .claude/scripts/state.sh get sprint_test_outcome)
SPRINT="{current_sprint}"
# 用 GitHub 即時資料校正(state.json 可能過時)
OPEN_FEATURE=$(gh issue list --milestone "$SPRINT" --label "feature" --state open --json number --jq 'length')
OPEN_DESIGN=$(gh issue list --milestone "$SPRINT" --label "design" --state open --json number --jq 'length')
OPEN_QA=$(gh issue list --milestone "$SPRINT" --label "qa" --state open --json number --jq 'length')
OPEN_BUG=$(gh issue list --milestone "$SPRINT" --label "bug" --state open --json number --jq 'length')
ALL_LANES_CLOSED="false"
[ "$OPEN_FEATURE" = "0" ] && [ "$OPEN_DESIGN" = "0" ] && [ "$OPEN_QA" = "0" ] && [ "$OPEN_BUG" = "0" ] && ALL_LANES_CLOSED="true"
| phase | 跳過條件 | 接續動作 |
|---|---|---|
phase-2-spec | — | 啟動 spec-writer 繼續討論 |
phase-3-techlead | feature/qa/design issues 已存在 → 跳到 phase-4 | 啟動 tech-lead(背景) |
phase-4-impl | ALL_LANES_CLOSED=true → 跳到 phase-5 | 只啟動 OPEN_$LANE > 0 的 lane(不要重啟已 drained) |
phase-4.5-review | open PR 已全部 APPROVED → 跳到 phase-4-impl 等 merge | 對 open 且 review pending 的 PR 啟動 code-review |
phase-5-e2e | sprint_test_outcome=success → 跳到 phase-5.5;failure → 確認最新 bug issue 是否已關,否則回 phase-4 | 輪詢 sprint-test workflow 結果 |
phase-5.5-verify | sprint issue 已 closed → 跳到 phase-7 | 啟動 verifier |
phase-6-close | milestone 已 closed → phase-7 | 產出 sprint log + 關 milestone(verifier 會做) |
phase-7-next | — | 詢問是否進入下一個 sprint |
phase 字串只做提示,用子字串模糊比對不要精確 ==(phase 命名會演進:
phase-cr-*、phase-5-bdd/phase-5-e2e等都可能出現 → 精確表必過時 → resume 破功)。以上跳過條件的 GitHub 即時狀態才是路由依據;phase 字串與 GitHub 推斷衝突時一律以 GitHub 為準。比對範例:case "$phase" in *spec*) … *techlead*|*plan*) … *impl*|*engineer*) … *review*) … *e2e*|*bdd*|*test*) … *verify*) … *close*) … *next*) … esac。
重啟 lane 前的去重邏輯:
for LANE in backend frontend pipeline; do
COUNT=$(gh issue list --milestone "$SPRINT" --label "$LANE" --state open --json number --jq 'length')
ASSIGNED_OPEN=$(gh issue list --milestone "$SPRINT" --label "$LANE,in-progress" --state open --json number --jq 'length')
# 已 drained 不啟動
[ "$COUNT" = "0" ] && echo "lane=$LANE 已 drained,跳過" && continue
# 已有 in-progress 表示前一個 agent 還在跑(worktree 還在),不重啟
[ "$ASSIGNED_OPEN" -gt "0" ] && echo "lane=$LANE 已有 in-progress issue,跳過" && continue
# 啟動該 lane
# Agent(subagent_type="engineer", run_in_background=true, prompt="lane=$LANE, sprint=$SPRINT")
done