agentleFS
Smaui94Smaui94/ClaudeSkillCollection/repo-hygiene/SKILL.md

repo-hygiene

Skill0 starsChanged 10 days agoMITView on GitHub

Check repository health - missing or incomplete .gitignore for the detected languages, committed build artifacts, binaries, IDE and OS files, large files (Git LFS candidates), missing LICENSE/README, mixed line endings without .gitattributes, executable bits, case-only filename conflicts, misplaced .gitkeep files and optionally stale branches. Use when asked to check/clean up/audit a repository, .gitignore, committed junk files, repo structure hygiene, or before publishing a repo.

  • Reads credentials

15 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use systematic-debugging.

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.
  • OpenAISkill

    systematic-debugging

    Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 14 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run (no pipe; output is capped): bash <skill-dir>/scripts/hygiene.sh <repo-root> [hitsPerRule=8]

    line 14
  2. Very specific:

    Verify samples: is a "committed artifact" really generated (e.g.

    line 16
  3. Very specific:

    Every finding has a concrete path (or .gitignore / repo root).

    line 49
  4. Distinctive:

    Do not change anything. Apply changes only when the user explicitly asks for it.

    line 52

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

Repository hygiene

Review only: report findings and suggest commands as text, never delete, untrack, move or rewrite anything unless the user explicitly asks.

Scope

The git repository the user names, otherwise the current one. Uses tracked files (git ls-files) as the source of truth. Outside a git repository, only RH5 can be checked; say so.

Steps

  1. Run (no pipe; output is capped): bash <skill-dir>/scripts/hygiene.sh <repo-root> [hitsPerRule=8]
    • Prints ## ID count SEV | desc + samples. LARGE_KB=<n> changes the large-file limit (default 5120 KB), BRANCHES=1 adds RH11.
  2. Verify samples: is a "committed artifact" really generated (e.g. bin/ can hold real scripts)? Is a large file intended (e.g. a test asset)?
  3. README content is out of scope here - point to markdown-readme-google-style. Secrets in files - point to secrets-scan.
  4. Report (format below), with the commands the user could run.

Rules

  • RH1 error: no .gitignore; warning: .gitignore misses entries for detected languages/tools (node_modules/, __pycache__/, .venv/, target/, bin//obj/, build/, .godot/, Unity Library/, .env, OS/IDE files)
  • RH2 warning: committed build output or dependencies (node_modules/, __pycache__/, bin/, obj/, target/, .godot/, *.pyc, *.class, *.o, *.exe, *.dll, *.jar …) - "possible" when the folder may be intentional
  • RH3 warning: committed IDE/OS files (.idea/, .vs/, .DS_Store, Thumbs.db, desktop.ini, *.suo, *.user, *.swp); info: .vscode/ (shared settings can be intentional)
  • RH4 warning: large file above the limit - candidate for Git LFS or for not being in the repo at all
  • RH5 warning: no LICENSE/COPYING (public repos without a license are not open source) or no README at the root
  • RH6 warning: mixed line endings without .gitattributes; error: shell scripts with CRLF line endings (break with $'\r': command not found)
  • RH7 info: scripts without the executable bit in git, or non-scripts with it (on Windows core.filemode is often off, so all bits look the same - mention it)
  • RH8 error: paths that differ only in case (break checkouts on Windows/macOS)
  • RH9 info: .gitkeep in a directory that has other tracked files
  • RH10 info: empty tracked files (except __init__.py, py.typed, .gitkeep)
  • RH11 info (only with BRANCHES=1): local branches without commits for 180+ days, or already merged

Commands to suggest (as text, never run them)

  • Untrack but keep locally: git rm -r --cached <path> after adding it to .gitignore
  • Templates: https://github.com/github/gitignore
  • Line endings: a .gitattributes with * text=auto and *.sh text eol=lf, then git add --renormalize .
  • Executable bit: git update-index --chmod=+x <file>
  • Large files: git lfs track "<pattern>"; removing them from history needs git filter-repo and is disruptive - explain, don't run
  • Case conflict: git mv via a temporary name

False positives to drop

bin/ with hand-written scripts (Node/Ruby/shell projects) · vendored binaries that are intentionally committed (document them) · dist/ in libraries that publish from git · large test fixtures the project needs · .vscode/ with shared settings.json/extensions.json.

Report

In the user's language, grouped by rule:

path - error|warning|info - <ID> <rule> - <why it is a problem> - suggestion: <command or change>
  • Every finding has a concrete path (or .gitignore / repo root). Mark uncertain ones as "possible".
  • Bulk hits (e.g. 2,000 files in node_modules/): report once with count and the folder.
  • End with a summary: findings per severity, then the 3 most important cleanups first.
  • Do not change anything. Apply changes only when the user explicitly asks for it.

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.