Skip to content
Development
Skill

/merge

ブランチをメインにマージしてお掃除する

From plugin
ccpocket
1.1k18 skills2 agents2 MCP
Install
$ npx -y skills add K9i-0/ccpocket --skill merge --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/merge

Context preview

The summary Claude sees to decide when to auto-load this skill.

ブランチをメインにマージしてお掃除する

SKILL.md

merge.SKILL.md
name: merge
description: ブランチをメインにマージしてお掃除する
allowed-tools: Bash(git:*)

ブランチマージ & クリーンアップ

作業ブランチを main にマージし、不要になったブランチと worktree を削除する。

前提条件

  • 作業ブランチで全ての変更がコミット済みであること
  • 現在のブランチが main **でない**こと

手順

1. 事前確認

git branch --show-current
  • 現在のブランチ名を記録する(= `<branch>` とする)
  • `main` の場合はマージ対象がないため中断する
git status --short
  • 未コミットの変更があれば、今回の作業に属する変更だけを検証してコミットする。無関係な変更は混ぜず、上書きせずにマージできる作業場所を使う。変更の帰属が判断できずマージを妨げる場合だけ確認する。

2. main に切り替え

git checkout main

3. マージ (--no-ff)

git merge --no-ff <branch>
  • マージコンフリクトは両側の変更意図を調べて解消し、関連する検証を実施してマージを完了する。意図が両立せず、コードや依頼から判断できない場合だけ、競合箇所と選択による違いを示して確認する。

4. 作業ブランチの削除

git branch -d <branch>

5. worktree のクリーンアップ

git worktree list
  • `<branch>` に紐づく worktree がある場合のみ以下を実行:
git worktree remove <worktree-path>
  • worktree ディレクトリが残っている場合は手動削除が必要な旨を通知する

6. 完了報告

最終状態を表示する:

git log --oneline -5
git branch
git worktree list
Ships withccpocket

Your agents. In your pocket. Codex and Claude, with a chat UI made for your phone. Start a task, approve the next step, and review the result. Pick up the same work on your tablet or Mac.

Get the whole plugin

Other skills on ccpocket.

codex-guide
Skill

codex-guide

Codex の使い方、CLI/app/IDE、rules・hooks・AGENTS.md・skills・subagents・config などを案内する。Codex や OpenAI 製品の仕様を答える前に必ず公式ドキュメントを確認し、rules/approval は `codex execpolicy check`…

@k9i-0@k9i-0View Skill