/crucible:merge-prfrom crucible
Safely merges a PR with CI verification, local test validation, repo safety checks, and post-merge health monitoring.
Ships in crucible. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Safely merge a PR with full CI verification, local test validation, and post-merge health monitoring.
Core principle: Verify CI -> Check working tree -> Repo safety scan -> Local tests -> Merge -> Post-merge CI -> Cleanup.
Announce at start: "I'm using the merge-pr skill to safely land this PR."
Verify all CI checks pass before anything else:
gh pr checks <pr-number>
If any checks are failing:
CI checks failing. Cannot merge.
FAILED:
- <check-name>: <url>
- <check-name>: <url>
Fix these before attempting merge.
Stop. Don't proceed to Step 2.
If checks are pending: Wait. Re-check with gh pr checks <pr-number> after a reasonable interval. Don't proceed until all checks resolve.
If all checks pass: Continue to Step 2.
Verify no uncommitted work is hiding:
git status
If untracked or modified files exist:
Working tree is not clean:
Untracked:
- <file>
- <file>
Modified:
- <file>
Should these be committed before merge? (y/n)
Stop. Wait for user decision. If user says yes, commit them first. If user says no, proceed.
If working tree is clean: Continue to Step 3.
Determine repo visibility:
gh repo view --json isPrivate -q .isPrivate
If the repo is PUBLIC (false):
gh pr view <pr-number> --json body -q .body
gh pr view <pr-number> --json commits --jq '.commits[].messageHeadline'
Look for: proprietary company names, internal tool references, API keys, internal URLs, employee names, infrastructure details.
If anything looks sensitive:
PUBLIC REPO — potential sensitive content detected:
- PR body: <what was found>
- Commits: <what was found>
Confirm this is safe to merge publicly? (y/n)
Stop. Wait for explicit confirmation.
If the repo is private: Note it and continue.
If all clear: Continue to Step 4.
Run the project's test suite locally:
# Detect and run the appropriate test command
npm test / cargo test / pytest / go test ./... / dotnet test
If tests fail:
Local tests failing (<N> failures). Cannot merge.
[Show failures]
Fix these before merge.
Stop. Don't proceed to Step 5.
If tests pass: Continue to Step 5.
Only reach this step after ALL above checkpoints pass.
Ask the user:
All checks passed. Merge method?
1. Merge commit
2. Squash and merge
3. Rebase and merge
Wait for choice. Then execute:
# Option 1
gh pr merge <pr-number> --merge
# Option 2
gh pr merge <pr-number> --squash
# Option 3
gh pr merge <pr-number> --rebase
If merge fails:
If merge succeeds: Continue to Step 6.
Don't walk away after merge. Verify CI on the target branch:
# Get the target branch (don't assume main)
TARGET_BRANCH=$(gh pr view <pr-number> --json baseRefName -q .baseRefName)
gh run list --branch $TARGET_BRANCH --limit 5
If a run is in progress:
gh run watch <run-id>
If post-merge CI fails:
gh run view <run-id> --log-failed
Surface the failure summary to the user immediately:
POST-MERGE CI FAILURE on $TARGET_BRANCH:
Run: <run-id>
Failed step: <step-name>
Error: <summary>
This needs immediate attention. The target branch is broken.
Do NOT proceed to cleanup until the user acknowledges the failure and decides next steps.
If post-merge CI passes: Emit compass update, then continue to Step 7.
# Capture merge commit SHA with 3-retry null guard (DEC-5 / R15-M1)
PR="<pr-number>"
SHA=""
for ATTEMPT in 1 2 3; do
SHA=$(gh pr view "$PR" --json mergeCommit --jq '.mergeCommit.oid')
[ -n "$SHA" ] && [ "$SHA" != "null" ] && break
SLEEP_S=$((ATTEMPT * 2)) # 2s, 4s, 6s
sleep "$SLEEP_S"
done
SUBJ=$(gh pr view "$PR" --json title --jq '.title')
if [ -n "$SHA" ] && [ "$SHA" != "null" ]; then
# compass update --field last_meaningful_commit --value "<sha>:<subject>"
python scripts/compass.py update --field last_meaningful_commit --value "${SHA}:${SUBJ}" \
2>&1 || echo '[compass] emit failed; continuing' >&2
else
# gh cache lag after 3 retries — write pending-merge marker
# compass update --field last_meaningful_commit --value "<pending-merge:#NNN>"
python scripts/compass.py update --field last_meaningful_commit --value "<pending-merge:#${PR}>" \
2>&1 || echo '[compass] emit failed; continuing' >&2
fi
Ask before deleting anything:
Merge complete. Clean up branches?
- Delete remote branch origin/<branch-name>? (y/n)
- Delete local branch <branch-name>? (y/n)
Wait for confirmation. Then execute as directed:
# Delete remote branch
git push origin --delete <branch-name>
# Delete local branch
git branch -d <branch-name>
# Switch to target branch
git checkout main && git pull
Report final state:
PR #<number> merged successfully.
Branch <branch-name> cleaned up.
Main branch CI: passing.
If the merged PR's title/type is fix(*) (a conventional-commit bug fix), record a grudge so the bug it fixed can never silently re-ship. Best-effort — a failed record logs to stderr and never fails the merge (which has already completed):
# only for fix(*) PRs
plugin_root="$(realpath "<this-skill-base-dir>/../..")"
python3 "$plugin_root/scripts/grudge_append.py" \
--symptom "<PR title minus the fix() prefix>" \
--root-cause "<from PR body, if stated>" \
--files "<comma-separated files the PR changed>" \
--commit "<squash/merge SHA>" \
--why "<from PR body, if stated>"
Non-fix(*) PRs record nothing. See skills/grudge/SKILL.md.
Merging without checking CI
gh pr checks first. No exceptions.Skipping local tests
Not monitoring post-merge CI
Force-merging past branch protection
--admin flag. Report the protection rule and let the user resolve it properly.Deleting branches without confirmation
Never:
--admin to bypass branch protectionAlways:
Called by:
Relationship to finish:
Pairs with:
Before completing this skill, confirm every mandatory checkpoint was executed:
If any checkbox is unchecked, STOP. Go back and execute the missed gate.
What SKILL.md sets; muted values are Claude Code's defaults
51 skills in this plugin
/adrWrite, supersede, and maintain Architecture Decision Records (docs/decisions/) for technical choices that had real, seriously-considered alternatives and would be costly to reverse. Use on "write an ADR", "record this decision", or when recording a choice that a design or PR already settled. Matches the target repo's existing ADR convention before imposing one, and declines with a reason when a decision does not meet the bar — not for routine design docs, implementation plans, session handoffs, the pre-push/merge wrap-up itself (that belongs to `finish` / `merge-pr`), or answering "why did we choose X" from an ADR that already exists (that's a read, owned by `recall` / `recon`)./adversarial-testerUse after completing an implementation to find unknown failure modes. Reads the implementation diff and writes up to 5 tests designed to make it break — per-task, scoped to that single implementation (for a fully-assembled multi-component feature, use inquisitor to hunt cross-component bugs). Triggers on 'break it', 'adversarial test', 'stress test implementation', 'find weaknesses', or any task seeking to expose unknown failure modes in a single implementation./assayRecon-informed approach evaluator. Weighs competing options against codebase constraints and returns structured recommendations with confidence scoring, kill criteria, and evidence grounding. Consumes recon briefs or caller context. Used by design, spec, migrate. Triggers on /assay, 'evaluate approaches', 'which option', 'compare alternatives'.Generated from the plugin's indexed repository (raddue/crucible) — no native marketplace selected
npx claudepluginhub p/raddue-crucibleOther plugins' skills for the same job