一键导入
cleanup
Use when the user wants to clean up merged branches locally and on remote. Lists merged branches, confirms before deleting, and prunes stale remote refs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when the user wants to clean up merged branches locally and on remote. Lists merged branches, confirms before deleting, and prunes stale remote refs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when the user runs "/insights-audit", asks to "validate the insights report", "audit the report against my projects", "check what the report got wrong", or wants to cross-check an /insights-generated HTML report against actual GitHub repos and local project directories.
This skill should be used when the user asks to "end session", "capture state", "session summary", "what changed this session", "summarize repos", "write session notes", or wants to capture multi-repo state at the end of a work session.
Fill in the Patterns & Surprises section of the latest session reflect file and write the completed review to .ctx/logs/self-review/. Use when the user runs "/self-review", asks to "fill in the reflect", "write the session review", or "what patterns did we hit".
Use when working on the rslm project — Recursive Language Model inference engine in Rust. Triggers on "rslm", "RLM", "recursive language model", "rhai built-ins", "ctx_grep", "ctx_slice", "rlm_call", "rslm-core", "rslm-providers", "rslm-store", or any question about running queries, ingesting documents, or writing Rhai scripts for the RLM loop.
This skill should be used when the user asks to "review this diff", "ai review", "security review my changes", "review before push", "check my code for issues", or wants an LLM-based security and correctness review of uncommitted or unpushed changes.
This skill should be used when the user asks to "generate commit message", "write a commit msg", "ai commit", "generate a conventional commit", "write my commit", or wants an LLM to draft a commit message from the staged diff.
| name | cleanup |
| description | Use when the user wants to clean up merged branches locally and on remote. Lists merged branches, confirms before deleting, and prunes stale remote refs. |
| allowed-tools | Read, Bash |
Safe deletion of local and remote branches that have been merged into main. Always shows what will be deleted and confirms before proceeding.
git branch --merged main | grep -v '^\*\|main\|master'
Filter out:
*)git branch -r --merged origin/main | grep -v 'origin/main\|origin/master'
Filter out:
For each branch found, verify it is fully merged:
git log --oneline main..<branch>
If output is empty: branch is fully merged. Safe to delete.
If output is non-empty: branch has commits not in main. Do NOT delete. Warn the user.
Before deleting a remote branch, check for open PRs:
gh pr list --head <branch> --state open
If any open PRs exist: skip deletion of that branch. Note it and ask the user if they want to close the PR first.
Display a summary:
Local branches to delete:
branch-1
branch-2
Remote branches to delete:
origin/branch-3
origin/branch-4
Branches with open PRs (will be skipped):
branch-5
Ask for explicit confirmation:
Proceed with deletion? (yes/no)
Use -d (safe delete only — fails if not fully merged):
git branch -d <branch>
Never use -D — it force-deletes without checking.
Report each deletion:
Deleted: branch-1
Deleted: branch-2
git push origin --delete <branch>
Report each deletion:
Deleted remote: origin/branch-3
Deleted remote: origin/branch-4
git remote prune origin
Summary:
cleanup complete:
Local branches deleted: N
Remote branches deleted: M
Stale refs pruned
-d not -D: safe mode onlygit log main..<branch> output requiredIf git branch -d <branch> fails (branch not fully merged):
Cannot delete <branch>: not fully merged
Skip it and continue with others. Note it in the final report.
If git push origin --delete <branch> fails (remote branch doesn't exist), skip and continue.
Related: cap (commit and push), git-guard (merge strategy verification)