본문으로 건너뛰기
Skillpedia
일반 코딩33k · #8853

commit-smart

하는 일

이 스킬은 에이전트가 실제 코드 변경으로부터 git 커밋 메시지를 쓰도록 돕습니다. 일관되고 의미 있는 커밋 기록을 원하는 개발자에게 맞습니다.

사용하는 경우

  • ✓변경 사항이 준비되어 명확한 커밋 메시지를 써야 할 때.
  • ✓규칙을 외우지 않고 컨벤셔널 커밋 형식을 따르고 싶을 때.
  • ✓관련 파일을 논리적인 커밋 단위로 묶고 싶을 때.

스킬 링크

https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/git/commit-smart/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/git/commit-smart/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“스테이징된 변경 사항을 보고, 제가 왜 그렇게 수정했는지 설명하는 컨벤셔널 커밋 메시지를 써 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 git 상태와 스테이징된 diff를 확인하고, 바뀐 파일에서 커밋 종류와 범위를 고른 뒤, 변경의 이유에 초점을 둔 메시지를 씁니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Smart Commit

Create meaningful conventional commits by analyzing your actual changes.

Workflow

Step 1: Assess the working tree

Run these commands to understand the current state:

git status
git diff --stat
git diff --cached --stat

Step 2: Handle unstaged changes

If nothing is staged (git diff --cached is empty):

  1. Show the user what files have changed
  2. Suggest what to stage based on logical grouping (e.g., "these 3 files are all related to the auth refactor")
  3. Ask if they want to stage all, or select specific files
  4. Stage the approved files with git add <files>

If changes are already staged, proceed to analysis.

Step 3: Analyze the diff

Read the full staged diff:

git diff --cached

Determine the commit type from the changes:

Signal Type
New files with new functionality feat
New test files or test additions test
Changes to existing logic fixing incorrect behavior fix
Structural changes without behavior change refactor
package.json, tsconfig, CI config changes chore
Build/bundler config changes build
README, docs, comments only docs
Formatting, whitespace, semicolons only style
Performance improvements perf

Determine the scope from the primary directory or module affected:

  • src/api/ -> api
  • src/components/auth/ -> auth
  • tests/ -> tests
  • Root config files -> omit scope
  • Multiple unrelated areas -> omit scope

Step 4: Check for user overrides

If the user provided arguments via $ARGUMENTS:

  • Single word (e.g., fix) -> use as commit type
  • Two words (e.g., refactor api) -> use as type and scope
  • Otherwise -> use auto-detected values

Step 5: Compose the commit message

Format: type(scope): imperative short description

Rules:

  • Subject line max 72 characters
  • Use imperative mood ("add", "fix", "refactor", not "added", "fixes")
  • Don't end with a period
  • Body explains WHY this change was made, not what changed (the diff shows what)
  • If changes are trivial (typo fix, formatting), skip the body

Example:

feat(auth): add JWT refresh token rotation

Tokens were expiring mid-session for users with slow connections.
Rotating refresh tokens extends the session without compromising
security, since each refresh token can only be used once.

Step 6: Confirm and commit

Show the user the proposed commit message and ask for confirmation.

If confirmed, run:

git commit -m "<message>"

Then verify with:

git log --oneline -1

Show the committed hash and message.

Tips

  • Run after completing a logical unit of work, not after every file change
  • If the diff is too large for one commit, suggest splitting into multiple commits
  • For breaking changes, add ! after the scope: feat(api)!: change response format
  • The body should answer "if someone reads this commit in 6 months, will they understand WHY?"
자주 묻는 질문

컨벤셔널 커밋이란 무엇인가요?

feat나 fix 같은 종류와 선택적인 범위로 시작하는 표준 메시지 형식입니다.

아무것도 스테이징되지 않았다면요?

스킬은 바뀐 파일을 보여주고, 논리적인 묶음을 제안한 뒤, 어떤 파일을 스테이징할지 묻습니다.

커밋 종류를 직접 고를 수 있나요?

네. fix나 refactor api처럼 종류와 범위를 넘기면 메시지 작성을 안내할 수 있습니다.

상세 정보

작성자의 원본 설명

Analyze staged/unstaged changes and create semantic conventional commits with context about WHY, not just WHAT. Auto-detects commit type and scope from the diff. Supports optional type/scope arguments. Usage - /commit-smart, /commit-smart fix, /commit-smart refactor api

repo: davila7/claude-code-templates

인기도

GitHub 스타
33k
순위
#8853
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬