Use when implementation is complete and you need to merge, create a PR, or clean up — verifies tests pass, presents 4 structured integration options, executes chosen workflow, and cleans up worktrees. Pairs with code-forge:worktree.
Completes feature branches by verifying tests, presenting integration options, executing the chosen workflow, and cleaning up worktrees.
npx claudepluginhub tercel/code-forgeThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Complete a development branch by verifying tests, choosing an integration strategy, and cleaning up.
Verify Tests → Determine Base Branch → Present 4 Options → Execute Choice → Cleanup Worktree
Run the full test suite before proceeding (following the code-forge:verify discipline — run fresh, read full output, confirm zero failures).
# Auto-detect and run test command
# Find the upstream branch this was created from
BASE_BRANCH=$(git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null | sed 's|origin/||' || echo "main")
Present these options to the user using AskUserQuestion. Do NOT modify, add, or remove options:
Option 1: Merge back to {base-branch} locally
git checkout {base-branch} && git merge {feature-branch}Option 2: Push and create Pull Request
git push -u origin {feature-branch} then gh pr createOption 3: Keep branch as-is
Option 4: Discard this work
Option 1 — Merge:
git checkout {base-branch}
git merge {feature-branch} --no-ff
Option 2 — Push + PR:
git push -u origin {feature-branch}
gh pr create --title "{feature-name}: <summary>" --body "$(cat <<'EOF'
## Summary
<generated from commits>
## Test plan
- [ ] All tests pass
Generated with [code-forge](https://github.com/tercel/code-forge)
EOF
)"
Report the PR URL to the user.
Option 3 — Keep: No action. Report current branch and worktree location.
Option 4 — Discard: Ask user to type "discard" to confirm. Then:
git checkout {base-branch}
git branch -D {feature-branch}
Options 1, 2, 4: Detect if inside a worktree and remove it:
# Detect worktree: if git-common-dir differs from git-dir, we are in a worktree
COMMON_DIR=$(git rev-parse --git-common-dir 2>/dev/null)
GIT_DIR=$(git rev-parse --git-dir 2>/dev/null)
if [ "$COMMON_DIR" != "$GIT_DIR" ]; then
WORKTREE_PATH=$(pwd)
cd $(git -C "$COMMON_DIR/.." rev-parse --show-toplevel)
git worktree remove "$WORKTREE_PATH"
fi
Option 3: Do NOT clean up. The worktree stays.
Branch finished:
Feature: {feature-name}
Action: {Merged / PR created / Kept / Discarded}
PR URL: {url} (Option 2 only)
Worktree: {removed / preserved}
Activates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.
Search, retrieve, and install Agent Skills from the prompts.chat registry using MCP tools. Use when the user asks to find skills, browse skill catalogs, install a skill for Claude, or extend Claude's capabilities with reusable AI agent components.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.