home/dot_agents/skills/delete-merged-branches/SKILL.md
ベースブランチにマージ済みのローカルgitブランチを検出して一括削除する。
npx skillsauth add kryota-dev/dotfiles delete-merged-branchesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
ベースブランチ(デフォルト: main)にマージ済みのローカルブランチを検出し、ユーザー確認の上で一括削除します。
デフォルトブランチ(main または master)を特定します。
git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@'
取得できない場合は main をデフォルトとして使用します。
git branch --merged <ベースブランチ>
出力からベースブランチ自体(main / master)と現在チェックアウト中のブランチ(* 付き)を除外します。
git worktree list --porcelain | grep 'branch' | sed 's@branch refs/heads/@@'
ステップ2で取得したブランチのうち、ワークツリーで使用中のものを特定します。
マージ済みブランチをテーブル形式で一覧表示します。
| ブランチ名 | 状態 |
|---|---|
| feat/example-1 | 削除対象 |
| feat/example-2 | ワークツリー使用中(/wtp-cleanup で対応) |
/wtp-cleanup スキルで対応するようユーザーに案内してください。AskUserQuestion ツールを使用して、削除対象ブランチの一括削除を実行してよいかユーザーに確認してください。
ユーザーが承認した場合のみ、git branch -d で一括削除を実行します。
git branch --merged <ベースブランチ> | grep -v '^\* ' | grep -v '^ <ベースブランチ>$' | xargs git branch -d
git branch -d はリモートブランチとの差分がある場合などに失敗することがあります(not fully merged エラー)。
削除に失敗したブランチがある場合:
AskUserQuestion ツールを使用して、git branch -D(強制削除)を実行してよいかユーザーに確認してください。git branch -D で強制削除します。git branch -D <BRANCH_1> <BRANCH_2> ...
git branch
残っているブランチの一覧を表示し、削除結果を報告してください。
development
`cc-code-review` エージェントを起動して独立したコンテキストでコードレビューを実行する。 現在のセッションのバイアスのないフレッシュな視点で、プロジェクトの CLAUDE.md を踏まえたレビューを行う。 トリガー: "cc-code-review", "ccでレビュー", "別の視点でレビュー", "セカンドオピニオン" 使用場面: (1) PRのコードレビュー (2) ブランチ差分のレビュー (3) 特定ファイルのレビュー (4) 現在の変更のレビュー
tools
Comprehensive guide for the `wtp` (Worktree Plus) CLI by satococoa — an enhanced Git worktree manager. Use this whenever the user wants to create, list, remove, or navigate Git worktrees with wtp, mentions `wtp add`/`wtp cd`/`wtp list`/`wtp remove`/`wtp exec`, asks about automatic worktree paths from branch names, post-create hooks (copy/symlink/command) in `.wtp.yml`, branch tracking for worktrees, or shell integration (`wtp shell-init`, `wtp hook`, tab completion, auto-cd). Trigger this even when the user just describes the workflow — e.g. 'spin up a worktree for this feature branch', 'jump to my auth worktree', 'clean up the worktree and its branch' — without naming wtp explicitly, as long as wtp is the available tool.
tools
Use when doing ANY task involving Supabase. Triggers: Supabase products (Database, Auth, Edge Functions, Realtime, Storage, Vectors, Cron, Queues); client libraries and SSR integrations (supabase-js, @supabase/ssr) in Next.js, React, SvelteKit, Astro, Remix; auth issues (login, logout, sessions, JWT, cookies, getSession, getUser, getClaims, RLS); Supabase CLI or MCP server; schema changes, migrations, security audits, Postgres extensions (pg_graphql, pg_cron, pg_vector).
data-ai
Postgres performance optimization and best practices from Supabase. Use this skill when writing, reviewing, or optimizing Postgres queries, schema designs, or database configurations.