agentleFS
andreilupuandreilupu/my-claude-skills/skills/commit/SKILL.md

commit

Skill1 starsChanged 9 months agoMITView on GitHub

Use when preparing and creating a git commit — analyzes staged changes, runs linters, and composes a clear commit message

  • Reads credentials
  • Commits and pushes

186 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use act-on-feedback, generate-run-commands 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.
  • MicrosoftSkill

    act-on-feedback

    Act on user feedback attached to the current session. Use when the user submits feedback on the session's changes via the Submit Feedback button.

    Also in 4 projects that use this

  • MicrosoftSkill

    generate-run-commands

    Generate or modify run commands for the current session. Use when the user wants to set up or update run commands that appear in the session's Run button.

    Also in 4 projects that use this

  • MindgamesSkill

    branch

    Use when a user asks to create a new local git branch and start issue work (for example, "create branch" or "start working on issue XYZ"). Use this for issue-based branch naming in the `type/scope-short-description` pattern and for always syncing local `main` from `origin/main` before creating the new branch, creating the local tracking `main` branch first when needed.

    Also in 9 projects that use this

  • decocmsSkill

    add-mcp-tools

    Guide for adding new MCP tools with consistent patterns for schemas, tool definitions, registry updates, and Better Auth integration

    Also in 3 projects that use this

  • thoughtbotSkill

    implement-with-tdd

    Implement a SPEC, plan, or feature outside-in, with TDD.

    Also in 3 projects that use this

  • thoughtbotSkill

    multi-lens-review

    Review a change for defects, then against its spec, its codebase's conventions, the domains trying to emerge from it, and whatever still depends on what it replaced.

    Also in 3 projects that use this

  • +1 more from thoughtbot

The file

Show its rules and text

We split this skill into the rules it gives an agent

18 rules. 0 are common, 17 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 165 edited versions we read keep these.

  • 17

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Run these commands to understand the current state:

    line 12
  2. Distinctive:

    Ensure the staged changes are:

    line 22
  3. Distinctive:

    Complete: All necessary files are staged

    line 24
  4. Distinctive:

    Clean: No debug code, console.logs, or commented-out code

    line 25
  5. Distinctive:

    If changes appear unrelated or too large, suggest splitting into multiple commits.

    line 28
  6. Distinctive:

    Check what types of files are staged:

    line 32
  7. Distinctive:

    Look for linter configurations in the project:

    line 40
  8. Distinctive:

    Run appropriate linters based on what's configured.

    line 46
  9. Distinctive:

    STOP: - Do not proceed with the commit

    line 47
  10. Distinctive:

    Offer to auto-fix: if available

    line 49
  11. Distinctive:

    Only proceed: when all linters pass

    line 51
  12. Very specific:

    If the user explicitly requests to skip linting (e.g., --no-lint), warn them that this is not recommended and proceed only with their …

    line 55
  13. Distinctive:

    Use imperative mood ("Fix bug" not "Fixed bug")

    line 73
  14. Distinctive:

    No period at the end

    line 76
  15. Distinctive:

    If the user provided a message via $ARGUMENTS, use it as the basis for the commit message.

    line 118
  16. Distinctive:

    Never amend commits without explicit user request

    line 146
  17. Distinctive:

    Never commit sensitive data (.env files, API keys, credentials)

    line 148
  18. Distinctive:

    If pre-commit hooks fail, help fix the issues and create a NEW commit

    line 149

“Common” is measured: kept by at least 6 in 10 of the 165 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

Commit Preparation

Prepare and create a well-structured commit.

Step 1: Analyze Current State

Run these commands to understand the current state:

git status
git diff --staged
git branch --show-current

Step 2: Review Staged Changes

Ensure the staged changes are:

  • Focused: Related to a single logical change
  • Complete: All necessary files are staged
  • Clean: No debug code, console.logs, or commented-out code
  • Appropriate: Match the branch's purpose

If changes appear unrelated or too large, suggest splitting into multiple commits.

Step 3: Run Linters (If Available)

Check what types of files are staged:

git diff --staged --name-only

Detect Project Linters

Look for linter configurations in the project:

  • package.json → check for lint scripts
  • composer.json → check for phpcs or similar
  • .eslintrc*, biome.json, .prettierrc → JS/TS linting
  • phpcs.xml* → PHP linting

Run appropriate linters based on what's configured. If linters fail:

  1. STOP - Do not proceed with the commit
  2. Show the errors to the user clearly
  3. Offer to auto-fix if available
  4. After fixes, re-run linters to verify
  5. Only proceed when all linters pass

Skip Linting (Emergency Only)

If the user explicitly requests to skip linting (e.g., --no-lint), warn them that this is not recommended and proceed only with their confirmation.

Step 4: Compose Commit Message

Format

{Clear, revealing subject line} (max 72 chars)

{Optional body explaining what and why, wrapped at 72 chars}

Co-Authored-By: Claude <noreply@anthropic.com>

Guidelines

  1. Subject line (most important):
    • Be clear and revealing - the reader should understand the change without reading the diff
    • Use imperative mood ("Fix bug" not "Fixed bug")
    • Keep under 72 characters
    • Capitalize first letter
    • No period at the end
    • Focus on what the change accomplishes, not how
  2. Body (optional but recommended for complex changes):
    • Explain what changed and why
    • Wrap at 72 characters
    • Separate from subject with blank line

Good vs Bad Subject Lines

Bad (vague)Good (revealing)
Fix bugFix datepicker dropdown spacing regression
Update stylesRemove gap between datepicker trigger and popup
Changes to reportsAdd min-height to report container
Refactor codeExtract date range logic into useDateRange composable
WIPAdd product performance metrics to dashboard

Examples

Bug fix:

Fix datepicker dropdown spacing regression

Remove the 6px margin-top gap between the datepicker trigger and popup,
add min-height to container to ensure datepicker fits.

Co-Authored-By: Claude <noreply@anthropic.com>

Feature addition:

Add product performance report to dashboard

Introduces a new report showing product-level metrics including
revenue, quantity sold, and conversion rates.

Co-Authored-By: Claude <noreply@anthropic.com>

Step 5: Create the Commit

If the user provided a message via $ARGUMENTS, use it as the basis for the commit message.

Otherwise, compose an appropriate message based on:

  1. The staged changes (to describe what changed)
  2. The branch name (for context)
  3. Recent commit history (to match style)

Create the commit:

git commit -m "$(cat <<'EOF'
{Clear, revealing subject}

{Body if needed}

Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)"

Step 6: Post-Commit

After committing:

  1. Show the commit with git show --stat HEAD
  2. Remind user to push when ready: git push -u origin {branch}

Important Notes

  • Never amend commits without explicit user request
  • Never force push
  • Never commit sensitive data (.env files, API keys, credentials)
  • If pre-commit hooks fail, help fix the issues and create a NEW commit

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.