agentleFS
strikersamstrikersam/autonomous-ai-agency/.agents/skills/git-hygiene/SKILL.md

git-hygiene

Skill9 starsChanged 3 months agoMITView on GitHub

  • Commits and pushes

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. 0 are common, 9 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 9

    Distinctive

    This author's own choices. Worth a look.

  • 5

    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 pushing commits to master or opening a PR

    line 7
  2. Distinctive:

    When git history has become messy (fixup commits, WIP messages, etc.)

    line 8
  3. Very specific:

    When the changelog-enforcer or release-readiness skills are applied

    line 10
  4. Distinctive:

    Run git status to see what's changed

    line 15
  5. Very specific:

    Check .gitignore is catching what it should

    line 17
  6. Distinctive:

    Run git log --oneline -20 to inspect recent commits

    line 20
  7. Very specific:

    Ensure messages follow the pattern: <type>: <short description> [#issue]

    line 25
  8. Distinctive:

    No trailing periods in subject line

    line 28
  9. Distinctive:

    Do not rewrite history on shared branches unless explicitly authorized

    line 33
  10. Distinctive:

    Ensure the working branch is up to date with its upstream

    line 36
  11. Very specific:

    Use --force-with-lease only if a rebase was performed, never --force

    line 42
  12. Distinctive:

    No unintended files committed

    line 46
  13. Distinctive:

    Never commit secrets, credentials, or API keys

    line 50
  14. Very specific:

    If in doubt about a commit, use git diff HEAD~1 to review what it contains

    line 52

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

Skill: Git Hygiene

Purpose

Ensures the repository's git history, branch state, and commit messages are clean, meaningful, and follow project conventions before pushing or merging.

When to Use

  • Before pushing commits to master or opening a PR
  • When git history has become messy (fixup commits, WIP messages, etc.)
  • As a final step in any implementation workflow
  • When the changelog-enforcer or release-readiness skills are applied

Process

1. Review Staged and Unstaged Changes

  • Run git status to see what's changed
  • Confirm no unintended files are staged (build artifacts, secrets, editor files)
  • Check .gitignore is catching what it should

2. Review Commit History

  • Run git log --oneline -20 to inspect recent commits
  • Flag commits with vague messages: "fix", "wip", "test", "asdf", etc.
  • Note commits that could be squashed without losing meaning

3. Validate Commit Messages

  • Ensure messages follow the pattern: <type>: <short description> [#issue]
  • Valid types: feat, fix, docs, chore, refactor, test, style
  • Subject line should be ≤72 characters
  • No trailing periods in subject line

4. Clean Up if Needed

  • Squash fixup commits with git rebase -i if appropriate
  • Amend the most recent commit message with git commit --amend if needed
  • Do not rewrite history on shared branches unless explicitly authorized

5. Confirm Branch State

  • Ensure the working branch is up to date with its upstream
  • Resolve any merge conflicts before pushing
  • Confirm you are on the intended branch

6. Push

  • Push with git push origin <branch>
  • Use --force-with-lease only if a rebase was performed, never --force

Output

  • Clean git history with meaningful commit messages
  • No unintended files committed
  • Successful push to the correct branch

Notes

  • Never commit secrets, credentials, or API keys
  • Binary files and generated files should generally not be committed
  • If in doubt about a commit, use git diff HEAD~1 to review what it contains

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.