agentleFS
gabrielSantosLimagabrielSantosLima/harness/skills/commit-and-push/SKILL.md

Commit and push

Skill1 starsChanged 8 days agoMITView on GitHub

Review the working tree, stage only the intended files, write a Conventional Commit in English, commit, and push when the project policy allows. Use when the user asks to commit, commit and push, or ship the changes currently in the working tree.

  • Commits and pushes

The file

Show its rules and text

We split this skill into the rules it gives an agent

17 rules. About 0 are common, 13 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈13

    Distinctive · estimate

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

    Use this skill only when the user asks to commit, commit and push, or ship the current changes.

    line 8
  2. Very specific:

    Read AGENTS.md and .harness.json when present.

    line 13
  3. Distinctive:

    Read the full diff before staging anything.

    line 34
  4. Distinctive:

    If the working tree contains unrelated changes, do not include them.

    line 36
  5. Very specific:

    Run every command declared in AGENTS.md or .harness.json.

    line 41
  6. Distinctive:

    Never use git add -A, git add .

    line 51
  7. Distinctive:

    Never stage local planning files, secrets, environment files, build output or generated artifacts.

    line 53
  8. Distinctive:

    Follow Conventional Commits, in English, short and imperative:

    line 59
  9. Distinctive:

    Keep the subject under 72 characters, lowercase, without a trailing period.

    line 68
  10. Distinctive:

    Use the body only when the change needs context (why, trade-offs, references).

    line 69
  11. Very specific:

    Never add AI authorship or co-author trailers: no Co-Authored-By, no "Generated by ...", no tool, agent or session attribution.

    line 71
  12. Distinctive:

    Never mention the agent, the prompt or the session.

    line 73
  13. Distinctive:

    If a hook fails, read the output, fix the cause and commit again.

    line 83
  14. Distinctive:

    Only when the project policy and the user allow it:

    line 88
  15. Very specific:

    If the branch has no upstream, use git push -u origin <branch>.

    line 94
  16. Distinctive:

    Never commit generated artifacts that the repository ignores.

    line 112
  17. Distinctive:

    Never commit or push when the user only asked to review changes.

    line 113

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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

Commit and push

Use this skill only when the user asks to commit, commit and push, or ship the current changes.

1. Read the project policy

Read AGENTS.md and .harness.json when present. They define:

  • the check commands;
  • the commit autonomy: commit-and-push-when-asked, commit-only-when-asked or strict;
  • the local-only files that must never be staged.

With strict, confirm each git write action separately. With commit-only-when-asked, never push unless the user asks for it in a separate instruction.

2. Inspect the repository

git status --short
git branch --show-current
git diff
git diff --cached
git log --oneline -5

Read the full diff before staging anything. Use the recent log to match the repository's commit style. If the user named specific files, stage only those. If the working tree contains unrelated changes, do not include them; ask which changes belong to the commit.

3. Run the checks

Run every command declared in AGENTS.md or .harness.json. A failing check blocks the commit: fix the problem first. Do not skip hooks with --no-verify unless the user explicitly asks.

4. Stage explicit paths

git add path/to/file path/to/other
  • Never use git add -A, git add . or git commit -a unless every reviewed change belongs to the same commit.
  • Never stage local planning files, secrets, environment files, build output or generated artifacts.
  • Review the staged diff with git diff --cached.

5. Write the message

Follow Conventional Commits, in English, short and imperative:

<type>(<optional scope>): <short description>

Allowed types: feat, fix, refactor, chore, docs, test, perf, build, ci, style.

  • Keep the subject under 72 characters, lowercase, without a trailing period.
  • Use the body only when the change needs context (why, trade-offs, references); wrap it at 72 columns.
  • Never add AI authorship or co-author trailers: no Co-Authored-By, no "Generated by ...", no tool, agent or session attribution.
  • Never mention the agent, the prompt or the session.
  • Split unrelated work into separate commits when the user asks for a clean history.

6. Commit

git commit -m "type: short description"

If a hook fails, read the output, fix the cause and commit again. Do not amend, rebase or squash existing commits unless the user explicitly asks.

7. Push

Only when the project policy and the user allow it:

git push

If the branch has no upstream, use git push -u origin <branch>. Never force-push unless the user explicitly requests it on a branch they own. If the push is rejected as non-fast-forward, stop and report instead of rewriting history.

8. Verify and report

git status --short
git log -1 --oneline

Report the branch, the commit hash and subject, and confirm whether the working tree is clean. Say what was intentionally left uncommitted and why.

Boundaries

  • This skill never creates tags or releases. Releases use release-cut.
  • Never commit generated artifacts that the repository ignores.
  • Never commit or push when the user only asked to review changes.

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.