| 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>