agentleFS
nexus-a1nexus-a1/claude-skills/skills/commit/SKILL.md

commit

Skill1 starsChanged 2 months agoMITView on GitHub

Stage and commit changes with a conventional commit message. Runs pre-commit checks automatically. Optionally prefixes with a ticket number.

  • Reads credentials

193 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use create-branch, review-r and 9 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.
  • SentrySkill

    create-branch

    Create a git branch following Sentry naming conventions. Use when asked to "create a branch", "new branch", "start a branch", "make a branch", "switch to a new branch", or when starting new work on the default branch.

    Also in 4 projects that use this

  • luischanciSkill

    review-r

    Run the R code review protocol on R scripts. Checks code quality, reproducibility, domain correctness, and professional standards. Produces a report without editing files.

    Also in 3 projects that use this

  • 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 3 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 3 projects that use this

  • AWSSkill

    issue

    Implement a GitHub issue end-to-end — branch, code, test, docs, and commit.

    Also in 9 projects that use this

  • luischanciSkill

    validate-bib

    Validate bibliography entries against citations in all manuscript files. Find missing entries and unused references.

    Also in 3 projects that use this

  • +2 more from luischanci

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 4 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 174 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 3

    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. Very specific:

    Run everything inline — no agent delegation.

    line 21
  2. Very specific:

    From argument: If provided, validate against [A-Z]+-[0-9]+.

    line 27
  3. Distinctive:

    None: Only if the branch has no ticket pattern.

    line 33
  4. Distinctive:

    If on main or master, create a feature branch before committing:

    line 39
  5. Distinctive:

    Use compact flags — never plain git status / git diff:

    line 55
  6. Very specific:

    Commit hash (from git log -1 --format='%h')

    line 109
  7. Distinctive:

    Commit message subject line

    line 110

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

Context

Recent commits for reference: !git log --oneline -5 2>/dev/null || echo "No previous commits (this will be the first commit)"

Current branch: !git branch --show-current 2>/dev/null || echo "(not in a git repository)"

Your Task

Run everything inline — no agent delegation. The git-mutation-guard.sh PreToolUse hook runs the credential scan on staged files automatically at commit time; you do not need to scan separately.

1. Determine Ticket Number

Priority order (argument: $ARGUMENTS):

  1. From argument: If provided, validate against [A-Z]+-[0-9]+.
  2. From branch name: Extract with:
    branch=$(git branch --show-current)
    ticket=$(echo "$branch" | grep -oE '[A-Z]+-[0-9]+' | head -1)
  3. None: Only if the branch has no ticket pattern.

The ticket MUST appear in the commit message as [TICKET-123] (brackets, original casing).

2. Check Branch Safety

If on main or master, create a feature branch before committing:

git checkout -b feature/[ticket]-description

3. Run PHP CS Fixer (if available)

test -f ./vendor/bin/php-cs-fixer && ./vendor/bin/php-cs-fixer fix --dry-run --diff <modified-php-files>

Skip silently if not available or no PHP files modified.

4. Review Changes and Stage

Use compact flags — never plain git status / git diff:

git status --short
git diff --stat HEAD

Identify files to stage, excluding .env*, credentials.*, *.pem, *.key. For files whose content you need to understand for the commit message, fetch the full patch per-file:

git diff HEAD -- <file>

Stage explicitly:

git add <file1> <file2> ...

5. Author Commit Message

Format:

[TICKET-123] type(scope): short description

Optional body wrapped at 72 chars explaining the WHY.

Types: feat | fix | refactor | test | docs | chore | style | perf

Rules:

  • Imperative mood, subject line ≤ 50 chars
  • NO Co-Authored-By, NO Generated with Claude Code, NO AI attribution
  • One logical change per commit — if tempted to use "and", split it

6. Commit

git commit -m "$(cat <<'EOF'
[TICKET-123] type(scope): short description

Optional body.
EOF
)"

If the hook blocks the commit due to a credential-scan finding: surface the finding to the user verbatim (file:line — label, never the secret value). Ask whether it is a true leak or false positive. On confirmed false positive, re-run with CREDENTIAL_SCAN_BYPASS=1 git commit … and include the reason in the commit body so the override is traceable. Never override silently.

That prefix skips this scan only. Branch protection and the security-auditor state check still apply, and the skip is announced on stderr. It also applies per repository and fail-closed: if any other commit in the same command targets the same repository without the prefix, the scan runs anyway.

7. Report Results

Show:

  • Commit hash (from git log -1 --format='%h')
  • Commit message subject line
  • File count (from git show --stat HEAD)

Important Notes

  • Single message execution — complete all steps in one response.
  • Branch safety — never commit directly to main/master.
  • Clean messages — no AI attribution or footers.
  • Do NOT push — user will push manually (the push hook requires a security-auditor confirmation).

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.