okhp3-repository-janitor
Skill3 starsChanged 2 months agoMITView on GitHub
Reconcile a collection of local Git repositories with their GitHub origins, inspect all local variations against origin/main, preserve uncommitted or unreachable work, and manage branch lifecycle. Use when a user has multiple clones or computers, needs to find differences from origin/main, recover forgotten work, review agent/Copilot/Dependabot branches, merge completed pull requests, prune verified redundant branches, or establish a repeatable daily or weekly repository-maintenance routine.
In this repository57 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/skills/vercel-react-best-practices/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- architecture-decision-recordsSkill
- catalog-integritySkill
- frontend-designSkill
- okhp3-artifact-validationSkill
- okhp3-as-is-process-captureSkill
- okhp3-brand-style-registrySkill
- okhp3-capture-intakeSkill
- okhp3-chatgpt-project-migrationSkill
- okhp3-custom-gpt-builderSkill
- okhp3-custom-gpt-readinessSkill
- okhp3-decision-model-authoringSkill
- okhp3-elicitation-interviewsSkill
- okhp3-equilibrium-reviewSkill
- okhp3-evidence-standardSkill
- okhp3-future-state-strategySkill
- okhp3-gpt-skill-conversion-planSkill
- okhp3-graduation-gateSkill
- okhp3-handoff-packagingSkill
- okhp3-notion-capture-routerSkill
- okhp3-outcome-modeling-coreSkill
- okhp3-overkill-hill-brandSkill
- okhp3-process-captureSkill
- okhp3-process-gap-analysisSkill
- okhp3-process-intake-and-scopeSkill
- okhp3-project-promotionSkill
- okhp3-replit-build-in-publicSkill
- okhp3-replit-canvas-boardSkill
- okhp3-replit-design-pipelineSkill
- okhp3-replit-free-mode-autonomySkill
- okhp3-replit-github-syncSkill
- okhp3-replit-multi-artifactSkill
- okhp3-replit-repl-janitorSkill
- okhp3-replit-repository-janitorSkill
- okhp3-replit-task-executorSkill
- okhp3-repository-organizerSkill
- okhp3-session-handoffSkill
- okhp3-skill-catalogerSkill
- okhp3-skill-discoverySkill
- okhp3-skill-foundrySkill
- okhp3-source-backed-researchSkill
- okhp3-thread-context-extractionSkill
- okhp3-thread-extract-chatgptSkill
- okhp3-thread-extract-claudeSkill
- okhp3-triage-and-fileSkill
- okhp3-vite-github-pagesSkill
- production-build-verificationSkill
- published-keyboard-recovery-checkSkill
- publish-health-checkSkill
- publishing-trigger-checkSkill
- static-route-validationSkill
- validation-smokeSkill
- vercel-react-best-practicesSkill
- web-design-guidelinesSkill
- okhp3-skill-promotionSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
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
- Very specific: line 20
Keep a multi-repository Git estate understandable without losing work.
- Distinctive: line 28
Treat a merged branch, a closed pull request, and an abandoned branch as different facts.
- Distinctive: line 30
Delete a remote branch only when its merged/superseded status, commit reachability, and pull-request state are confirmed.
- Distinctive: line 31
Never rewrite main, force-push, or remove stashes, archive refs, or untracked files without a separately stated and confirmed recovery plan.
- Very specific: line 36
Run scripts/audit_mirrors.py <mirror-root> --include-unreachable for a read-only baseline.
- Distinctive: line 49
Use audit-only mode for a daily task:
- Distinctive: line 55
Use the output to report only new or changed exceptions.
- Distinctive: line 68
Do not collapse ambiguity into a cleanup recommendation.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 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.
Files
okhp3-repository-janitor
OverKill Hill P³ · overkillhill.com · github.com/OKHP3
Keep a multi-repository Git estate understandable without losing work. Treat origin/main as the comparison baseline, not as evidence that other work is disposable.
Safety contract
- Begin with a read-only inventory. Do not delete repositories, branches, stashes, refs, or commits during discovery.
- Preserve before pruning. Record dirty files, stashes, local-only commits, and unreachable commits. Pin unreachable commits under a dated
refs/archive/namespace before a later cleanup can trigger garbage collection. - Refresh remotes with
git fetch origin; do not use--pruneuntil stale remote branches have been classified. - Compare each checkout to the refreshed
origin/main. Report both file-level and commit-level differences. - Treat a merged branch, a closed pull request, and an abandoned branch as different facts. Query the pull request before deletion.
- Merge only a reviewed pull request whose checks and destination are suitable. Do not merge a branch merely because it is old or has a bot name.
- Delete a remote branch only when its merged/superseded status, commit reachability, and pull-request state are confirmed. Delete the local tracking branch only after the remote deletion is verified.
- Never rewrite
main, force-push, or remove stashes, archive refs, or untracked files without a separately stated and confirmed recovery plan.
Audit workflow
- Resolve the mirror root and verify that every child is a Git checkout. Keep repositories outside that root out of scope.
- Run
scripts/audit_mirrors.py <mirror-root> --include-unreachablefor a read-only baseline. Add--fetchto refresh remote-tracking refs without changing any working tree. - For each repository, inspect the report sections in this order:
- dirty working-tree files and stashes;
- commits reachable locally but not from a remote;
- current
HEADversusorigin/main, distinguishing its direct tree difference from the files changed on the branch since the shared base; - local and remote branches and whether each is already reachable from
origin/main; - archive refs and unreachable commits.
- Query GitHub for every non-main remote branch: its pull request, whether it is open, closed, or merged, its checks, and whether a newer branch supersedes it. Read
references/branch-lifecycle.mdbefore classifying candidates. - Produce a decision ledger with one row per candidate:
keep,review,merge,close PR,archive, ordelete. State the evidence and recovery point. - Execute in small batches. For each approved merge, refresh, verify the expected head, merge through the pull request, refetch, then delete only the exact verified merged branch. Re-run the audit after every batch.
Scheduled operation
Use audit-only mode for a daily task:
python3 scripts/audit_mirrors.py /Volumes/OKH-Local/04_GitHub_Mirrors --fetch --include-unreachableUse the output to report only new or changed exceptions. A weekly task may prepare a decision ledger and inspect open pull requests, but must not merge, close, or delete without explicit authorization for the exact targets.
Output contract
Report:
- coverage: discovered repositories, fetch failures, and repositories without
origin/main; - preservation holds: dirty files, stashes, local-only commits, unreachable commits, and archive refs;
- variants: per-repository commit divergence and changed file paths versus
origin/main; - branch lifecycle: each non-main branch, PR state, reachability, recommendation, and rationale;
- actions taken: exact merge, close, archive, or deletion targets, plus verification;
- remaining decisions: targets that need human intent or a deeper code review.
Do not collapse ambiguity into a cleanup recommendation. A clean report is one with explicit exceptions, not necessarily zero branches.
Resources
scripts/audit_mirrors.py— read-only or fetch-only multi-checkout inventory with JSON output.references/branch-lifecycle.md— evidence required for merge, retention, archival, and deletion decisions.
About
Built by Jamie Hill · OverKill Hill P³ Published at github.com/OKHP3 Part of the OKHP3/skillz Agent Skill library. MIT License -- free to use, fork, and adapt. A nod to the source is appreciated.
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
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.

