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

commit

Skill1 starsChanged 27 days agoMITView on GitHub

Stage and commit changes with a conventional commit message. Runs pre-commit checks automatically. Prefixes the ticket number when there is one, asks once when there is not, and commits without it if none is given.

  • Reads credentials

188 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use validate-plan, act-on-feedback 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.
  • shawn-dumasSkill

    validate-plan

    Validate an orchestration plan after pre-flight certification. Runs adversarial review, deep review (verify prompt data against codebase), and PoC gate for risky approaches. Auto-invoked by orchestrate-* skills at Step 8.

    Also in 5 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

  • 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

  • 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

  • mitsuhikoSkill

    oebb-scotty

    Austrian rail travel planner (ÖBB Scotty). Use when planning train journeys in Austria, checking departures/arrivals at stations, or looking for service disruptions. Covers ÖBB trains, S-Bahn, regional trains, and connections to neighboring countries.

    Also in 3 projects that use this

  • mitsuhikoSkill

    pi-share

    Load and parse session transcripts from shittycodingagent.ai/buildwithpi.ai/buildwithpi.com/pi.dev (pi-share) URLs. Fetches gists, decodes embedded session data, and extracts conversation history.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 168 edited versions we read keep these.

  • 3

    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
  • 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 the whole argument against ^[A-Za-z]+-[0-9]+$ and uppercase it.

    line 27
  3. Very specific:

    Ask once: if neither gives one, ask the user for a ticket with AskUserQuestion — a ticket is good to have.

    line 33
  4. Distinctive:

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

    line 43
  5. Distinctive:

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

    line 61
  6. Very specific:

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

    line 117
  7. Distinctive:

    Commit message subject line

    line 118

“Common” is measured: kept by at least 6 in 10 of the 168 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 the whole argument against ^[A-Za-z]+-[0-9]+$ and uppercase it.
  2. From branch name: Extract with:
    branch=$(git branch --show-current)
    ticket=$(echo "$branch" | grep -oE '[A-Z]+-[0-9]+' | head -1)
  3. Ask once: if neither gives one, ask the user for a ticket with AskUserQuestion — a ticket is good to have. Offer "No ticket" as an option. A typed answer must match ^[A-Za-z]+-[0-9]+$ as a whole (stored uppercase); treat anything else as "No ticket". If the user declines, or AskUserQuestion is not available (an unattended run), continue without one. Ask at most once per run.

With a ticket, it appears in the commit message as [TICKET-123] (brackets, uppercase). Without one, drop the bracket part — never invent a ticket or write a placeholder.

2. Check Branch Safety

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

git checkout -b feature/[ticket]-description

With no ticket, use feature/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.

With no ticket the subject is just type(scope): short description.

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.