okhp3-repository-janitor

Audit local Git mirrors against origin/main and manage branch lifecycle safely.

Updated Aug 17, 2026
One-click install
npx skills add https://github.com/OKHP3/telling-forward --skill okhp3-repository-janitor-okhp3
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: okhp3-repository-janitor
Source: https://github.com/OKHP3/telling-forward/tree/main/.agents/skills/okhp3-repository-janitor
Command: npx skills add https://github.com/OKHP3/telling-forward --skill okhp3-repository-janitor-okhp3

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Developers with multiple clones or computers lose track of uncommitted changes, forgotten branches, and stale pull requests, risking accidental deletion of work during cleanup. ## Core Features & Use Cases - Read-only multi-repo audit: Inventory every Git checkout under a mirror root, reporting dirty files, stashes, local-only commits, and divergence from origin/main as JSON. - Work preservation: Detect unreachable commits and pin them under dated refs/archive/ namespaces before any cleanup can trigger garbage collection. - Branch lifecycle decisions: Classify each non-main branch by pull-request state and reachability into keep, review, merge, archive, or delete actions with recorded evidence. - Use Case: You maintain mirrors of dozens of repositories across two machines. Run the audit script to find which checkouts have uncommitted work, which Copilot or Dependabot branches are already merged, and produce a decision ledger before pruning anything. ## Quick Start Ask the agent to audit your local Git mirror directory against GitHub and prepare a safe merge and prune plan without deleting anything.

Frequently Asked Questions about okhp3-repository-janitor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find uncommitted work across multiple Git repositories?▼

Run the audit script against your mirror root to scan every Git checkout for dirty working-tree files, stashes, and local-only commits. It outputs a JSON report listing preservation holds per repository without modifying anything.

How to safely delete merged Git branches on GitHub?▼

Verify each branch is reachable from origin/main and its pull request is merged before deletion. Record the branch name, tip SHA, and PR state, delete the remote branch, then remove the local tracking branch only after verifying the remote deletion.

Can I recover unreachable commits before git garbage collection?▼

Yes, use git fsck with --unreachable to list dangling commits, then pin them under a dated refs/archive/ namespace. This keeps them reachable so later cleanup or garbage collection cannot destroy the work.

Does the audit script modify my repositories?▼

No, the script is read-only by default and only inspects status, refs, and commit graphs. The optional --fetch flag refreshes remote-tracking refs but never changes working trees, and it never prunes or deletes.

When should I not delete a Dependabot or bot branch?▼

Never delete a branch solely because it is bot-created or old. Keep Dependabot branches with open PRs until the update is merged, closed, or superseded, and always check pull-request state first.