agentleFS
nainishshafinainishshafi/developer-productivity-skills/.github/skills/git-committer/SKILL.md

git-committer

Skill1 starsChanged 5 days agoMITView on GitHub

Creates conventional Git commits, handles pre-commit outcomes, and assists with safe branching, rebasing, recovery, and PR workflows. Use when asked to git commit, commit changes, push to github, create branch, rebase, merge, stash, cherry-pick, resolve merge conflict, check git history, create pull request, or update the git-committer skill.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    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
  1. Distinctive:

    Verify Identity: Check the effective identity without changing Git configuration.

    line 11
  2. Very specific:

    Conventional Commits: Use feat:, fix:, refactor:, docs:, test:, or chore: prefixes.

    line 12
  3. Distinctive:

    Keep Hooks Enabled: Do not bypass hooks or signing to get past a failure or timeout.

    line 15
  4. Distinctive:

    Use git --no-optional-locks status --short for status checks so inspection does not refresh the index on disk.

    line 20
  5. Distinctive:

    Verify the effective identity with git var GIT_AUTHOR_IDENT and note the current commit before attempting a commit.

    line 31
  6. Very specific:

    Keep the hook's Python in the repository venv.

    line 40
  7. Distinctive:

    Use a shell-appropriate multi-line commit message pattern.

    line 43
  8. Very specific:

    Avoid Bash heredoc patterns like $(cat <<'EOF' ...) in PowerShell sessions because they fail to parse.

    line 64
  9. Distinctive:

    If no commit was created, distinguish a blocking finding from a hook or scanner failure.

    line 71
  10. Distinctive:

    If error output is unavailable, isolate the hook and scanner components before another commit attempt.

    line 72

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “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 Committer

Core Directives

  1. Verify Identity: Check the effective identity without changing Git configuration. Report missing or unexpected identity before committing.
  2. Conventional Commits: Use feat:, fix:, refactor:, docs:, test:, or chore: prefixes.
  3. Atomic Commits: Stage related changes together; avoid giant "everything" commits.
  4. Summary and Body: Include a concise summary line and a bulleted body for complex changes.
  5. Keep Hooks Enabled: Do not bypass hooks or signing to get past a failure or timeout.

Workflow

0. Check for a Recycle Bin report

Use git --no-optional-locks status --short for status checks so inspection does not refresh the index on disk.

If a Recycle Bin report names Git metadata, pause writes and let any running Git command finish. Verify live HEAD, staged changes, and working-tree status against the expected state. Resolve the live index with git rev-parse --path-format=absolute --git-path index; the index must exist and its sibling <index>.lock must be absent. If the intended commit exists, report it without retrying. A report alone establishes neither corruption nor the cause of a failed command.

Stop writes if live metadata is missing, a lock remains, checks fail or show unexpected changes, or the tool prohibits further writes. Otherwise, continue within the user's authorization after diagnosing any failed command and fixing its confirmed cause. Never access or restore recycled items, delete Git metadata, or switch tools to bypass a restriction.

1. Check Staged Files

Review status, staged and unstaged diffs, and recent commit messages. Stage only the intended paths, verify the staged diff, and leave unrelated edits and generated files alone. The hook checks selected staged paths, not all pending edits or repository history. When asked to commit everything, verify the complete pending scope before scanning; do not report repository-wide coverage from a staged scan.

2. Check Identity and Record HEAD

Verify the effective identity with git var GIT_AUTHOR_IDENT and note the current commit before attempting a commit. An unborn branch has no current commit.

3. Check the Pre-Commit Hook

From the repository root, resolve the active hook with git rev-parse --path-format=absolute --git-path hooks/pre-commit. Check the resolved file, not pre-commit.sample or a tracked installer.

When the repository provides a security hook installer and the active hook is absent, run scripts/install-hook.py from that skill directory using the repository's Python environment with the working directory set to the repository root. Install automatically only if the installer can write to the resolved active path; the bundled installer targets .git/hooks/pre-commit. Recheck the active hook after installation.

Verify that the active hook invokes the expected scanner, directly or through a hook manager. If an existing hook cannot be verified or installation fails or is unsupported, pause before git commit and offer to run the scanner directly on the final staged changes. Do not modify existing hooks without approval or commit if the direct scan fails or reports blocking findings.

Keep the hook's Python in the repository venv. The scanner locates detect-secrets and Semgrep in the shared agent venv first; check that environment before installing duplicate tools in the repository venv.

4. Stage and Commit

Use a shell-appropriate multi-line commit message pattern.

git add <paths>
git commit -m "<type>(<scope>): <subject>

- <body>"

On Windows PowerShell, prefer a here-string for multi-line commit messages:

git add <paths>
$msg = @'
<type>(<scope>): <subject>

- <body>
'@
git commit -m $msg

Avoid Bash heredoc patterns like $(cat <<'EOF' ...) in PowerShell sessions because they fail to parse.

5. Verify the Outcome

Check git log -1 and git status --short after the attempt. If the command times out, is interrupted, or returns an ambiguous error, verify HEAD and the index before retrying. Do not start a second commit while the first is still running. If the intended commit exists, report its hash and any remaining changes.

Report whether the commit output confirmed a hook scan or a direct staged scan ran. Do not infer that the hook ran from commit success alone.

If no commit was created, distinguish a blocking finding from a hook or scanner failure. Fix the reported cause before retrying. When the hook reports built-in fallback after a Semgrep timeout, report the fallback result, not a Semgrep pass. See the reference for recovery details. If error output is unavailable, isolate the hook and scanner components before another commit attempt. Report a direct component result only for that component; a detect-secrets pass does not establish Semgrep or full-hook completion.

Resources

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.