agentleFS
0xrafasec0xrafasec/ai-workflow/skills/commit/SKILL.md

commit

Skill9 starsChanged 18 days agoMITView on GitHub

Stage and commit the working tree as one or more conventional commits, split by logical concern. Use when the user says 'commit this', 'save my work', 'check in the changes', or is ready to record progress in git before moving on. Local only: never pushes (use /wf:pr for that). Not for fixing a bug or building a feature (use /wf:fix or /wf:feature, which can commit with --commit).

  • Reads credentials

187 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

  • 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

  • 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

  • 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

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 166 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 1

    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:

    If the tree is one concern, one commit is correct.

    line 27
  2. Distinctive:

    Present the plan: before touching git, and wait for explicit approval:

    line 31
  3. Distinctive:

    Start from an empty index: git restore --staged .

    line 43
  4. Distinctive:

    Commit with a HEREDOC:

    line 45
  5. Very specific:

    Add an attribution trailer (Co-Authored-By) only if recent commits carry one or the session's instructions require it.

    line 54

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

Stage and commit the current working tree.

Guardrails

  • One concern per commit. A bug fix and a refactor, even if both are tiny, go in separate commits. That keeps git log and git blame useful and lets git revert isolate one change.
  • Don't push, force-push, amend, reset --hard, or touch the remote. Those belong to /wf:pr or the user; staying in that lane keeps the two operations reviewable independently.
  • Don't bypass pre-commit hooks with --no-verify. Hooks catch real problems (lint, types, secrets). If one fails, the commit didn't happen, so fix the cause and commit again. Never --amend after a hook failure: it would rewrite the previous commit and quietly overwrite earlier work.
  • Stage explicit paths, not git add . / -A. Wildcards sweep in .env, credentials, build artifacts and scratch files. Never stage key or credential files or large binaries; list untracked files and ask about any you're unsure of.

Steps

  1. Survey the working tree — run in parallel: git status, git diff --stat, git log --oneline -10 (the log shows the repo's commit style; match it).
    • Clean tree (nothing staged, unstaged, or untracked and relevant): stop and say there's nothing to commit.
    • On the trunk branch (main/master, or whatever git symbolic-ref --short refs/remotes/origin/HEAD names) or a detached HEAD: trunk is never committed to directly, so propose a <type>/<slug> branch per the trunk convention in your global agent instructions (~/.claude/CLAUDE.md or ~/.codex/AGENTS.md) and create it once approved.
    • Changes the user already staged are a hint for grouping, not a mandate.
  2. Read the diffs of any file whose change isn't obvious from its path (git diff <file>, or git diff --cached <file> for staged changes). A file named auth.go could hold a typo fix or a rewrite.
  3. Group by concern — assign every changed file to exactly one commit.
    • Types: feat, fix, refactor (behaviour preserved), docs, test, perf, security, chore, build, ci.
    • Split a file across commits with git add -p when its hunks belong to different concerns.
    • Order groups so each commit leaves the codebase working.
    • If the tree is one concern, one commit is correct. Don't invent splits.
  4. Draft messages — <type>: <subject>, or <type>(<scope>): <subject> when recent commits use scopes: imperative, under 72 characters, no trailing period, describing the outcome rather than the mechanism (fix: reject empty passwords, not fix: added if statement). Add a body only when the why is non-obvious: a hidden constraint, a past incident, a tradeoff. Match the casing of recent commits.
  5. Present the plan before touching git, and wait for explicit approval:

    Commit 1/N — <type>: <subject>
      Files:
        path/to/file1
      [Body if present]

    "yes" / "proceed" commits as planned. Targeted edits ("merge 2 and 3", "reword commit 1", "move file X to commit 1", "drop commit 3") revise the plan, which you re-present. "no" / "stop" aborts and leaves the tree untouched.

  6. Commit sequentially. For each group:
    • Start from an empty index: git restore --staged . (the working tree stays intact; in a repository with no commits yet, use git rm -r --cached -q . instead).
    • Stage explicit paths (git add <paths>, or git add -p <path> for partial files).
    • Commit with a HEREDOC:
      git commit -m "$(cat <<'EOF'
      <type>: <subject>
      
      <body if any>
      EOF
      )"
    • Add an attribution trailer (Co-Authored-By) only if recent commits carry one or the session's instructions require it.
  7. On a hook failure, stop. Show the hook output, which commit was being made, and git status. Then fix and make a new commit, or ask how to proceed.
  8. Report — run git status and git log --oneline -<N> (N = commits created) and show both. The skill ends here; pushing and opening a PR is /wf:pr.

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.