본문으로 건너뛰기
cccskills
무료GitHub에 공개

git-commit

Use Git changes to generate Conventional Commits messages, a format that labels each change by type, and create commits. The skill suggests splitting unrelated changes and supports explicit scope, type, sign-off, and amendments to the previous commit.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

Analyze changes with Git only and auto-generate conventional commit messages with optional emoji; suggests splitting commits when needed, runs local Git hooks by default (use --no-verify to skip)

설치 방법 보기

이럴 때 유용합니다

  • Generate a commit message from staged changes
  • Split unrelated changes into separate commits
  • Specify a commit type and scope
  • Amend the previous commit or add a sign-off

포함된 파일(1)

  • SKILL.md8.6 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Claude Command: Commit (Git-only)

This command works without any package manager/build tools, using only Git to:

  • Read changes (staged/unstaged)
  • Determine if changes should be split into multiple commits
  • Generate Conventional Commits style messages with optional emoji for each commit
  • Execute git add and git commit as needed (runs local Git hooks by default; use --no-verify to skip)

Usage

/git-commit
/git-commit --no-verify
/git-commit --emoji
/git-commit --all --signoff
/git-commit --amend
/git-commit --scope ui --type feat --emoji

Options

  • --no-verify: Skip local Git hooks (pre-commit/commit-msg etc.).
  • --all: When staging area is empty, automatically git add -A to include all changes in the commit.
  • --amend: Amend the last commit without creating a new one (preserves author and timestamp unless local Git config specifies otherwise).
  • --signoff: Add Signed-off-by line (use when following DCO process).
  • --emoji: Include emoji prefix in commit message (omit for plain text).
  • --scope <scope>: Specify commit scope (e.g., ui, docs, api), written to message header.
  • --type <type>: Force commit type (e.g., feat, fix, docs), overrides automatic detection.

Note: If the framework doesn't support interactive confirmation, enable confirm: true in front-matter to avoid mistakes.


What This Command Does

  1. Repository/Branch Validation

    • Check if in a Git repository using git rev-parse --is-inside-work-tree.
    • Read current branch/HEAD status; if in rebase/merge conflict state, prompt to resolve conflicts first.
  2. Change Detection

    • Get staged and unstaged changes using git status --porcelain and git diff.
    • If staged files = 0:
      • If --all is passed → Execute git add -A.
      • Otherwise prompt choice: continue analyzing unstaged changes for suggestions, or cancel to manually group staging.
  3. Split Suggestions (Split Heuristics)

    • Cluster by concerns, file modes, change types (e.g., source code vs docs/tests; different directories/packages; additions vs deletions).
    • If multiple independent changesets or large diff detected (e.g., > 300 lines / across multiple top-level directories), suggest splitting commits with pathspecs for each group (for subsequent git add <paths>).
  4. Commit Message Generation (Conventional with Optional Emoji)

    • Auto-infer type (feat/fix/docs/refactor/test/chore/perf/style/ci/revert...) and optional scope.
    • Generate message header: [<emoji>] <type>(<scope>)?: <subject> (first line ≤ 72 chars, imperative mood, emoji included only with --emoji flag).
    • Generate message body:
      • Must have a blank line after the subject.
      • Use list format, each item starts with -.
      • Each item must use imperative verb-first sentences (e.g., "add…", "fix…", "update…").
      • Colon-separated formats are prohibited (e.g., "Feature: description", "Impl: content").
      • Describe the motivation, implementation details, or impact scope (3 items or fewer recommended).
    • Generate message footer (if any):
      • Must have a blank line after the Body.
      • BREAKING CHANGE: If there are breaking changes, must include BREAKING CHANGE: <description>, or add exclamation mark after type (e.g., feat!:).
      • Other footers use git trailer format (e.g., Closes #123, Refs: #456, Reviewed-by: Name).
    • Select message language to match the predominant language in Git history. Inspect recent commit subjects (e.g., git log -n 50 --pretty=%s) to decide Chinese vs English; if unclear, fall back to the repository's primary locale or English.
    • Write draft to .git/COMMIT_EDITMSG for use with git commit.
  5. Execute Commit

    • Single commit scenario: git commit [-S] [--no-verify] [-s] -F .git/COMMIT_EDITMSG
    • Multiple commit scenario (if split accepted): Provide clear instructions for git add <paths> && git commit ... per group; execute sequentially if allowed.
  6. Safe Rollback

    • If mistakenly staged, use git restore --staged <paths> to unstage (command provides instructions, doesn't modify file contents).

Best Practices for Commits

  • Atomic commits: One commit does one thing, easier to trace and review.
  • Group before committing: Split by directory/module/feature.
  • Clear subject: First line ≤ 72 chars, imperative mood.
  • Body with context: Explain motivation, solution, and impact scope (colon-separated formats prohibited).
  • Follow Conventional Commits: <type>(<scope>): <subject>.

Type to Emoji Mapping (When --emoji is Used)

  • ✨ feat: New feature
  • 🐛 fix: Bug fix (includes 🔥 remove code/files, 🚑️ hotfix, 👽️ adapt to external API changes, 🔒️ security fix, 🚨 fix warnings, 💚 fix CI)
  • 📝 docs: Documentation and comments
  • 🎨 style: Code style/formatting (no semantic changes)
  • ♻️ refactor: Refactoring (no new features, no bug fixes)
  • ⚡️ perf: Performance improvements
  • ✅ test: Add/fix tests, snapshots
  • 🔧 chore: Build/tools/misc tasks (merge branches, update configs, release tags, pin dependencies, .gitignore, etc.)
  • 👷 ci: CI/CD configuration and scripts
  • ⏪️ revert: Revert commits
  • 💥 feat: Breaking changes (explained in BREAKING CHANGE: section)

If --type/--scope is passed, it will override auto-detection. Emoji is only included when --emoji flag is specified.


Guidelines for Splitting Commits

  1. Different concerns: Unrelated feature/module changes should be split.
  2. Different types: Don't mix feat, fix, refactor in the same commit.
  3. File modes: Source code vs docs/tests/configs should be grouped separately.
  4. Size threshold: Large diffs (e.g., >300 lines or across multiple top-level directories) should be split.
  5. Revertability: Ensure each commit can be independently reverted.

Examples

Good (with --emoji)

- ✨ feat(ui): add user authentication flow
- 🐛 fix(api): handle token refresh race condition
- 📝 docs: update API usage examples
- ♻️ refactor(core): extract retry logic into helper
- ✅ test: add unit tests for rate limiter
- 🔧 chore: update git hooks and repository settings
- ⏪️ revert: revert "feat(core): introduce streaming API"

Good (without --emoji)

- feat(ui): add user authentication flow
- fix(api): handle token refresh race condition
- docs: update API usage examples
- refactor(core): extract retry logic into helper
- test: add unit tests for rate limiter
- chore: update git hooks and repository settings
- revert: revert "feat(core): introduce streaming API"

Good (with Body)

feat(auth): add OAuth2 login flow

- implement Google and GitHub third-party login
- add user authorization callback handling
- improve login state persistence logic

Closes #42
fix(ui): fix button spacing on mobile devices

- adjust button padding to fit small screens
- fix styling issues on iOS Safari
- optimize touch target size

Good (with BREAKING CHANGE)

feat(api)!: redesign authentication API

- migrate from session-based to JWT authentication
- update all endpoint signatures
- remove deprecated login methods

BREAKING CHANGE: authentication API has been completely redesigned, all clients must update their integration

Split Example

- `feat(types): add new type defs for payment method`
- `docs: update API docs for new types`
- `test: add unit tests for payment types`
- `fix: address linter warnings in new files` ← (if your repo has hook errors)

Important Notes

  • Git only: No package manager/build commands (pnpm/npm/yarn etc.).
  • Respects hooks: Executes local Git hooks by default; use --no-verify to skip.
  • No source code changes: Command only reads/writes .git/COMMIT_EDITMSG and staging area; doesn't directly edit working directory files.
  • Safety prompts: In rebase/merge conflicts, detached HEAD states, prompts to handle/confirm before continuing.
  • Auditable and controllable: If confirm: true is enabled, each actual git add/git commit step requires confirmation.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

bmad-init

무료

Set up or update BMad-Method V6 in a project, detect older installations, fix a known output folder issue, and adjust Git ignore rules, with guidance on what to do next.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Installing BMad-Method V6 in a project
  • Updating an existing V6 installation
  • Checking for an older V4 installation
UfoMiao/zcf6.1천2026년 8월 31일 업데이트

bmad-init

무료

Install or update BMad-Method (V6) in a project after checking existing installations. The skill also fixes a known output-folder issue, updates Git ignore rules, and provides next steps for using the installed workflows.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Set up BMad-Method (V6) for Claude Code
  • Run a quick update on an existing V6 installation
  • Check for an older V4 installation before setup
UfoMiao/zcf6.1천2026년 8월 31일 업데이트

feat

무료

Guide new feature work from requirements and planning through revisions and implementation. Create Markdown plans with acceptance criteria, track progress, and ensure frontend tasks have a UI design before development begins.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Turn a feature idea into an implementation plan
  • Revise a plan based on feedback
  • Start implementation from an agreed plan
UfoMiao/zcf6.1천2026년 8월 31일 업데이트

feat

무료

Turn feature requests into documented plans, revise them through discussion, and carry out implementation with progress tracking. Frontend work includes checking for a UI design and arranging design work when needed.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Turning a feature idea into a development plan
  • Revising a plan after feedback
  • Implementing tasks from an agreed plan
UfoMiao/zcf6.1천2026년 8월 31일 업데이트

Find Git branches that have been merged or inactive for a chosen period. Preview cleanup candidates, exclude protected branches, and delete local or remote branches using a selected base branch and confirmation options.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Find merged branches to clean up
  • Review branches with no recent commits
  • Clean up branches merged into a release
UfoMiao/zcf6.1천2026년 8월 31일 업데이트

Find merged or inactive Git branches, preview cleanup candidates, and delete selected branches after confirmation. Choose a comparison branch, protect important branches with configurable rules, and optionally include remote branches.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Previewing branch cleanup candidates
  • Removing branches already merged into a release branch
  • Finding branches with no recent commits
UfoMiao/zcf6.1천2026년 8월 31일 업데이트

UfoMiao의 스킬 모두 보기

이 스킬의 문제 신고