一键导入
git-detect-merged
Detect whether local branches/worktrees have been merged into a target branch (default: main), including squash merges. Args: [target-branch]
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Detect whether local branches/worktrees have been merged into a target branch (default: main), including squash merges. Args: [target-branch]
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Self-looping adversarial-review-to-merge pipeline. Codex runs an adversarial review (a given area/topic, else the whole repo), findings are neutrally verified, each survivor becomes its own PR, and a per-PR review gauntlet (two fresh, context-isolated SATISFIED verdicts on the same PR content, reviewed one at a time over the whole diff) plus event-driven CI monitoring gate an auto-merge. Multiple isolated runs (each keyed by a run-id, with a lease so only one agent drives each) can run concurrently in one repo. Drives its own loop via ScheduleWakeup — invoke once, no /loop wrapper. Args: [--run id] [area or topic]
Evaluate and address GitHub Copilot PR review items for a GitHub pull request. Use when user provides a GitHub PR link and wants Copilot review comments checked, verified, fixed, committed, and summarized. Fetch review items with `gh`, verify each claim against source/tests before changing code, ask user before making subjective or constraint-driven changes, then work items one by one.
Continuously find and fix failing Go tests in a worktree, syncing with a parent branch between iterations. Use when user wants to fix all (or many) test failures in a branch via an automated loop. Args: <parent-branch> [test-args...]
Execute instructions in an isolated worktree, commit, fast-forward merge to parent, cleanup. Args: <parent-branch> <instructions...>
Delegate a task to Codex CLI via `codex exec`. Use for lightweight tasks (exploration, simple searches, file reads) that don't require heavy reasoning. Only available from Claude Code sessions.
Multi-agent design collaboration — Claude Code (reviewer) and Codex (designer) iterate on a design doc via file-based chat. Gathers requirements from user, then runs a review loop until design is satisfactory. Args: <topic>
| name | git-detect-merged |
| description | Detect whether local branches/worktrees have been merged into a target branch (default: main), including squash merges. Args: [target-branch] |
Detect whether local branches and worktrees have their changes already merged into a target branch. Handles both regular merges and squash merges.
/git-detect-merged [target-branch]
target-branch — branch to check against. Default: main.Refer to the target branch as $TARGET below.
When $TARGET is not main, only consider branches that forked from $TARGET's own commits — not from shared ancestry with main. This prevents deleting unrelated branches (e.g. branches off bar when cleaning up foo).
target_fork = git merge-base main $TARGET.B, compute branch_base = git merge-base $TARGET B.git merge-base --is-ancestor $branch_base $target_fork.
B forked from shared history (before $TARGET diverged from main). Skip it.B forked from $TARGET's own commits. Keep it.Always exclude main and $TARGET from candidates.
When $TARGET is main, skip this pre-filter — all branches are in scope.
Run git branch --merged $TARGET. From the results, apply the pre-filter above and exclude $TARGET and main.
Branches NOT listed by --merged may still have been squash-merged. For each remaining local branch that passes the pre-filter, run:
~/.claude/scripts/git-is-squash-merged $TARGET <branch>
The script handles both single-commit cherry checks and multi-commit combined patch-id detection internally.
A branch or worktree is considered "actively being worked on" if any of these are true:
cd to the worktree path first, then run git status --porcelain — any output means dirty..tmp/: visible in --porcelain output (lines starting with ??). Ignore untracked .tmp/ content.Report each branch with:
regular or squashclean, dirty, or checked-out