Agent skill

resolve-merge-conflict

現在の branch を分岐元の最新に rebase するときに使う。まず rebase を実行し、止まった conflict を順番に解消して前に進める。長い事前調査を避けて、必要な file だけ見て片付けたいときに使う。

Stars 15
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/sushichan044/dotfiles/tree/main/.agents/skills/resolve-merge-conflict

SKILL.md

resolve-merge-conflict

最初にやること

  • branch の目的を 1-2 文で確認する
  • rebase 先の branch を決める
  • さっさと git fetchgit rebase を実行する

手順

  1. 状態確認

    bash
    git status --short --branch
    
  2. base を更新して rebase 開始

    bash
    git fetch origin <base>
    git rebase origin/<base>
    
  3. 止まったら conflict file を確認

    bash
    git diff --name-only --diff-filter=U
    
  4. 簡単な file から解消

  • formatter
  • import order
  • rename / move
  • 機械的に両方載せられる変更
  1. 迷う file だけ 3-way を見る

    bash
    git show :1:path/to/file
    git show :2:path/to/file
    git show :3:path/to/file
    
  • :1: base
  • :2: applying commit
  • :3: rebased branch
  1. 解消したら追加して続行

    bash
    git add <files>
    git rebase --continue
    
  2. 次の conflict が出たら繰り返す

generated file / lockfile

  • source file を先に直す
  • generated file は後回し
  • lockfile は片方を採って前進し、rebase 後に再生成する

例:

bash
git checkout --ours ui/pnpm-lock.yaml
git add ui/pnpm-lock.yaml

PR を見る条件

最初から見ない。必要なときだけ見る。

  • base が曖昧
  • branch の目的が commit だけでは読めない
  • ユーザー確認前に背景が必要
bash
gh pr view --json number,title,body,url,baseRefName,headRefName
gh pr diff --name-only

ユーザー確認が必要なケース

  • どちらの仕様を採るか決めきれない
  • API / UI の最終挙動が二者択一
  • config / migration / security 影響がある

確認は短く聞く。

plaintext
`path/to/file` で conflict しています。
branch 側は <change>、base 側は <change> です。
推奨は <resolution> です。これで進めてよいですか?

完了後

bash
git push --force-with-lease origin HEAD

報告すること:

  • どこに rebase したか
  • conflict をどう解いたか
  • ユーザー確認が必要だった件数

Expand your agent's capabilities with these related and highly-rated skills.

sushichan044/dotfiles

terraform-style-guide

Generate Terraform HCL code following HashiCorp's official style conventions and best practices. Use when writing, reviewing, or generating Terraform configurations.

15 0
Explore
sushichan044/dotfiles

fix-github-actions-ci

GitHub Actions CI の失敗を調査して修正するためのスキルです。CI ログを分析して失敗箇所・原因を特定し、そのまま修正作業まで行います。

15 0
Explore
sushichan044/dotfiles

dd-logs

Log management - search, pipelines, archives, and cost control.

15 0
Explore
sushichan044/dotfiles

golang-safety

Defensive Golang coding to prevent panics, silent data corruption, and subtle runtime bugs. Use whenever writing or reviewing Go code that involves nil-prone types (pointers, interfaces, maps, slices, channels), numeric conversions, resource lifecycle (defer in loops), or defensive copying. Also triggers on questions about nil panics, append aliasing, map concurrent access, float comparison, or zero-value design.

15 0
Explore
sushichan044/dotfiles

golang-data-structures

Golang data structures — slices (internals, capacity growth, preallocation, slices package), maps (internals, hash buckets, maps package), arrays, container/list/heap/ring, strings.Builder vs bytes.Buffer, generic collections, pointers (unsafe.Pointer, weak.Pointer), and copy semantics. Use when choosing or optimizing Go data structures, implementing generic containers, using container/ packages, unsafe or weak pointers, or questioning slice/map internals.

15 0
Explore
sushichan044/dotfiles

smart-compact

セッションのコンテキストを分析し、重要な情報を保持するためのプロンプトを生成して /compact コマンドの実行を支援するスキル。コンテキストウィンドウが逼迫してきた時や、セッションを整理したい時に使用。

15 0
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results