File contents git-commit-helper
ユーザー環境では ~/.git-hooks/commit-msg で Conventional Commits を強制している。この validator を通すための定型手順。
Procedure
git diff --cached --stat で staged 内容を確認
変更を 機能スコープ単位 に分類:
feat 新機能 / fix バグ修正 / docs ドキュメント
style 整形のみ / refactor 振る舞い変えず再構成 / perf 性能改善
test テスト / chore 雑務 / ci CI 設定 / build ビルド / revert 取り消し
メッセージ形式: <type>(<scope>): <subject 72字以内>
例: feat(scraper): add Uniqlo MediaRSS feed parser
body (optional): なぜ変更したかを 2-3 行で。-m を追加して空行で区切る
footer (optional):
BREAKING CHANGE: <内容>
Closes #N / Refs #N
Co-Authored-By: Name <email>
実行例:git commit -m "feat(closet-os): add UNIQLO scraper" -m "MediaRSS endpoint へ切替。HTML スクレイプ失敗の代替経路。"
複数行はヒアドキュメント:git commit -m "$(cat <<'EOF'
refactor(memory): split MEMORY.md by domain
index ファイルが肥大化したので feedback_/project_/reference_ プレフィックスで分割。
EOF
)"
Pitfalls
<type> は 小文字必須 。Feat: は validator NG
scope に長い文字列(20字超)を入れると弾かれることがある → 短いスラッグで
1 commit に複数 type 混在(例: feat + test)は分割推奨。validator は通っても粒度が崩れる
--no-verify で hook をスキップしない(CLAUDE.md / global ルールで禁止)
emoji prefix(✨🐛 など)は validator 弾き
subject 末尾の句点(. 。)は付けない
body は subject から 空行 1 行 開ける(-m を 2 回使えば自動で空行になる)
Verification
1 --- 2 name: git-commit-helper 3 description: git-commit-helper 4 --- 5 6 # git-commit-helper 7 8 ユーザー環境では `~/.git-hooks/commit-msg` で Conventional Commits を強制している。この validator を通すための定型手順。 9 10 ## Procedure 11 12 1. `git diff --cached --stat` で staged 内容を確認 13 2. 変更を **機能スコープ単位** に分類: 14 - `feat` 新機能 / `fix` バグ修正 / `docs` ドキュメント 15 - `style` 整形のみ / `refactor` 振る舞い変えず再構成 / `perf` 性能改善 16 - `test` テスト / `chore` 雑務 / `ci` CI 設定 / `build` ビルド / `revert` 取り消し 17 3. メッセージ形式: `<type>(<scope>): <subject 72字以内>` 18 - 例: `feat(scraper): add Uniqlo MediaRSS feed parser` 19 4. body (optional): なぜ変更したかを 2-3 行で。`-m` を追加して空行で区切る 20 5. footer (optional): 21 - `BREAKING CHANGE: <内容>` 22 - `Closes #N` / `Refs #N` 23 - `Co-Authored-By: Name <email>` 24 6. 実行例: 25 ```bash 26 git commit -m "feat(closet-os): add UNIQLO scraper" -m "MediaRSS endpoint へ切替。HTML スクレイプ失敗の代替経路。" 27 ``` 28 複数行はヒアドキュメント: 29 ```bash 30 git commit -m "$(cat <<'EOF' 31 refactor(memory): split MEMORY.md by domain 32 33 index ファイルが肥大化したので feedback_/project_/reference_ プレフィックスで分割。 34 EOF 35 )" 36 ``` 37 38 ## Pitfalls 39 40 - `<type>` は **小文字必須**。`Feat:` は validator NG 41 - scope に長い文字列(20字超)を入れると弾かれることがある → 短いスラッグで 42 - 1 commit に複数 type 混在(例: feat + test)は分割推奨。validator は通っても粒度が崩れる 43 - `--no-verify` で hook をスキップしない(CLAUDE.md / global ルールで禁止) 44 - emoji prefix(✨🐛 など)は validator 弾き 45 - subject 末尾の句点(`.` `。`)は付けない 46 - body は subject から **空行 1 行** 開ける(`-m` を 2 回使えば自動で空行になる) 47 48 ## Verification 49 50 - `git log -1 --format='%s'` で format を目視確認 51 - hook 単体ベリファイ: 52 ```bash 53 git log -1 --format='%B' > /tmp/last-msg && ~/.git-hooks/commit-msg /tmp/last-msg && echo OK 54 ``` 55 exit 0 なら通過 56 - 複数 commit を後追いで確認: 57 ```bash 58 git log --format='%h %s' origin/main..HEAD 59 ```
bokuwalily/claude-code-skills/tree/main/skills/git-commit-helper commit cb38bfebc8
Frequently asked questions How do I install the Git Commit Helper skill? Run npx skillmds@latest add bokuwalily/git-commit-helper in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
What does the Git Commit Helper skill do? git-commit-helper It is listed under Coding & Dev Tools on SkillMD.
Is Git Commit Helper safe to use? This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
Which AI agents work with Git Commit Helper? This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Is Git Commit Helper free to use? Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
Who published Git Commit Helper? bokuwalily (@bokuwalily) published this skill. Their other Agent Skills are listed on their SkillMD profile.