一键导入
clean-gone-branches
Delete local git branches whose remotes are gone, after verifying via gh CLI that each was actually merged.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Delete local git branches whose remotes are gone, after verifying via gh CLI that each was actually merged.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
ALWAYS use this skill whenever you would otherwise ask the user a question in free-form chat -- for clarifications, confirmations (especially destructive actions), missing parameters, multiple-choice decisions, or structured form input. Elicitations are routed through the Unique AI Platform UI via `unique-cli elicit create` + `elicit wait` (or `elicit ask` outside an agent harness) so the user gets a proper structured prompt and you get a structured answer back. Do NOT ask the user in plain chat when you can use this skill instead.
Read Agentic Table (magic table / due-diligence) sheets through the unique-cli agentic-table command. Use when the user or task involves inspecting an Agentic Table: a sheet's state and metadata, a specific cell's value or lock state, a cell's edit/answer history, or the sheet's generated export artifacts (reports, question exports). These are read-only (Tier 0) commands — they never modify the sheet and never require confirmation. Access to each sheet is enforced by the platform; a denial is reported as `agentic-table: permission denied`.
Call MCP (Model Context Protocol) server tools on the Unique AI Platform using the unique-cli mcp command. Use when the user asks to invoke, call, or execute an MCP tool, or when they need to send a JSON payload to an MCP server through the CLI. The JSON payload is forwarded 1:1 to the platform's MCP call-tool API.
Invoke connected Unique spaces/subagents through the unique-cli subagent command. Use when the workspace exposes connected-space tools and you need to delegate a question or task to one of those configured assistants.
Search the Unique AI Platform knowledge base using the unique-cli search command, with automatic per-turn citation tracking so cited facts render as clickable reference chips and `<sup>N</sup>` footnotes on the Unique platform. Use whenever the user asks to find, search, or query documents or content on Unique, including filtering by folder or metadata. Also covers `unique-cli read <cont_id>` for reading the full indexed text of a document when its content ID is already known. NOTE: This search uses combined vector + full-text indexing. Excel (.xlsx/.xls), CSV (.csv), and image files are NOT full-text indexed, so they will not appear in search results. To locate these file types, use the unique-cli-file-management skill instead (browse folders with `unique-cli ls` to find them by name).
Search the documents uploaded for the CURRENT task/row (e.g. an Agentic Table row's attached files) via the `unique-cli uploaded-search "<query>"` command, with the same per-turn citation tracking as `unique-cli search` so cited facts render as `<sup>N</sup>` footnotes and clickable reference chips on the Unique platform. ALWAYS use this skill when the user refers to documents they uploaded/attached to this task, or when you need facts from the task's own attached files. These uploaded files are scoped to the chat, NOT to a knowledge-base folder, so they will NEVER appear in `unique-cli search` results no matter the folder or metadata filters. Use `unique-cli search` for the knowledge base and this command for the task's uploaded documents; the two are complementary and citation numbering is shared across them within a turn.
| name | clean-gone-branches |
| description | Delete local git branches whose remotes are gone, after verifying via gh CLI that each was actually merged. |
| license | MIT |
| compatibility | claude cursor opencode |
| metadata | {"version":"1.0.0","languages":"all","audience":"developers","workflow":"git","since":"2026-03-19"} |
Clean up orphaned local branches (those whose remote tracking branch is [gone]) by:
git fetch --prune to sync remote state.[gone] remote tracking refs.gh pr list --state all to confirm it was merged (or closed).git branch -D.git branch -vv shows several [gone] entries.git fetch --prune
git branch -vv | grep ': gone]'
If nothing found, report "No orphaned branches found." and stop.
For each orphaned branch, run:
gh pr list --head "<branch>" --state all --json state,mergedAt,title \
--jq '.[0] | "\(.state) | merged: \(.mergedAt // "N/A") | \(.title)"'
Build a summary table:
| Branch | PR State | Merged At | PR Title |
|---|
Flag any branches that are not MERGED (e.g. OPEN or CLOSED without merge) — these need user attention before deletion.
Show the table and ask:
If any branch has no PR or is not merged, exclude it from the default delete list and call it out explicitly:
git branch -D <branch1> <branch2> ...
Report each deleted branch with its last commit hash.
git branch -D (force) since git's merge check is against the local default branch, not the remote — remote deletion already confirms the work is done.gh is not available or returns no results, warn the user and do not auto-delete.