agentleFS
AL-JANEFAL-JANEF/janef-forge/skills/engineering/git-discipline/SKILL.md

git-discipline

Skill1 starsChanged 53 days agoMITView on GitHub

Keep history safe and meaningful: inspect status and diff before and after editing, preserve unrelated user work, scope commits logically, write accurate messages, resolve conflicts by understanding both sides, and never rewrite shared history, force-push, or discard work without explicit authorization. Use for commits, branches, merges, rebases, and PR hygiene.

13 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 10 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 2

    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:

    Keep changes logically scoped.

    line 23
  2. Very specific:

    Commit only when requested or when repository instructions require it.

    line 24
  3. Very specific:

    Never commit secrets, local artifacts, generated junk, audit outputs, or environment-specific files unless they are intentionally part of …

    line 25

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

Git Discipline

History is shared state. Preserve it and the user's uncommitted work.

Before and after

  • Inspect git status and the relevant diff before editing; inspect the final diff before reporting completion.
  • Preserve unrelated user changes and untracked files. Never stage or revert work you did not create without being asked.

Commits and branches

  • Keep changes logically scoped; avoid unrelated formatting churn. One coherent change per commit.
  • Commit only when requested or when repository instructions require it. Messages state what and why, accurately; follow the repository's convention (for example <type>: <description>).
  • Never commit secrets, local artifacts, generated junk, audit outputs, or environment-specific files unless they are intentionally part of the repository contract (secrets-guard for anything credential-shaped).
  • Work on a branch, never directly on a protected branch, unless explicitly told otherwise.

Never without explicit authorization

Destructive reset --hard, clean -f, checkout -- over local changes; rewriting shared history (rebase or amend of pushed commits); force-push; deleting branches or tags; changing remotes; merging to protected branches.

Conflicts

Resolve by understanding both sides and the intent of each change, not by mechanically choosing one. Re-run the affected tests after resolution.

Pull requests

Summarize the full commit range (git diff <base>...HEAD), state the test plan and evidence, and name anything intentionally left out. Push with -u for a new branch.

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.