git-repo-discovery
Skill3 starsChanged 3 months agoMITView on GitHub
Find, cache, and refresh git repositories — both local projects and remote repos. Uses the gum CLI to discover existing checkouts under ~/*/ before cloning. Use when the user references a git repository (URL, org/repo, or local path) or when you need to locate a project on disk.
In this repository86 other files it gives its agents.
- AGENTS.mdAGENTS.md
- adrSkill
- adzic-bddSkill
- agent-md-refactorSkill
- agent-muxSkill
- agent-role-impersonatorSkill
- agilquest-reservationsSkill
- ai-text-humanizerSkill
- architecture-decision-recordsSkill
- ast-grepSkill
- atacSkill
- aws-cliSkill
- bart-adversarial-reviewerSkill
- bddSkill
- branch-doctorSkill
- c4-architectureSkill
- c4Skill
- claude-sub-agentSkill
- codemap-config-setupSkill
- codemap-exploreSkill
- codemap-handoffSkill
- codemap-hub-safetySkill
- codemapSkill
- commitSkill
- copilot-sub-agentSkill
- daily-standupSkill
- daily-statusSkill
- debugSkill
- design-thinkingSkill
- doctorSkill
- docx-word-processorSkill
- farley-tddSkill
- forensicsSkill
- gemini-sub-agentSkill
- git-commit-formatterSkill
- git-forensicsSkill
- github-actions-permissionsSkill
- github-cliSkill
- git-safety-guardrailsSkill
- harness-idpSkill
- humanizeSkill
- iteration-plannerSkill
- jira-issue-managerSkill
- justfile-assistantSkill
- kiro-sub-agentSkill
- lessons-learnedSkill
- lessonsSkill
- lisa-planning-agentSkill
- lovejoy-release-agentSkill
- lsp-code-analysisSkill
- macro-to-microSkill
- marge-product-agentSkill
- meeting-notesSkill
- mermaid-diagram-generatorSkill
- modern-cli-overridesSkill
- native-web-searchSkill
- obsidian-notetakerSkill
- outlook-headlessSkill
- pdf-document-processorSkill
- pi-sub-agentSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
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
- Distinctive: line 30
Before cloning anything, always check if the repo already exists locally:
- Very specific: line 83
When a repo needs to be cloned (not just cached), use gum clone which analyses your existing project structure and suggests the right …
- Distinctive: line 99
Search locally first: Don't clone what's already on disk.
- Very specific: line 100
Cache for reading, clone for working: Use checkout.sh when you just need to read/reference.
- Distinctive: line 103
Don't edit cached repos: Create a worktree or copy instead.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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
Librarian — Repository Finder & Cache
Find local git repositories or cache remote ones for reference. Prefers discovering existing checkouts over cloning — your machine likely already has what you need.
Quick Reference
| Task | Command |
| Find a local repo | gum projects --format json | jq '.[] | select(.path | test("PATTERN"))' |
| List all local repos | gum projects --format simple |
| Search by remote URL | gum projects --format json | jq '.[] | select(.remote | test("org/repo"))' |
| Clone with smart placement | gum clone org/repo |
| Suggest clone location | gum clone --suggest org/repo |
| Cache a remote repo | scripts/checkout.sh <repo> --path-only |
| Force-refresh a cached repo | scripts/checkout.sh <repo> --force-update --path-only |
Strategy: Local First
Before cloning anything, always check if the repo already exists locally:
# Step 1: Search local projects (fast — uses gum's indexed DB)
gum projects --format json | jq -r '.[] | select(.remote | test("SEARCH_TERM")) | .path'
# Step 2: If not found locally, check the cache
scripts/checkout.sh org/repo --path-only
# Step 3: Only clone if truly missing (gum picks the right directory)
gum clone org/repoFinding Local Repos
The gum CLI maintains an indexed database of all git repos under ~/:
# All repos as JSON (path, remote, branch)
gum projects --format json
# Simple list of paths
gum projects --format simple
# Force re-scan
gum projects --refresh --format simple
# Search examples
gum projects --format json | jq -r '.[] | select(.path | test("terraform")) | .path'
gum projects --format json | jq -r '.[] | select(.remote | test("shalomb")) | "\(.path)\t\(.remote)"'Caching Remote Repos
For repos not already on disk, use scripts/checkout.sh to cache under
~/.cache/checkouts/<host>/<org>/<repo>:
# These all resolve to the same checkout:
scripts/checkout.sh mitsuhiko/minijinja --path-only
scripts/checkout.sh github.com/mitsuhiko/minijinja --path-only
scripts/checkout.sh https://github.com/mitsuhiko/minijinja --path-only
scripts/checkout.sh git@github.com:mitsuhiko/minijinja.git --path-onlyFeatures:
- Partial clone (
--filter=blob:none) for efficiency - Throttled refresh (every 5 minutes by default)
- Fast-forward merge when checkout is clean
- Force refresh with
--force-update
Cloning New Repos
When a repo needs to be cloned (not just cached), use gum clone which
analyses your existing project structure and suggests the right directory:
# Clone with intelligent directory suggestion
gum clone hashicorp/terraform
# Just see where it would go
gum clone --suggest hashicorp/terraform
# Force a specific location
gum clone --target ~/projects/hashicorp/terraform hashicorp/terraformRules
- Search locally first. Don't clone what's already on disk.
- Cache for reading, clone for working. Use
checkout.shwhen you just need to read/reference; usegum clonewhen you need a proper working copy. - Don't edit cached repos. Create a worktree or copy instead.
- Prefer gum projects over find. It's indexed and fast. Only fall
back to
findif gum is unavailable.
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.

