Learn-skills.dev git-commit
Stages files, analyzes the diff, and commits with a conventional commit message. Use this skill whenever the user wants to commit, says things like "commit this", "make a commit" or "ship it".
install
source · Clone the upstream repo
git clone https://github.com/NeverSight/learn-skills.dev
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/NeverSight/learn-skills.dev "$T" && mkdir -p ~/.claude/skills && cp -r "$T/data/skills-md/aayushbtw/skills/git-commit" ~/.claude/skills/neversight-learn-skills-dev-git-commit && rm -rf "$T"
manifest:
data/skills-md/aayushbtw/skills/git-commit/SKILL.mdsource content
Git Commit
Workflow
IMPORTANT: Follow these steps in order. Do not skip or reorder unless a step explicitly says to.
-
Check what is staged and what isn't:
git status --short- If nothing to commit at all, stop and tell the user.
- If nothing is staged → run
to stage everything.git add -A
-
Read the staged diff and analyze per the Splitting commits rules:
git diff --cached- If there is one group → proceed to step 3.
- If there are multiple groups → tell the user how many commits will be made, then unstage everything and stage only the first group's files:
git reset HEAD git add <file1> <file2> ...
-
Generate a commit message per the Commit message rules and commit:
git commit -m "<generated message>"If unstaged changes remain, repeat from step 1.
Guidelines
Commit message
- Format:
where type is one of:<type>(<scope>): <description>
: A new capability or behavior the project didn't have beforefeat
: Correcting broken or incorrect behaviorfix
: Changes to documentation onlydocs
: Restructuring code without changing behaviorrefactor
: Performance improvementsperf
: Routine upkeep (e.g. versions, lockfiles, renaming, linting, formatting)chore
: Adding or updating teststest
: Changes to CI/CD pipelines or workflow filesci
: Undoing a previous commitrevert
- Scope: ALWAYS include in parentheses (e.g.
)feat(auth): - Description: Present tense imperative, no period, ≤50 chars
- Breaking changes: Add
after type/scope (e.g.!
)feat!(scope): - No generic messages: Never use "update code", "fix bug", "changes"
- No attribution: Never add
trailers or footersCo-Authored-By - Examples:
- feat(auth): add OAuth2 login flow
- fix(api): handle null response from payment gateway
- docs(readme): add setup instructions
- refactor(db): extract query builder into separate module
- chore(deps): bump express to v5
- chore(lint): apply prettier formatting
- perf(search): add index on users.email column
- test(auth): add unit tests for token refresh
- ci(deploy): add staging environment workflow
- feat!(api): change response format to JSON:API
Splitting commits
- Atomic commits: Each commit must contain only related changes that serve a single purpose
- Split large changes: If changes touch different concerns, different types (feat vs fix vs refactor), different file categories (source vs docs), or are large enough that breaking them down aids review
Git safety
- No bypassing hooks: Never use
or--no-verify--force - No config changes: Never modify git config
- Sensitive files: Never stage
, credentials, or private keys.env - Pre-commit failures: Stop and report the error — do not attempt to fix or bypass it
- Empty staging: If nothing is staged after
, stop and tell the usergit add