agentleFS
cirnecirne/agent-skills/skills/commit/SKILL.md

commit

Skill3 starsChanged 5 months agoMITView on GitHub

Guides pre-commit self-review, optional deslop, scoped lint/typecheck/tests, commit, land, and sync with origin until the working tree is clean and the branch matches its remote. Use when the user invokes /commit, asks to commit, land on main, push, or finish a change with git.

  • Deletes or force-pushes
  • 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

14 rules. 0 are common, 11 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 165 edited versions we read keep these.

  • 11

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

    Before running gates, learn this repo’s rules (do not invent):

    line 20
  2. Distinctive:

    Default branch name (main / master)

    line 22
  3. Distinctive:

    When the change affects behavior, APIs, ops, skills, or tracked process — or when the diff itself is docs — bring related docs along.

    line 58
  4. Distinctive:

    Use the smallest commands that cover the diff (project scripts).

    line 69
  5. Very specific:

    If a commit.local overlay defines extra judgment gates (docs freshness, i18n, etc.), run those here too.

    line 75
  6. Distinctive:

    All must exit 0 (or explicit accept for judgment warnings) before commit.

    line 77
  7. Distinctive:

    No secrets or generated junk

    line 82
  8. Distinctive:

    After commit, continue to land (if needed) and §6 Sync — local-only commit is not finished work

    line 83
  9. Very specific:

    If the project uses feature worktrees and lands locally (see /worktree):

    line 87
  10. Very specific:

    Remove the worktree with git worktree remove (not rm -rf)

    line 90
  11. Distinctive:

    If the project requires PRs: push the feature branch (§6), open/update the PR if that is the repo’s handoff, and treat done as clean …

    line 93
  12. Distinctive:

    Run full CI / full suite only if the project overlay expects it before push — skip for docs-only / comment-only / skill-markdown changes …

    line 106
  13. Distinctive:

    Never force-push the default branch without an explicit ask.

    line 111
  14. Distinctive:

    If push is blocked (permissions, hooks, network), report the blocker and leave status honest — do not claim done.

    line 113

“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 workflow

Done means: working tree clean and the current branch in sync with its remote (not ahead, not behind). Do not stop after a local-only commit while git status still shows ahead/behind.

Default path: pre-commit gates → commit → land on local default branch when using feature worktrees → push / sync to origin → verify clean + synced.

Prioritize correctness, security, and regressions over style-only nits unless the user asked for polish.

Discover repo conventions

Before running gates, learn this repo’s rules (do not invent):

  1. Default branch name (main / master)
  2. Agent conventions (AGENTS.md, CLAUDE.md, contributing docs)
  3. Lint / typecheck / test scripts (package.json, Makefile, etc.)
  4. Whether the workflow is solo land-on-main vs PR-required
  5. Optional focus/WIP file (e.g. focus.md) — only touch if the project uses it (docs/README.md / AGENTS.md)
  6. Project overlay — if either path exists, read it and apply after this skill (do not invent repo gates):
    • .cursor/skills/commit.local/SKILL.md (preferred)
    • .agents/skills/commit.local/SKILL.md Overlay owns repo-specific gate matrix, paths, and defaults. Shared /commit still owns the overall process (review → gates → commit → land → sync). Overlay wins on conflicts for gates/defaults only. Keep overlays thin (~one screen); push general prose back into this skill.

1. Self-review

git fetch origin <default-branch>
git diff origin/<default-branch>...HEAD
git status

Tier findings:

  • Critical — fix before commit: bugs, secrets, auth/isolation, wrong behavior
  • Warning — fix or accept explicitly: missing regression test, risky migration, weak errors
  • Note — nits; non-blocking unless polish was requested

Large diffs (>15 files or >500 lines): slice review by directory or parallel subagents.

2. Test expectations

  • New/changed behavior → add or update tests
  • Bug fixes → regression test (fail without fix)
  • Docs/comment-only → skip tests unless documenting untested behavior

Optional: /deslop on agent-heavy branches before gates.

2b. Docs hygiene (before commit)

When the change affects behavior, APIs, ops, skills, or tracked process — or when the diff itself is docs — bring related docs along. Do not leave the tree with stale or forked guidance.

  1. Up to date — Update the docs that describe what you changed (README, architecture, runbooks, skill text, focus/WIP if the project uses it). If behavior moved, the prose moves in the same commit (or an immediate follow-up in the same /commit before sync).
  2. Single source of truth — Prefer one canonical doc (or skill) and link elsewhere. Do not copy procedure into a second file “for convenience.” If two places already disagree, fix the canonical and delete or shrink the duplicate to a pointer.
  3. Internally consistent — Touched docs must not contradict each other or the code (commands, paths, defaults, “required vs optional” steps). After edits, skim cross-links you changed for drift.
  4. Repo map — If docs/README.md (or equivalent) defines where docs live, follow it; overlays may name extra required files (e.g. focus.md).

Docs-only commits still go through this check — freshness and consistency matter even when CI is skipped.

3. Pre-commit gate

Use the smallest commands that cover the diff (project scripts). Typical order:

  1. Lint on changed paths
  2. Typecheck appropriate to touched packages
  3. Scoped tests via /tests (log full output; never pipe)

If a commit.local overlay defines extra judgment gates (docs freshness, i18n, etc.), run those here too.

All must exit 0 (or explicit accept for judgment warnings) before commit. Full suite is post-commit / land / push — not every iteration.

4. Commit

  1. Conventional Commits (feat:, fix:, …) unless the repo uses another style
  2. No secrets or generated junk
  3. After commit, continue to land (if needed) and §6 Sync — local-only commit is not finished work

5. Land (solo / worktree workflows)

If the project uses feature worktrees and lands locally (see /worktree):

  • From the primary clone: merge feature branch into local default branch
  • Remove the worktree with git worktree remove (not rm -rf)
  • Then §6 Sync the default branch (or the branch the overlay says to publish)

If the project requires PRs: push the feature branch (§6), open/update the PR if that is the repo’s handoff, and treat done as clean working tree + feature branch synced with its remote (PR merge is separate unless the user asked to merge).

6. Sync with remote (required to finish)

/commit is not complete until:

git status --porcelain   # empty
git status -sb           # no ahead/behind vs upstream

Typical sequence:

  1. Run full CI / full suite only if the project overlay expects it before push — skip for docs-only / comment-only / skill-markdown changes (and whenever the overlay says skip)
  2. git fetch + git pull --ff-only (or rebase if that is the repo norm) if remote moved
  3. git push -u as needed so local and upstream match
  4. Re-check status: clean and not ahead/behind

Never force-push the default branch without an explicit ask. Never force-push shared branches unless the user explicitly requests it.

If push is blocked (permissions, hooks, network), report the blocker and leave status honest — do not claim done.

Output

Findings: <critical/warning/note counts, or "none">
Docs: <updated / N/A / fixed SSOT drift>
Pre-commit: <commands + exit codes + log paths>
Commit: <hash + message>
Land: <done / skipped / blocked>
Sync: <pushed / already synced / blocked — reason>
Status: <clean + in sync with origin/<branch> | not done — …>

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.