git-commit
Create a concise git commit or commit subject from staged and unstaged changes compared with what is already committed. Use this skill for every request to commit, such as "commit this", "commit these changes", or "commit my work", or to write a commit message or subject from the current diff, not for release notes, changelogs, or PR summaries.
- License 许可
- MIT
- 最近更新
- 2026-11-02
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- git-commit
- license
- MIT
- description
- Create a concise git commit or commit subject from staged and unstaged changes compared with what is already committed. Use this skill for every request to commit, such as "commit this", "commit these changes", or "commit my work", or to write a commit message or subject from the current diff, not for release notes, changelogs, or PR summaries.
- compatibility
- Claude Code, GitHub Copilot CLI
03 SKILL.md 正文
Git Commit
What I do
- Check repository state and inspect staged and unstaged changes
- Read the current diff against what is already committed
- Draft a concise imperative subject that is easy to scan in
git log - Create a one-line commit by default when the user asks to commit
When to use me
Use this skill when the user wants to commit current repository changes or wants a commit message based on the current diff. Check both staged and unstaged work before drafting the subject. Do not use it for release notes, changelog entries, or pull request summaries.
Inputs or prerequisites
- A git repository
- Current changes in the worktree, index, or both
- A request to create the commit or draft its subject
Workflow
-
Check context first.
- Verify the directory is inside a git repository.
- Check whether there are staged changes, tracked unstaged changes, or untracked files.
- If there are no relevant changes, say so plainly instead of inventing a message.
-
Read the current diff for meaning.
- If there are staged changes, read the staged diff.
- If there are unstaged tracked changes, read the working tree diff too.
- If there are untracked files, inspect enough context to understand whether they belong in the likely next commit.
- Base the message on the functional change, not filenames alone.
- Distinguish fixes, features, refactors, tests, docs, or maintenance only when the diff supports it.
-
Draft the subject.
- Use imperative mood, a single subject line, and no trailing period.
- Capitalize the first word.
- Prefer a concise subject, ideally within 50 characters when that still says the real change.
- Avoid file lists, vague filler, and speculative claims.
- Return only the subject by default.
- Do not add a body, trailers, metadata labels, code fences, or explanatory wrapper text unless the user explicitly asks for more than a subject line.
- Prefer subjects that are easy to scan in
git log --oneline:- start with a strong verb
- name the thing that changed
- add scope only when it helps locate the work
- skip filler like
update,improve,changes, orstuff
-
Either propose or commit.
- If the user asked only for a message, return the subject and stop.
- If the user asked to commit and there are staged changes, create the commit with
git commit -m "<subject>". - If the user asked to commit, nothing is staged, and the changes are tracked modifications or deletions only, create the commit with
git commit -am "<subject>". - If the user explicitly asks to amend the last commit, create the commit with
git commit --amend -m "<subject>". - Keep the commit message to one line by default.
- Do not add another
-m, a body, trailers, or any extra message text unless the user explicitly asks for a multi-line commit message. - If untracked files are part of the intended commit, stage them intentionally before committing instead of hiding them behind
-a. - If multiple summaries are plausible or the user explicitly wants a body, show the proposed subject and ask before committing.
-
Keep boundaries clear.
- If the request also includes release notes, a changelog entry, or a PR summary, keep this skill focused on the commit.
Output expectations
- The default output is exactly one commit-subject line
- The subject matches the combined staged and unstaged diff the user is likely asking about
- Commits use a single-line subject by default
- Mixed requests keep commit work separate from release-writing work
Examples
- "Commit my changes."
- "Write a commit message for what I changed."
- "Suggest a one-line commit message for the current diff."
- "What should this commit be called?"
- "Give me a commit subject for the staged and unstaged changes."
- Feature example:
Add auth check to POST /sessions - Bug fix example:
Fix nil panic in session cleanup - Refactor example:
Refactor session store setup - Avoid vague subjects like
Update author wrapped output likeSuggested commit: ...
04 同仓库更多 Skills
sopra-steria-brand
Apply Sopra Steria brand styling to a presentation, document, web page, diagram, or other artifact when the user explicitly wants Sopra Steria branding or refers to Sopra Steria brand rules, colors, typography, logo usage, or corporate visual identity. Do not use for generic design polish or unrelated branding work.
skill-creator
Create, review, and improve skills in this repository for GitHub Copilot CLI and Claude Code. Use when drafting a new skill, revising an existing skill under plugins/my-plugin/skills/, tightening trigger boundaries, or making a skill leaner and more portable.
set-up-workflow
Set up how this repo's issues and tickets are handled. Runs setup-matt-pocock-skills, then records the spec and ticket workflow under "Issue tracker" in AGENTS.md. Use only when the user explicitly asks to set up the workflow.
set-up-my-plugin
Copy the minimalist-engineering principles into the user-level instruction files for Claude Code and Copilot CLI.
set-up-hooks
Set up recommended git hooks in the current repository. Strips Claude and Copilot co-author lines from commit messages, and runs the repo's tests before each commit when it has any. Use only when the user explicitly asks to set up hooks.
set-up-github
Set up a GitHub repository for trunk-based development. Squash-only merges with the PR title as the commit title, head branches deleted on merge, and a pull request required for the default branch. When the repo has CI, also requires named checks to pass and the branch to be up to date before merge. Use only when the user explicitly asks to set up GitHub.