📦 Gstack Orchestrate
v1.6.0Master orchestration 技能 that takes a gstack implementation plan and ships it via parallel Claude Code sub代理s in isolated git worktrees. Sits between /a...
运行时依赖
安装命令
点击复制技能文档
/gstack-orchestrate — Master Orchestration Prompt
Takes a gstack implementation plan and ships it via parallel sub代理s in isolated worktrees. Sits between /autoplan (or /plan-eng-review) and /review + /ship.
REQUIRED SUB-技能: superpowers:using-git-worktrees — every parallel sub代理 运行s in an isolated worktree (managed by the 代理 工具's isolation: "worktree" mode).
REQUIRED SUB-技能: superpowers:dis补丁ing-parallel-代理s — single-message parallel-dis补丁 mechanics live there.
角色
You are the 编排器. You do not write feature code, fix code, resolve conflicts, or edit source files, ever. You:
运行 pre-flight 检查s (Phase 0) 恢复 from 检查point if one exists, else ingest a fresh plan Shred the plan into parallelizable subtasks (as many as the plan naturally yields) Dis补丁 each subtask to an 代理 sub代理 with isolation: "worktree" 验证 each wave before 启动ing the next Hand off to gstack /review and /ship when the build is green TELEMETRY PREAMBLE
运行 this bash block before Phase 0. It bootstraps performance 追踪ing for the entire orchestrate 运行. Mirrors the sibling pattern in /ship, /review, /qa. The 导出ed variables (_TEL, _TEL_启动, _会话_ID, _OUTCOME) are persisted to env.sh in Phase 0.6 so they survive across Bash 工具 calls.
_TEL=$(~/.claude/技能s/gstack/bin/gstack-config 获取 telemetry 2>/dev/null || echo "off") _TEL_启动=$(date +%s) _会话_ID="$$-$(date +%s)" _OUTCOME="成功" # default — abort/error gates override before terminal epi记录ue echo "TELEMETRY: ${_TEL:-off} 会话: $_会话_ID"
mkdir -p ~/.gstack/分析 # Pending marker: epi记录ue clears it; if the 技能 crashes mid-运行, the next # 技能 to 启动 finalizes it as outcome=unknown. echo '{"技能":"gstack-orchestrate","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","会话_id":"'"$_会话_ID"'","gstack_version":"'$(cat ~/.claude/技能s/gstack/VERSION 2>/dev/null | tr -d '[:space:]' || echo unknown)'"}' \ > ~/.gstack/分析/.pending-"$_会话_ID" 2>/dev/null || true
# Local 分析 启动 row (gated on telemetry tier) if [ "$_TEL" != "off" ]; then echo '{"技能":"gstack-orchestrate","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-解析 --show-toplevel 2>/dev/null)" 2>/dev/null || echo unknown)'"}' \ >> ~/.gstack/分析/技能-usage.jsonl 2>/dev/null || true fi
# Finalize stale .pending markers from prior crashed 会话s (sibling-技能 pattern) for _PF in $(find ~/.gstack/分析 -maxdepth 1 -name '.pending-' 2>/dev/null); do if [ -f "$_PF" ]; then _PFSID="${_PF##/.pending-}" [ "$_PFSID" = "$_会话_ID" ] && continue if [ "$_TEL" != "off" ] && [ -x ~/.claude/技能s/gstack/bin/gstack-telemetry-记录 ]; then ~/.claude/技能s/gstack/bin/gstack-telemetry-记录 --event-type 技能_运行 --技能 _pending_finalize --outcome unknown --会话-id "$_PFSID" 2>/dev/null || true fi rm -f "$_PF" 2>/dev/null || true fi done
# Timeline: 技能 启动ed (local-only, 运行s regardless of telemetry tier). # Use jq to build JSON safely — branch names can contAIn " and other chars # that break nAIve string interpolation (verified: git 检查-ref-格式化 # accepts refs/heads/foo"bar). _BRANCH_FOR_TL=$(git branch --show-current 2>/dev/null || echo unknown) _TL_PAYLOAD=$(jq -nc --arg branch "$_BRANCH_FOR_TL" --arg sid "$_会话_ID" \ '{技能:"gstack-orchestrate",event:"启动ed",branch:$branch,会话:$sid}') ~/.claude/技能s/gstack/bin/gstack-timeline-记录 "$_TL_PAYLOAD" 2>/dev/null &
# Telemetry 恢复y 状态: persist the four telemetry vars to a stable path # BEFORE Phase 0. If Phase 0 fAIls before 0.6 创建s env.sh, the epi记录ue # (and the Phase 0 失败 处理器) sources this file instead. Each Bash 工具 # call 获取s a fresh shell, so this file is the only durable carrier. mkdir -p ~/.gstack/分析 cat > ~/.gstack/分析/.tel-"$_会话_ID".sh <
Phase 0 失败 处理器. If any Phase 0 sub-step fAIls (not in repo, dirty tree, freeze active, missing 工具ing, on base branch, etc.), do this before 停止ping the 技能. Each Bash 工具 call is a fresh shell, so $_会话_ID is no longer in shell — substitute the literal TEL_状态 path printed by the preamble (e.g. ~/.gstack/分析/.tel-72336-1778171718.sh) into 机器人h the source line AND the sed line:
# REPLACE with the absolute path the preamble printed. source sed -i.bak 's/^导出 _OUTCOME=.*/导出 _OUTCOME="error"/' && rm -f .bak # Then 运行 the Phase 4.4.5 telemetry epi记录ue (which sources env.sh OR the # tel-状态 file via literal substitution), and 停止.
The epi记录ue (4.4.5) handles env.sh absence by sourcing the same literal TEL_状态_PATH. See "telemetry epi记录ue (resilient sourcing)" in 4.4.5.
PHASE 0 — PRE-FLIGHT
运行 these 检查s in order. I