agentsclimarketplace

Commit

Skill nexus-a1/claude-skills/skills/commit

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

Install
npx -y skills add nexus-a1/claude-skills --skill commit

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

3.6 KB, as published. Nobody here has run it

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 GIT_AUTHORIZED=1 git commit … and include the reason in the commit body so the override is traceable. Never override silently.

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).

Keep looking

Skills are one crate of 627,801. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.