Guides completing development branches with Codex-backed branch analysis and structured finish options (merge, PR, keep, discard).
How this skill is triggered — by the user, by Claude, or both
Slash command
/superpowers-cc-to-codex:finishing-a-development-branch-codexThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
<!--
Keep Claude in the main thread for user interaction and git operations.
Call the codex_branch_analysis MCP tool for bounded branch readiness analysis.
Pass a prompt body that includes the current branch name, base branch, and what kind of finish decision is needed.
Example:
{
"tool": "codex_branch_analysis",
"arguments": {
"prompt": "Assess whether branch codex/agent-forwarding is ready to merge back to main. Call out failing tests, uncommitted work, or review gaps that would block a clean finish.",
"workspaceRoot": "/absolute/path/to/your/repo"
}
}
You MUST call codex_branch_analysis before presenting finish options.
Branch readiness assessment requires Codex analysis. No analysis = no finish actions.
Guide completion of development work by presenting clear options and handling the chosen workflow.
Core principle: Verify tests -> Present options -> Execute choice -> Clean up.
Announce at start: "I'm using the finishing-a-development-branch skill to complete this work."
Call the codex_branch_analysis MCP tool to assess branch state.
Pass a prompt body that includes the current branch name, base branch, and what kind of finish decision is needed.
Example:
{
"tool": "codex_branch_analysis",
"arguments": {
"prompt": "Assess whether branch codex/agent-forwarding is ready to merge back to main. Call out failing tests, uncommitted work, or review gaps that would block a clean finish.",
"workspaceRoot": "/absolute/path/to/your/repo"
}
}
Check the readiness field:
| Readiness | Action |
|---|---|
ready | Proceed to Step 3 |
tests_failing | Show failures to user. Must fix before finishing. Stop here. |
uncommitted_work | Prompt user to commit or stash first. Stop here. |
needs_review | Suggest code review before finishing. User may override. |
If concerns array is non-empty, present them to the user.
Present exactly these 4 options:
Implementation complete. What would you like to do?
1. Merge back to <base-branch> locally
2. Push and create a Pull Request
3. Keep the branch as-is (I'll handle it later)
4. Discard this work
Which option?
Do not add explanation — keep options concise.
git checkout <base-branch>
git pull
git merge <feature-branch>
# Verify tests on merged result
<test command>
# If tests pass
git branch -d <feature-branch>
Then: Cleanup worktree (Step 5).
git push -u origin <feature-branch>
gh pr create --title "<title>" --body "$(cat <<'EOF'
## Summary
<2-3 bullets of what changed>
## Test Plan
- [ ] <verification steps>
EOF
)"
Then: Cleanup worktree (Step 5).
Report: "Keeping branch <name>. Worktree preserved at <path>."
Do not cleanup worktree.
Confirm first:
This will permanently delete:
- Branch <name>
- All commits: <commit-list>
- Worktree at <path>
Type 'discard' to confirm.
Wait for exact confirmation. If confirmed:
git checkout <base-branch>
git branch -D <feature-branch>
Then: Cleanup worktree (Step 5).
For Options 1, 2, 4 — check if in worktree:
git worktree list | grep $(git branch --show-current)
If yes:
git worktree remove <worktree-path>
For Option 3: Keep worktree.
Never:
Always:
Called by:
subagent-driven-development — After all tasks completePairs with:
requesting-code-review — Review before finishing (Option 2 especially)test-driven-development — TDD ensures tests pass before this skill runsnpx claudepluginhub mzored/superpowers-cc-to-codex --plugin superpowers-cc-to-codexGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.