Use when all implementation tasks are complete and verification passes
From mbscodenpx claudepluginhub mbstools/mbscodeThis skill uses the workspace's default tool permissions.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Guides implementation of event-driven hooks in Claude Code plugins using prompt-based validation and bash commands for PreToolUse, Stop, and session events.
Verify tests → present options → execute choice → clean up.
Detect the base branch:
DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@' || echo "main")
$DEFAULT_BRANCH = (git symbolic-ref refs/remotes/origin/HEAD 2>$null) -replace 'refs/remotes/origin/', '' ; if (-not $DEFAULT_BRANCH) { $DEFAULT_BRANCH = "main" }
Run the project's test suite, linter, and build. If the project doesn't have tests, a linter, or a build step configured, skip the corresponding step and note it.
# Run project's test suite (use command from PROJECT.md)
<test command per PROJECT.md>
# Run linter (if configured — use command from PROJECT.md)
<lint command per PROJECT.md>
# Run build (if configured — use command from PROJECT.md)
<build command per PROJECT.md>
If any verification fails → STOP. Do not proceed. Fix failures first.
If no test suite exists → provide manual verification evidence per GATES.md (actual command output required).
If tests pass → continue.
Clean up WIP commits: If git log --oneline $(git merge-base HEAD $DEFAULT_BRANCH)..HEAD | grep -E "^[a-f0-9]+ wip:" shows any results, clean them up before proceeding to merge or PR. To clean up WIP commits: git log --oneline $DEFAULT_BRANCH..HEAD to review, then git reset --soft $DEFAULT_BRANCH && git add -A && git commit -m 'feat: <description>' to squash into a single commit. Or keep individual commits if they are meaningful. Skip if choosing "keep branch as-is."
Before presenting options, get a dedicated code review of the full branch diff:
# Bash:
DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@' || echo "main")
git diff $(git merge-base HEAD $DEFAULT_BRANCH) HEAD
# PowerShell:
$DEFAULT_BRANCH = (git symbolic-ref refs/remotes/origin/HEAD 2>$null) -replace 'refs/remotes/origin/', '' ; if (-not $DEFAULT_BRANCH) { $DEFAULT_BRANCH = "main" }
git diff (git merge-base HEAD $DEFAULT_BRANCH) HEAD
code-reviewer agent if available, otherwise a general-purpose subagent):## What Was Implemented
[One paragraph -- what you built]
## Requirements / Spec
[Task spec or acceptance criteria]
## Changes to Review
[git diff output]
Present exactly these 4 options. Don't add explanation -- keep concise:
Verification 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?
In non-interactive or autonomous runs, default to option 3 (keep the branch) and state this choice explicitly.
git checkout <base-branch>
git pull
git merge <feature-branch>
# If merge conflicts occur: resolve them, then run full test suite on merged result
# Run tests on merged result
<test command>
# If pass:
git branch -d <feature-branch>
Check if gh CLI is available, then push and create PR. Adapt commands to your shell:
# Bash:
gh --version 2>/dev/null || echo "gh CLI not installed"
git push -u origin <feature-branch>
gh pr create --title "<title>" --body "<summary of changes>"
# PowerShell:
gh --version 2>$null; if (-not $?) { Write-Output "gh CLI not installed" }
git push -u origin <feature-branch>
gh pr create --title "<title>" --body "<summary of changes>"
If gh is not available, push and provide the URL to create PR in browser: https://github.com/<owner>/<repo>/compare/<branch>
Report: "Branch <name> preserved. Resume with git checkout <name>."
Confirm first:
This will permanently delete branch <name> and all its commits.
Type 'discard' to confirm.
Wait for typed confirmation. Then:
git checkout <base-branch>
git branch -D <feature-branch>
Called by: mbscode:executing-plans, mbscode:subagent-driven-development, or mbscode:brainstorming (trivial tasks on feature branch) after all tasks
After completion: Update SESSION.md with final state
| Thought | Reality |
|---|---|
| "Tests probably pass" | Run them. Show output. |
| "I'll skip the PR description" | Write a real summary. |
| "Just merge, no need to ask" | Always present 4 options. User decides. |
| "Discard without confirming" | Always require typed confirmation. |