agentleFS
dekozadekoza/oh-my-slop/skills/practice/git-discipline/SKILL.md

git-discipline

Skill4 starsChanged 8 months agoUnlicenseView on GitHub

Use when running any git operation — committing, pushing, branching, merging, rebasing — or when a command could touch uncommitted or untracked work. Enforces conventional-commit messages, a commit per execution wave, and hard guards on destructive commands. Triggers on: git clean, git reset --hard, force push, rebasing a published branch, rm on user files, deleting untracked files.

  • Deletes or force-pushes

We split this skill into the rules it gives an agent

8 rules. 0 are common, 6 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 10 edited versions we read keep these.

  • 6

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

    Before ANY operation that could affect them:

    line 20
  2. Distinctive:

    Run git status and understand what is untracked and why.

    line 21
  3. Distinctive:

    Never assume untracked files are garbage, generated artifacts, or safe to delete.

    line 22
  4. Very specific:

    Worktree location: when the user requests a Git worktree, create it under the project's root-level, Git-ignored .worktrees/ directory.

    line 36
  5. Distinctive:

    When executing a plan with parallel waves, commit all results after each wave completes — before starting the next wave.

    line 42
  6. Distinctive:

    Do not accumulate changes across multiple waves into a single commit

    line 45
  7. Very specific:

    Use conventional format: type(scope): description

    line 50
  8. Distinctive:

    Before making changes to unfamiliar code, check git log and git blame to understand how it evolved.

    line 64

“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

Git is mostly reversible — except when it isn't. The guards against irreversible loss of the user's work come first; commit conventions follow.

Protect Uncommitted and Untracked Work

Untracked files are the user's property. They may be hours of work with no other copy — a legitimate workflow, e.g. cleaning files before the first commit to keep secrets out of history. Treat them as sacred.

Before ANY operation that could affect them:

  1. Run git status and understand what is untracked and why.
  2. Never assume untracked files are garbage, generated artifacts, or safe to delete.

These commands require the user to explicitly request them — running any without that request is a catastrophic, possibly unrecoverable bug:

  • git clean (any flags) — destroys untracked files irreversibly
  • git checkout -- . or git restore . — discards all uncommitted changes
  • git reset --hard — destroys uncommitted work
  • rm -rf / rm -r on directories containing user files
  • Any glob-pattern command (rm *.md, git checkout -- *.py) that could hit user files

Never rewrite shared history without explicit permission — no --force push, no rebasing published branches.

Rogue files from a subagent: list them to the user first, then delete them individually by exact path — never with a blanket command.

Worktree location: when the user requests a Git worktree, create it under the project's root-level, Git-ignored .worktrees/ directory. Verify that .worktrees/ is ignored first, then use a descriptive name such as <task-id>-<short-handle>.

Commit Behavior

Commit After Every Execution Wave

When executing a plan with parallel waves, commit all results after each wave completes — before starting the next wave.

  • Each wave commit captures a coherent, working state of the codebase
  • Do not accumulate changes across multiple waves into a single commit
  • Starting a new wave without committing the previous wave's results = bug

Conventional Commits

Use conventional format: type(scope): description

feat(auth): add JWT refresh token rotation
fix(cart): prevent negative quantities in checkout
docs(api): update OpenAPI spec for /users endpoint

The description should explain what changed, not what you did:

  • ✅ "add JWT refresh token rotation"
  • ❌ "I added JWT refresh token rotation"

Git History as Context Source

Before making changes to unfamiliar code, check git log and git blame to understand how it evolved. Previous commit messages explain past decisions — use them before asking the user to re-explain.

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.

Reviews can't be read right now.

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.