commit skill
원자적 단위 식별, 커밋 순서 지정, 품질 게이트 및 메시지 검증을 포함한 구조화된 Git 워크플로우를 관리합니다.
- GitHub 스타
- 23
- 파일
- 1
- 마지막 커밋
- 2026년 11월 11일
- 라이선스
- MIT
- 허용된 도구
- 14
commit skill은 무엇을 하나요?
commit은(는) agent skill입니다. 원자적 단위 식별, 커밋 순서 지정, 품질 게이트 및 메시지 검증을 포함한 구조화된 Git 워크플로우를 관리합니다.
skill의 SKILL.md에서 생성된 요약입니다.
commit skill 정보
Git 저장소를 관리하는 개발자는 이 SKILL을 사용하여 구조화되고 원자적인 커밋 워크플로우를 구현할 수 있습니다. 논리적 작업 단위를 식별하고, 유형별로 순서를 정하며, 히스토리에 기록되기 전에 품질 게이트를 통과하도록 하는 프로세스를 자동화합니다. commit-message SKILL과 통합하여 엄격한 메시지 컨벤션을 강제하고 전용 node script를 사용하여 이를 검증합니다.
파이프라인은 git status 및 diff 명령어를 통해 변경 사항을 조사하고, style 및 refactor를 시작으로 fix 또는 feature로 이어지는 커밋 시퀀스를 계획하며, 프로젝트별 lint 또는 test 명령어를 실행하는 방식으로 작동합니다. Git 작업을 위해 bash 도구에 의존하며, 셸 인용 문제 없이 여러 줄의 커밋 메시지를 안전하게 처리하기 위해 임시 파일을 사용합니다. 이 접근 방식은 읽기 어려운 대규모 diff를 방지하고 모든 커밋이 검증된 단일 작동 상태의 코드베이스를 나타내도록 보장합니다.
agent가 수행할 수 있는 작업
- 1대규모 diff를 원자적 단위로 분할에이전트가 단일 대규모 변경 사항을 가져와 split 및 work-kind test를 사용하여 더 작고 논리적인 커밋으로 분할할 수 있습니다.
- 2프로젝트별 커밋 규칙 강제이 SKILL은 CLAUDE.md를 읽어 프로젝트에서 정의한 사용자 지정 검증 인자 및 추가 지침을 적용합니다.
- 3커밋 전 코드 품질 검증파이프라인은 lint, test 또는 build 명령어를 실행하여 결함이 있는 코드가 저장소에 커밋되지 않도록 보장합니다.
- 4커밋 메시지 품질 감사이 SKILL은 스테이징된 diff와 작성된 메시지를 대조하여 셀프 리뷰를 수행함으로써 변경 이유만 기록되도록 합니다.
skill의 SKILL.md를 기반으로 작성되었습니다. 모든 사용 사례는 해당 문서의 인용구와 대조 확인되었습니다.
commit skill 설치 방법
각 명령은 skill 폴더를 클라이언트의 skills 디렉터리에 복사합니다. 클라이언트를 재시작하거나 새 세션을 시작하여 로드하세요.플러그인에 commit skill 설치
/plugin marketplace add xobotyi/cc-foundry /plugin install git-commit@foundry
Claude Code에 commit skill 설치
~/.claude/skills/commit/SKILL.md
$ npx degit xobotyi/cc-foundry/plugins/git-commit/skills/commit ~/.claude/skills/commitClaude Code (project)에 commit skill 설치
.claude/skills/commit/SKILL.md
$ npx degit xobotyi/cc-foundry/plugins/git-commit/skills/commit .claude/skills/commitCodex에 commit skill 설치
~/.agents/skills/commit/SKILL.md
$ npx degit xobotyi/cc-foundry/plugins/git-commit/skills/commit ~/.agents/skills/commitGemini CLI에 commit skill 설치
~/.gemini/skills/commit/SKILL.md
$ npx degit xobotyi/cc-foundry/plugins/git-commit/skills/commit ~/.gemini/skills/commitClaude.ai에 commit skill 설치
npx degit xobotyi/cc-foundry/plugins/git-commit/skills/commit commit && zip -r commit.zip commit # claude.ai → Customize → Skills → + → Create skill → Upload a skill → commit.zip
SKILL.md
GitHub에서 보기Commit Pipeline
Skill(git-commit:commit-message)
Do not start the pipeline before that skill is loaded.
Project Configuration
<git-commit-config>
<validator-args>
<flag name="require-trailers" value="Task"/>
</validator-args>
<extra-instructions>
Project-specific commit guidance goes here.
</extra-instructions>
</git-commit-config>
Read the project CLAUDE.md file before the pipeline starts. Then obey the two elements:
<validator-args>— give each flag to the validator.<flag name="X" value="Y"/>becomes--X "Y"on the command line.<extra-instructions>— the guidance with the highest priority for this commit. Obey it in each step. It overrides the defaults of this skill.
Ground Rules
A permission prompt for git add or git commit in the middle of the pipeline shows that the grant expired. Invoke
this skill again to restore it.
- Am I in the commit pipeline?
- Which step am I on?
- Are the steps before it complete?
Name the step when you report your position. Write "resuming the Commit Loop at Self-Review". If you are not sure, read
the staged changes again with git diff --cached.
When to Commit
Run this pipeline during the work. Do not save it for the end of the task.
- Plan the units before the work starts. This pipeline then takes one planned unit at a time.
- Commit each verified step. The next step then builds on a committed base.
- An uncommitted tree holds no unit. A reviewer cannot read it.
git bisectcannot use it. - A tree with many units at entry shows a planning fault. Interleaved work splits badly. Split what separates cleanly. Then plan the change list before the next task.
- The
codingskill ofthe-codergives the change list and the size checkpoint.
Pipeline
1. Survey Changes
Run these commands in the repository that gets the commit:
git status --short --branch # staged, unstaged, and untracked files
git diff # unstaged changes to tracked files
git diff --cached # staged changes
git log --all --oneline --no-merges -10 # the subject form of the history
The first status column shows the staged state. The second column shows the unstaged state. The ?? mark shows an
untracked file. If the status shows no change, tell the user that there is nothing to commit. Then stop.
The two diff commands do not show an untracked file. Stage such a file with an explicit path. In a repo with no commits, all files are untracked.
Then find the separate units in the changes.
Two tests find the boundaries. Apply both:
- The split test. Cut the change into two pieces. Does each piece build and pass its tests? Then the change holds more than one unit. Commit the first piece. Apply the test again to the rest.
- The work-kind test. A unit does one kind of work, because a reviewer answers one question in each unit. New code and the wiring that integrates it are two units. A refactor and the feature it makes possible are two units. The split test misses both boundaries, because both pieces build and pass together.
These conditions show a boundary between two units:
- The files serve different purposes.
- The diff mixes format changes with logic changes.
- The diff mixes a refactor with new behavior.
- The diff holds more than one unrelated bug fix.
- The diff adds new code and also wires that code into its callers.
- One part of the diff builds and passes its tests alone.
2. Plan Units and Order
Give a type to each unit. Then commit the types in this order:
- Style — format, whitespace, and names.
- Refactor — structure changes that keep the behavior.
- Fix — bug corrections.
- Feature — new functions.
- Docs, test, and chore — documentation, tests, build, and tooling. Commit these units at any position.
Commit the style units and the refactor units first. This keeps the commits that change behavior clean.
Dependency order has priority over type order. If a fix builds on a feature, commit the feature first. Put the tests of a unit in the commit of that unit. Do not make a separate test commit, with one exception. Characterization tests pin the behavior of committed code before a change. They are a unit of their own. Commit them before that change.
3. Quality Gate
- Did the lint, test, or build commands run for the changed files in this session? If they ran and passed, start the Commit Loop.
- If no check ran, run the checks that apply to this project. Limit them to the changed files when this is possible.
- If a check fails, correct the problem first. Do not commit defective code.
- If all checks pass, start the Commit Loop.
Read <pipeline-awareness> again after you return from the fixes. Then continue at the first step of the Commit Loop.
Do not start the pipeline again. Do not skip a step.
The split test asserts that each unit builds and passes alone. This pipeline does not measure that assertion. A wrong
split leaves a broken commit in the middle of the history, and git bisect finds it much later.
Two habits keep the risk low. Commit a unit before the unit that depends on it. Give more care to the split test when a unit removes code, changes a signature, or moves a symbol, because these three cases break the callers that a later unit corrects.
4. Commit Loop
Do the steps below for each unit, in the planned order.
4a. Stage
git add <files>
Give an explicit path for each file. Do not use git add -p: it opens an interactive prompt, and the Bash tool has no
terminal to answer it.
To unstage the wrong file:
git restore --staged <file>
One file can hold two units. Do one of these two things:
- Remove one change with the Edit tool, commit the first unit, then write the change again.
- Accept the larger commit, and record both units in the message.
4b. Draft Message
Write the message of this unit. Obey the commit-message conventions. Save the message with the Write tool to a file in the temp directory of the system. A file gives git the multi-line message, the quotes, and the backticks without damage. Shell quoting damages them.
The Write tool overwrites an existing file without a warning. Two signs show that another writer uses the name:
- The first write reports that the file was updated, not created. Write the message again under a different name.
- The file changes after you write it, and you did not change it. Write the message again under a different name.
Leave the file of the other writer alone. Never commit a message file that holds text you did not write.
Write the reason first, in one paragraph. Then cut: delete each sentence that the diff shows, and each paragraph that walks the reader through the new procedure.
4c. Self-Review
git diff --cached
Verify each item before you continue:
- The staged diff holds only the intended unit. It has no debug code and no temporary file.
- The staged diff agrees with the drafted message.
- The staged diff has no sensitive data such as an
.envfile, a credential, or a secret. - The message obeys the commit-message conventions: terse register, no session artifacts, a record and not documentation.
P1: keep -- <the fact that it records>
P2: cut -- shown by the diff
P3.1: keep -- <the fact that it records>
P3.2: cut -- inventory of the diff
A paragraph earns keep only when it records the cause of the change, or an item of the earns-its-lines list in the
commit-message conventions.
A paragraph can hold a list, with one line for each behavior change. Audit such a paragraph line by line, as P3.1 and
P3.2 above, against the list rules of the commit-message conventions.
A paragraph gets cut when it names a function, a call order, an empty case, a fallback, or a flag that gates the new
code. Such a paragraph reports the procedure, and the staged diff shows the procedure. Move the fact into the artifact
when the next maintainer needs it. Then delete the paragraph.
The number of paragraphs follows the number of reasons, never the size of the diff. Write the message file again after the deletions.
4d. Validate
node ${CLAUDE_PLUGIN_ROOT}/scripts/validate-commit-message.mts --file <message file>
- Add the flags from
<validator-args>when the project config defines them. - Read the output. The validator prescribes; it does not block. It exits with status 0 even when it prints an ERROR, so the exit status tells you nothing about the message.
- Correct each ERROR before you continue.
- A WARN is a recommendation. Correct it when the correction is reasonable.
The validator does not check the ASCII rule, the 72-character body wrap, the scope format, the register, or AI attribution. You own those.
4e. Commit
Show the full message to the user as a blockquote. Then commit:
git commit -F <message file>
A project hook can stop the commit or change the files. Read the output. A hook that exits with an error stops the
commit, and the message file stays for the next attempt. A hook that reformats a file does not stage that reformat: the
commit holds the content that you staged, and the reformat stays in the working tree as an unstaged change. Run
git status after the commit and amend the commit when the reformat belongs to the same unit. Do not pass
--no-verify.
5. Verify
Run each command in a separate Bash call after the last unit:
git log --stat -3 # -3 = the number of commits that you created
git status
Then show the new commits with their subjects, the state of the current branch, and the changes that are still not committed.
Breaking Changes
Prefer a migration series to one breaking commit when you can stage the break:
- Add the new code. Keep the old code.
- Move the callers to the new code.
- Delete the old code in a later commit.
이 스킬의 파일
1commit skill 질문
Claude Code에 commit skill을 어떻게 설치하나요?
npx degit xobotyi/cc-foundry/plugins/git-commit/skills/commit ~/.claude/skills/commit를 실행합니다. Claude Code는 ~/.claude/skills(모든 프로젝트) 또는 .claude/skills(한 프로젝트)에서 skills를 로드하며, 설명이 작업과 일치할 때 skill을 사용합니다.
commit skill을 사용할 수 있는 클라이언트는 무엇인가요?
Agent Skills 형식을 읽는 모든 클라이언트(Claude Code, Codex, Gemini CLI, claude.ai(ZIP으로 업로드))가 사용할 수 있습니다. skill 내 스크립트는 클라이언트가 코드 실행을 허용하는 경우에만 실행됩니다.
다양한 유형의 변경 사항을 커밋할 때 권장되는 순서는 무엇인가요?
Style, Refactor, Fix, Feature 순으로 커밋한 다음 Docs, test 또는 chore를 진행하십시오. 의존성 순서가 유형 순서보다 우선합니다.
커밋을 원자적으로 유지하려면 어떻게 해야 하나요?
변경 사항을 빌드와 테스트를 모두 통과하는 두 개의 조각으로 나눌 수 있는지 확인하는 'split test'와, 하나의 단위가 한 가지 종류의 작업만 수행하는지 확인하는 'work-kind test'를 사용하십시오.
셸 인용 문제를 피하기 위해 여러 줄의 커밋 메시지를 어떻게 관리해야 하나요?
Write 도구를 사용하여 커밋 메시지를 임시 파일에 작성한 다음, 해당 파일을 git에 전달하여 여러 줄 메시지와 특수 문자가 그대로 유지되도록 하십시오.