Skip to content
cccskills
FreePublished on GitHub

commit-split

1 つの作業ツリーに混ざった差分を、変更理由ごとの意味単位のコミットへ分割する。ユーザーが「コミットを分割して」「意味単位で分けて」「commit-split」等を求めたとき、または機能追加・付随リファクタ・設定/ドキュメント修正が 1 コミットに混在していると気づいたときに使用する。

分割案を提示して承認を得てからステージし、コミットごとに単独で成立することを確認する。メッセージ規約・push・PR の作成は commit-and-draft-pr へ委譲する。

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md3.8 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

/commit-split スキル

Goal

未コミットの作業ツリーに混在した差分を、変更理由ごとのコミットへ分割する。

1 セッションの作業で機能追加・付随リファクタ・設定/ドキュメント修正が 1 コミットに固まると、レビュー側が毎回「どこが本題か」を切り分けることになり、部分 revert もできない。分割の単位は変更意図の判断が要るため、案を会話上で提示して確定してから手を動かす。

Workflow

Step 1: 差分を確定する

  • git status --short で変更ファイルと未追跡ファイルを把握する
  • git diff と git diff --cached で中身まで読む(既にステージ済みの内容を見落とさない)
  • 差分が無ければ中断して報告する
  • マージやコンフリクト解消の途中(git status に UU)なら、先に解消してから始める

Step 2: 分割案を提示して承認を得る

  • 差分を「変更理由」で分類する。同じ理由で同時に変わるものを 1 コミットに束ねる
  • 各コミットについて type / 対象パス / 要約を列挙し、順序とあわせて提示する
  • 既定は 2〜4 コミット。それを超える場合は理由を添える
  • 1 つの変更理由にしかならないと判断したら、分割せずその旨を報告して commit-and-draft-pr へ渡す

Step 3: 承認順にステージする

  • ファイル単位で分かれるなら git add <pathspec>、1 ファイル内で理由が混ざるなら git add -p を使う
  • ステージ後に git diff --cached を読み、そのコミットの意図と一致することを確認する
  • 一時/デバッグ用ファイル、ローカル設定、秘密情報(.env 等)、生成物は原則除外する

Step 4: コミット単独での成立を確認する

  • そのコミットの変更ファイルに対応するテスト・リンタ・型チェックを実行する
  • ハンク単位で分割した場合は中間コミットがビルド不能になりやすいため、この確認を飛ばさない
  • 通らなければ束ね方を見直す(必要なハンクを同じコミットへ寄せる)

Step 5: コミットする

  • メッセージ形式・type 一覧・本文の書き方は commit-and-draft-pr の規約に従う
  • Step 2 の分割案を 1 コミットずつ消化し、残り差分が無くなるまで Step 3 へ戻る

Step 6: push と PR を委譲する

  • 全コミットが揃ったら commit-and-draft-pr へ渡し、ブランチ確認・push・ドラフト PR 作成はそちらで行う

Notes

  • 対象は未コミットの作業ツリーのみ。push 済み履歴の書き換え(rebase / amend / force-push)には踏み込まない
  • 中断するときは git reset でステージを戻し、作業ツリーを開始時の状態に保つ。半端なステージを index に残さない
  • 分割しすぎるとレビュー負荷が逆に上がる。「別々に revert したいか」で単位を決める
  • 承認前に git add しない。分割案はユーザーが確定するもので、こちらが先に index を作ると見直しが手戻りになる

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Convert Claude markdown subagent files to Codex CLI TOML format. Parses YAML frontmatter and body, applies model/permission/tool mappings, and outputs to agents/codex/<name>.toml.

The English summary is being prepared. Showing the original description.

hodanov/my-pde3Updated Oct 18, 2026

Create or update a Markdown blog draft from recent work and export it with `YYYY-MM-DD_slug.md` naming. Output directory can be set via environment variable or CLI option; if missing, ask the user and pass it explicitly.

The English summary is being prepared. Showing the original description.

hodanov/my-pde3Updated Oct 18, 2026

変更をコミットしてドラフトPRを作成する一連のGit/ghワークフロー。ユーザーが「コミットして」「PR作って」「draft PR」等を求めたときに使用し、status/diff確認・命令形コミット・push・gh pr create --draft(--assignee hodanov)まで実行する。ユーザーの明示リクエストが無くても、実装完了後にcommitやPRが必要になった場面(dev-workflowのcommitフェーズ等)では必ずこれを使う。`git commit` や `gh pr create` を単体でBash直接実行しない。

The English summary is being prepared. Showing the original description.

hodanov/my-pde3Updated Oct 18, 2026

gitleaks + pre-commit を使ってローカルコミット時のクレデンシャル混入を機械的にブロックする。「クレデンシャル漏洩防止」「シークレット混入対策」「gitleaks」「pre-commit シークレット」「credential leak prevention」に言及した場合に使用する。

The English summary is being prepared. Showing the original description.

hodanov/my-pde3Updated Oct 18, 2026

依存パッケージ(Go modules / npm / Terraform provider / GitHub Actions / pre-commit 等)の アップグレードを、outdated 検出 → CHANGELOG・破壊的変更の確認 → 更新 → lint/test 検証 → コミットまで一連の手順で安全に適用する。「依存更新」「パッケージを上げて」「dependency update」 「go get -u」「npm update」「provider を上げる」等に言及されたときに使用する。

The English summary is being prepared. Showing the original description.

hodanov/my-pde3Updated Oct 18, 2026

ai-agents/ と dotfiles/ の編集内容を各 AI CLI(~/.claude, ~/.codex)と ~/.config へ反映するデプロイ手順。「設定を反映」「デプロイ」「~/.claude に配って」「スキル/エージェント/設定を更新したから配布」等を求められたときに使用する。

The English summary is being prepared. Showing the original description.

hodanov/my-pde3Updated Oct 18, 2026

See all skills by hodanov

Report a problem with this skill