本文へ移動
cccskills
無料GitHub で公開

branch-cleanup

Comprehensive git branch cleanup and organization

インストール方法を見る

含まれるファイル(1)

  • SKILL.md2.7 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Perform a complete cleanup of local and remote branches after working on multiple PRs.

Current State

Default branch: !git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@' || echo "main"

Current branch: !git branch --show-current

Fetch latest: !git fetch --all --prune 2>&1

Branch Inventory

Local branches with tracking status:

!git branch --format='%(refname:short) %(upstream:track)' | sort

Recent branches by activity:

!git for-each-ref --count=15 --sort=-committerdate refs/heads/ --format='%(refname:short) - %(committerdate:relative)'

Remote branches:

!git branch -r --format='%(refname:short)' | grep -v HEAD | sort

Cleanup Candidates

Merged into default branch: !git branch --merged

Branches with gone remotes:

!git branch -vv | grep ': gone]' | awk '{print $1}' | sort

Protected Branches

Never delete branches matching these patterns:

  • main, master, develop, staging, production
  • release/* branches (unless explicitly confirmed)
  • renovate/* branches (managed by Renovate bot)
  • Current working branch
  • Branches with unpushed commits (confirm first)

Cleanup Workflow

Phase 1: Analyze

Review the branch inventory above. Categorize branches:

  • Safe to delete: Merged branches and branches with gone remotes (excluding protected)
  • Needs confirmation: release/* branches, branches with unpushed commits
  • Protected: All protected branch patterns and current branch

Phase 2: Confirm Cleanup Plan

Present the cleanup plan and ask the user to select scope:

  • All safe: Delete all merged and gone-remote branches
  • Merged only: Delete only branches merged into default
  • Gone only: Delete only branches with deleted remotes
  • Review each: Confirm each branch individually

If "Review each" is selected, iterate through candidates asking per-branch confirmation.

Phase 3: Execute Cleanup

After confirmation, execute in order:

  1. Prune stale remote-tracking refs: git remote prune origin
  2. Delete merged local branches: git branch -d <branch>
  3. Delete gone-remote branches: git branch -D <branch>

Record each branch name and SHA before deleting: git rev-parse <branch>

If deletion fails, ask user: Force delete, Skip, or Abort.

Phase 4: Remote Cleanup (Optional)

Ask whether to delete corresponding remote branches on origin.

Phase 5: Summary

Report:

  • Count of deleted branches by category
  • Repository branch count (before and after)
  • Recovery commands with commit SHAs for each deleted branch: git checkout -b <branch> <sha>

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Primary accessibility skill for VS Code. REQUIRED for new feature and contribution work, and also applies to updates of existing UI. Covers accessibility help dialogs, accessible views, verbosity settings, signals, ARIA announcements, keyboard navigation, and ARIA labels/roles.

日本語の概要は準備中です。原文の説明を表示しています。

jcasnellie69/homelab-config22026年10月12日 更新

Use this skill when the user explicitly asks to map, document, or onboard into an existing codebase. Trigger for prompts like "map this codebase", "document this architecture", "onboard me to this repo", or "create codebase docs". Do not trigger for routine feature implementation, bug fixes, or narrow code edits unless the user asks for repository-level discovery.

日本語の概要は準備中です。原文の説明を表示しています。

jcasnellie69/homelab-config22026年10月12日 更新

Act on user feedback attached to the current session. Use when the user submits feedback on the session's changes via the Submit Feedback button.

日本語の概要は準備中です。原文の説明を表示しています。

jcasnellie69/homelab-config22026年10月12日 更新

Add educational comments to the file specified, or prompt asking for file to comment if one is not provided.

日本語の概要は準備中です。原文の説明を表示しています。

jcasnellie69/homelab-config22026年10月12日 更新

Use when adding, modifying, or reviewing VS Code configuration policies. Covers the full policy lifecycle from registration to export to platform-specific artifacts. Run on ANY change that adds a `policy:` field to a configuration property.

日本語の概要は準備中です。原文の説明を表示しています。

jcasnellie69/homelab-config22026年10月12日 更新

Patterns and techniques for adding governance, safety, and trust controls to AI agent systems. Use this skill when: - Building AI agents that call external tools (APIs, databases, file systems) - Implementing policy-based access controls for agent tool usage - Adding semantic intent classification to detect dangerous prompts - Creating trust scoring systems for multi-agent workflows - Building audit trails for agent actions and decisions - Enforcing rate limits, content filters, or tool restrictions on agents - Working with any agent framework (PydanticAI, CrewAI, OpenAI Agents, LangChain, AutoGen)

日本語の概要は準備中です。原文の説明を表示しています。

jcasnellie69/homelab-config22026年10月12日 更新

jcasnellie69 のスキルをすべて見る

このスキルの問題を報告する