agentleFS
SvampenSvampen/claude-skills/skills/git-commit/SKILL.md

git-commit

Skill0 starsChanged 9 months agoMITView on GitHub

Creates git commits using Conventional Commits format. Use when committing changes to ensure consistent, meaningful commit messages.

174 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use git-pr, github-pr-create and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • klauswgSkill

    git-pr

    Prepare, review, publish, or update a complete GitHub pull request for the current repository, including local commit readiness, safe push strategy, semantic title validation, repository-native PR templates, issue linking, and checks verification. Use when the user asks to draft, create, submit, publish, open, or update a pull request. Always require the user to review and explicitly approve the exact final PR before any push or GitHub write.

    Also in 11 projects that use this

  • mjun0812Skill

    github-pr-create

    Pull Requestを作成するSkill。現在のbranchからpull requestを作成する。言語指定可能。 ユーザーが「PR作って」「pull request作成して」のように依頼したら使うこと。

    Also in 3 projects that use this

  • MicrosoftSkill

    git-branch

    Branch management for implementation. Use when you need to create a branch, switch branches, checkout, or verify branching strategy before implementing code. Do not use for commits (use git-commit), pull requests (use pull-request), or advanced git operations (rebase, merge).

    Also in 4 projects that use this

  • klauswgSkill

    git-issue

    Prepare, review, create, or update evidence-based GitHub issues for the current repository with duplicate detection, repository-native templates, valid labels, and post-publication verification. Use when the user asks to draft, file, submit, publish, edit, or refine a GitHub issue, bug report, feature request, performance issue, or technical proposal. Always require the user to review and explicitly approve the exact final issue before any GitHub write.

    Also in 3 projects that use this

  • gologo13Skill

    git-push

    Push current branch to origin and sync with remote updates; keywords: git, rebase. Use only on explicit request; before execution, review diffs and list impact scope.

    Also in 6 projects that use this

  • GoogleSkill

    github-pr-review

    Review a GitHub pull request and leave inline comments in a natural human reviewing voice, indistinguishable from comments typed by hand on the GitHub web UI. Deliberately bounded to defects a reader can settle by looking at the anchored line, rather than a deep audit, so every comment is cheap for the author to check. Scales to 2-20 comments by PR size, parallelises analysis across sub-agents, drafts for approval, then posts individually with human pacing. Use when the user says "review this PR", "review PR 123", pastes a github.com/.../pull/N link, or asks for comments on a pull request. Don't use for reviewing local uncommitted changes or a diff against a branch (use the `review` skill for that).

    Also in 4 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

20 rules. 0 are common, 16 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 134 edited versions we read keep these.

  • 16

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read .claude/project-config.md if it exists and look for the ## Co-Author section.

    line 73
  2. Distinctive:

    Keep the resolved co-author value (or absence) for use in Step 7.

    line 83
  3. Distinctive:

    Stage specific files: - Ask which files

    line 122
  4. Very specific:

    Only .md files -> docs

    line 132
  5. Very specific:

    Only formatting changes -> style

    line 133
  6. Very specific:

    Test files only -> test

    line 135
  7. Distinctive:

    Use AskUserQuestion to confirm:

    line 137
  8. Distinctive:

    Change scope: - Ask for scope

    line 149
  9. Distinctive:

    Change both: - Ask for type and scope

    line 150
  10. Distinctive:

    Create a concise description (imperative mood, no period).

    line 154
  11. Distinctive:

    Start with lowercase (unless proper noun)

    line 168
  12. Distinctive:

    No period at end

    line 169
  13. Distinctive:

    If over 80, shorten the description — move detail to the body

    line 171
  14. Distinctive:

    If body needed, write 1-3 sentences explaining:

    line 185
  15. Distinctive:

    Do NOT describe HOW the code works — that belongs in the code itself.

    line 192
  16. Distinctive:

    Before committing, verify the first line is ≤ 80 characters: If over 80, shorten the description and move detail to the body.

    line 196
  17. Distinctive:

    Use HEREDOC syntax for multi-line commit messages

    line 334
  18. Distinctive:

    Verify commit succeeded before reporting success

    line 335
  19. Distinctive:

    Don't amend commits unless explicitly asked

    line 336
  20. Distinctive:

    Don't push unless explicitly asked (separate concern)

    line 337

“Common” is measured: kept by at least 6 in 10 of the 134 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Git Commit Skill

Creates git commits following the Conventional Commits specification. This ensures consistent, meaningful commit messages across the project.

When to Use

Activate this skill when:

  • User asks to commit changes
  • User says "commit", "create commit", or "git commit"
  • Changes are staged or ready to be committed
  • At the end of a session when committing work

This skill replaces the default commit workflow.

Conventional Commits Format

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Types

TypeDescriptionExample
featNew feature or functionalityfeat: add user authentication
fixBug fixfix: resolve login redirect issue
docsDocumentation onlydocs: update README
styleCode style (formatting, semicolons)style: fix indentation
refactorCode change that neither fixes nor addsrefactor: extract validation logic
perfPerformance improvementperf: optimize database queries
testAdding or fixing teststest: add user service tests
buildBuild system or dependenciesbuild: update webpack config
ciCI configurationci: add GitHub Actions workflow
choreOther changes (tooling, etc.)chore: update .gitignore

Scope (Optional)

Scope indicates the module or directory affected. Use the most specific relevant name:

  • feat(auth): add OAuth support
  • fix(session-start): correct template path
  • refactor(skills): extract shared config parsing

For changes spanning multiple modules, use the parent directory or omit scope:

  • refactor(skills): standardize config loading (multiple skills changed)
  • chore: update dependencies (project-wide)

Breaking Changes

For breaking changes, add an exclamation mark after type/scope:

feat!: change API response format
refactor(auth)!: rename login endpoint

Or add a BREAKING CHANGE line in the footer.

Instructions

Step 0: Read Project Config

Read .claude/project-config.md if it exists and look for the ## Co-Author section.

Parse the co-author setting:

Config valueBehavior
auto or section missingAgent self-identifies: use your own name and an appropriate no-reply email (e.g., Claude <noreply@anthropic.com>, GitHub Copilot <noreply@github.com>)
noneDo not add a Co-Authored-By trailer
Name <email>Use the provided value verbatim

Keep the resolved co-author value (or absence) for use in Step 7.

Step 1: Check Repository Status

Run:

git status

If no changes:

  • Display: "No changes to commit."
  • Stop skill execution

If untracked files or modifications exist:

  • Continue to next step

Step 2: Review Changes

Run in parallel:

git diff --staged
git diff
git log --oneline -5

Analyze:

  • What files are changed/added
  • Nature of changes (new feature, bug fix, refactor, etc.)
  • Recent commit style for consistency

Step 3: Stage Changes (if needed)

If changes not staged:

  • Use AskUserQuestion:
    Found unstaged changes. What should I stage?
    Options:
    1. Stage all changes - git add -A
    2. Stage specific files - Ask which files
    3. Only commit staged - Proceed with currently staged only

Step 4: Determine Commit Type

Based on the changes, suggest a commit type:

Auto-detection hints:

  • New files with significant code -> feat
  • Modified existing behavior -> Could be fix, refactor, or feat
  • Only .md files -> docs
  • Only formatting changes -> style
  • Dependency changes -> build
  • Test files only -> test

Use AskUserQuestion to confirm:

Based on the changes, I suggest:
  Type: [suggested-type]
  Scope: [suggested-scope or "none"]

Is this correct?

Options:

  1. Yes, use suggested - Proceed with suggestion
  2. Change type - Show type options
  3. Change scope - Ask for scope
  4. Change both - Ask for type and scope

Step 5: Generate Description

Create a concise description (imperative mood, no period).

Always use imperative mood — write it as a command: "add", "fix", "extract", not "added", "fixes", "extracting".

Describe WHAT changed and WHY — never HOW. The code shows how.

  • Good: "delegate commit responsibility to git-commit skill" (what + why, imperative)
  • Good: "add optional implementation review step" (what, imperative)
  • Bad: "refactor the validation logic into a new helper function" (how)
  • Bad: "Added authentication." (past tense, period)
  • Bad: "adds auth" (present tense, too vague)
  • Bad: "extracting validation logic" (gerund, not imperative)

Rules:

  • Start with lowercase (unless proper noun)
  • No period at end
  • The full first line (type: description or type(scope): description) MUST be ≤ 80 characters
  • If over 80, shorten the description — move detail to the body

Step 6: Determine if Body Needed

Add body if:

  • Changes are complex and need explanation
  • Multiple related changes in one commit
  • Breaking change needs context
  • "Why" isn't obvious from description

Skip body if:

  • Simple, self-explanatory change
  • Single-purpose commit

If body needed, write 1-3 sentences explaining:

  • Why this change was made
  • What problem it solves
  • Any important context

Use imperative mood in the body too — consistent with the description.

Do NOT describe HOW the code works — that belongs in the code itself.

Step 7: Validate and Execute Commit

Before committing, verify the first line is ≤ 80 characters. If over 80, shorten the description and move detail to the body.

Build the commit message using the co-author setting resolved in Step 0:

If co-author is enabled (auto or custom value):

git commit -m "$(cat <<'EOF'
<type>[scope]: <description>

[body if needed]

Co-Authored-By: <resolved co-author>
EOF
)"

If co-author is none:

git commit -m "$(cat <<'EOF'
<type>[scope]: <description>

[body if needed]
EOF
)"

Step 8: Verify Commit

Run:

git log -1 --format=full
git status

Display:

Commit created successfully!

[commit-hash] <type>[scope]: <description>

Files changed: [N]
Insertions: [+N]
Deletions: [-N]

Examples

Example 1: Simple Feature

Changes: New authentication middleware added

feat(auth): add authentication middleware

Implement JWT-based authentication for API endpoints.

Co-Authored-By: <agent-name> <agent-email>

Example 2: Bug Fix

Changes: Fixed login redirect issue

fix(auth): correct login redirect URL

Co-Authored-By: <agent-name> <agent-email>

Example 3: Documentation

Changes: Updated README

docs: update installation instructions

Co-Authored-By: <agent-name> <agent-email>

Example 4: Refactor with Scope

Changes: Moved validation logic to separate module

refactor(utils): extract validation to separate module

Improve code organization by separating validation logic.
No functional changes.

Co-Authored-By: <agent-name> <agent-email>

Example 5: Breaking Change

Changes: Renamed public API endpoint

feat(api)!: rename /users endpoint to /accounts

BREAKING CHANGE: /users endpoint removed. Use /accounts instead.
Migration: Update all API calls from /users to /accounts.

Co-Authored-By: <agent-name> <agent-email>

Example 6: Chore

Changes: Updated dependencies

chore(deps): update dependencies to latest versions

Co-Authored-By: <agent-name> <agent-email>

Type Selection Guide

Is it a new capability the user can use? -> feat Does it fix broken behavior? -> fix Is it restructuring without behavior change? -> refactor Is it only documentation/comments? -> docs Is it only whitespace/formatting? -> style Does it make things faster? -> perf Is it test code? -> test Is it dependencies or build config? -> build Is it CI/CD pipeline? -> ci None of the above? -> chore


Notes

  • Co-Authored-By trailer is controlled by project-config.md (auto by default, can be none or a custom value)
  • In auto mode, identify yourself — use your agent name and a suitable no-reply email
  • Use HEREDOC syntax for multi-line commit messages
  • Verify commit succeeded before reporting success
  • Don't amend commits unless explicitly asked
  • Don't push unless explicitly asked (separate concern)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.