Shared branch creation and verification logic for sequential and parallel task execution - handles git operations, HEAD verification, and MODE-specific behavior
Invoked by sequential-phase-task and parallel-phase-task after task implementation to create and verify git-spice branch.
Step 1: Stage and create branch
git add .
gs branch create {RUN_ID}-task-{TASK_ID}-{TASK_NAME} -m "{COMMIT_MESSAGE}"
Step 2: Verify based on MODE
MODE: sequential - Verify HEAD points to expected branch:
CURRENT=$(git rev-parse --abbrev-ref HEAD)
EXPECTED="{RUN_ID}-task-{TASK_ID}-{TASK_NAME}"
[ "$CURRENT" = "$EXPECTED" ] || { echo "ERROR: HEAD=$CURRENT, expected $EXPECTED"; exit 1; }
MODE: parallel - Detach HEAD (makes branch accessible in parent repo):
git switch --detach
CURRENT=$(git rev-parse --abbrev-ref HEAD)
[ "$CURRENT" = "HEAD" ] || { echo "ERROR: HEAD not detached ($CURRENT)"; exit 1; }
| Rationalization | Why It's Wrong | |----------------|----------------| | "Verification is optional" | Silent failures lose work | | "Skip detach in parallel mode" | Breaks worktree cleanup | | "Branch create errors are obvious" | Silent failures aren't detected until cleanup fails | | "Detach can happen later" | Cleanup runs in parent repo - branch must be accessible | | "HEAD verification adds overhead" | <100ms cost prevents hours of lost work debugging |
git add fails:
ls -la .gitgs branch create fails:
git branch | grep {RUN_ID}-task-{TASK_ID}gs repo sync to fix stategs lsHEAD verification fails (sequential mode):
gs branch create should checkout new branch automaticallyHEAD verification fails (parallel mode):
git switch --detach should detach HEADgit --versionnpx skills add arittr/phase-task-verification下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer