Back to list
kkhys

formatting-commit

by kkhys

My personal marketplace for Claude Code.

1🍴 0📅 Jan 21, 2026

SKILL.md


name: formatting-commit description: Commits code changes with appropriate git commit strategy. Adopts Squash (default), new commit, or Interactive Rebase based on context, and creates messages following Conventional Commits format. Use when implementation is complete or user requests a commit.

High Quality Commit

Step 1: Check Branch State

git status
git log --oneline --graph origin/main..HEAD

Step 2: Choose Commit Strategy

Strategy A: Squash (Default)

Squash into existing commit when changes relate to same theme and no reason to split.

git add -A
git commit --amend

Strategy B: New Commit

Create new commit when it's the first commit, or changes are independent from existing commits.

git add -A
git commit

Strategy C: Interactive Rebase

Reorganize commit history to group small commits, reorder, or clean up WIP commits.

git rebase -i origin/main

Operations: pick (keep), squash (merge), reword (edit message), drop (remove)

Strategy Selection Flowchart

Does branch have commits?
  ├─ No → New commit
  └─ Yes → Same theme as existing commit?
      ├─ Yes → Squash (git commit --amend)
      └─ No → Rational to split?
          ├─ Yes → New commit
          └─ Want to organize history → Interactive Rebase

Step 3: Commit Message

Format (Conventional Commits)

<type>[scope]: <description>

[body]

[footer]

Types

  • feat: New feature
  • fix: Bug fix
  • refactor: Code refactoring
  • perf: Performance improvement
  • test: Add or modify tests
  • docs: Documentation changes
  • style: Formatting changes
  • build: Build-related changes
  • ci: CI configuration
  • chore: Other changes

Guidelines

  • Subject: Max 50 chars, imperative mood, lowercase start, no period
  • Body (Optional): Explain why (not what), wrap at 72 chars
  • Footer (Optional): Closes #123, BREAKING CHANGE: or feat(api)!:

Commit with Heredoc

git commit -m "$(cat <<'EOF'
feat(auth): add OAuth2 login flow

Implement OAuth2 authentication to support third-party login providers.

Closes #123
EOF
)"

Step 4: Verify After Commit

git log -1 --stat
git status

Important Notes

  1. Never execute on main branch: Always work on feature branches
  2. Atomic commits: Each commit should be independently meaningful
  3. Consistency: Follow existing project commit style
  4. Force push: Use git push --force-with-lease after amend

Detailed Guide

See references/examples.md for detailed examples and troubleshooting.

Score

Total Score

50/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon