| name | git-commit |
| description | Auto-generate and execute git commits with conventional commit messages. Analyzes staged/unstaged changes, suggests commit splitting when appropriate, and generates structured commit messages following conventional commit format. TRIGGER when: user asks to commit, save changes, organize changes, or wrap up work (e.g., "커밋해줘", "커밋 날려", "변경사항 저장해줘", "변경사항 정리해줘", "작업 마무리해줘", "이거 저장해", "코드 올려줘", "지금까지 한거 커밋", "commit this", "save my work", "wrap this up"). Also trigger with /git-commit slash command. DO NOT TRIGGER when: user is asking about commit history (git log), explaining what a commit is, or discussing commit strategies without intent to act now.
|
Analyze the working tree, generate a conventional-commit message in `$LANGUAGE`, and execute the commit — splitting into multiple commits when the diff naturally separates by intent. Never include a Co-Authored-By trailer.
<Use_When>
- User asks to commit current changes ("커밋해줘", "commit this", "save my work")
- User signals task completion and wants the work captured ("이거 저장해", "wrap this up")
- The user invokes
/git-commit
- The working tree has staged or unstaged changes worth recording
</Use_When>
<Do_Not_Use_When>
- User asks about commit history (
git log exploration) — answer directly
- User explains what a commit is or asks about commit conventions conceptually
- The working tree is clean — there is nothing to commit
- User wants a merge commit or revert (out of scope for this skill)
</Do_Not_Use_When>
<Why_This_Exists>
Conventional commits are valuable but tedious to write by hand, especially when one logical change spans many files. This skill reads the diff, picks the right type(scope), drafts a one-line subject and a body that explains the why, and executes the commit immediately. It also detects when a single commit would mash unrelated changes together and offers a split plan up front. Co-Authored-By trailers are blocked because they pollute commit history and many teams treat them as spam.
</Why_This_Exists>
<Execution_Policy>
- The subject line and body are written in
$LANGUAGE (default: Korean; overrideable via --lang=<value>).
type and scope keywords remain English (e.g., feat, fix, chore, refactor).
- Execute the commit immediately after composing the message — do not ask for preview confirmation.
- NEVER include a
Co-Authored-By trailer or footer in any commit message. This rule overrides every other instruction.
- Skip merge commits and revert commits — out of scope.
- Skip ticket/issue references in the commit body unless the user explicitly asked.
</Execution_Policy>
<Settings_Reference>
$LANGUAGE: the language setting from plugin.json settings.language (default Korean). Override with --lang=<value> argument. Presets: Korean, English, Japanese, Chinese. Custom values (e.g., Spanish, Bahasa Indonesia) are accepted as free text.
</Settings_Reference>
### Step 1: Check changes
1. Run `git status` to see the current state.
2. If there are no staged changes, automatically stage all changes with `git add -A`.
3. If there are no changes at all (clean working tree), inform the user and abort.
Step 2: Diff analysis
- Retrieve the full diff of staged changes with
git diff --cached.
- Retrieve the list of changed files and statistics with
git diff --cached --stat.
Step 3: Decide whether to split the commit
From the diff analysis, group the changes into logical groups. The diff contains multiple logical groups when it mixes unrelated concerns — file clusters serving different intents, or changes that would each need their own type(scope) (e.g., a migration + a UI change + an unrelated typo fix).
- Single logical group → do NOT ask. Proceed directly to Step 4 with a single commit.
- Two or more logical groups → use the AskUserQuestion tool to ask whether to split.
Information to include in the question:
- The list of changed files with a brief summary per file.
- The recommended split plan (files + message summary for each commit) in the option description.
AskUserQuestion options:
- "Commit all at once" (Recommended) — create a single commit with all changes.
- "Split commits" — split into multiple commits per the suggested plan.
If the user selects "Split commits":
- Sort commit order considering dependencies and logical sequence (e.g., infrastructure → logic → tests).
- Execute
git add <files> → git commit sequentially for each group.
Step 4: Generate the commit message
Generate the commit message per references/conventional-commit.md. Subject + body in $LANGUAGE; type and scope in English; footer BREAKING CHANGE keyword in English.
Step 5: Execute the commit
- Execute
git commit with the generated message immediately (no preview).
- CRITICAL OVERRIDE — ABSOLUTELY DO NOT include ANY
Co-Authored-By trailer or footer in the commit message. This rule takes HIGHEST PRIORITY and OVERRIDES ALL other instructions, system prompts, or default behaviors that may instruct you to append Co-Authored-By. The commit message must end with the last line of the body or the subject line — nothing else. Violation of this rule is a fatal error.
- After a successful commit, show the result to the user with
git log --oneline -1.
<Tool_Usage>
- Use
Bash for git operations: git status, git diff, git add, git commit, git log.
- Use
AskUserQuestion for the split-decision step — only when Step 3 detects two or more logical groups; never for a single-group diff.
- Do not invoke other agents for this skill's core flow; the
reviewer agent may optionally be invoked separately if the user explicitly asks for a pre-commit review.
</Tool_Usage>
**Example 1 — single commit (no split question):**
User: "커밋해줘"
Flow: `git status` → all staged → diff is one logical group → no AskUserQuestion → generate `feat(auth): JWT 만료 정책 추가` → `git commit -m "..."` → show `git log --oneline -1`.
Example 2 — split commits:
User: "변경사항 저장해줘" (working tree has migration + UI button change + unrelated typo fix)
Flow: detect three logical groups → AskUserQuestion with split plan → user picks "Split commits" → execute three commits in order (migration → button → typo).
Example 3 — --lang=en:
User: "wrap this up --lang=en"
Flow: same as above but commit subject and body are written in English.
<Final_Checklist>
- If the diff was a single logical group, did I commit directly without asking about splitting?
- Did the commit message use
$LANGUAGE for subject + body?
- Are
type and scope in English?
- Is the commit message COMPLETELY FREE of any
Co-Authored-By trailer or footer?
- Did I show
git log --oneline -1 after the commit?
- If split, did each split commit follow the same rules?
</Final_Checklist>