repocache
4
总安装量
4
周安装量
#52357
全站排名
安装命令
npx skills add https://github.com/leto-labs/openclaw-bootstrap-config --skill repocache
Agent 安装分布
amp
3
github-copilot
3
codex
3
kimi-cli
3
gemini-cli
3
cursor
3
Skill 文档
repocache
Use repocache/ as a local mirror of third-party repositories so answers come from source code, not model memory.
What lives where
skills/repocache/scripts/
âââ bootstrap_repocache.sh # initialize local repocache workspace
âââ clone.sh # sync script (static, bundled with skill)
.gitignore # root ignore rules for repocache clones
repocache/
âââ repocache.json # tracked config
âââ <org>/<repo>/ # cloned repositories
If repocache/ or repocache/repocache.json is missing, bootstrap first.
Quick workflow
- Bootstrap
repocache/if needed. - Add/update a resource in
repocache/repocache.json. - Run the bundled
skills/repocache/scripts/clone.shto clone or update repositories. - Search cloned source with
rg,Glob,SemanticSearch, andRead. - Refine config entries when you learn repo layout details.
1) Bootstrap when missing
Run the bundled bootstrap script:
bash skills/repocache/scripts/bootstrap_repocache.sh
If your environment stores skills elsewhere, run the same script from that skill installation path.
Verify:
test -f repocache/repocache.json
test -f .gitignore
test -f skills/repocache/scripts/clone.sh
Root .gitignore should include:
repocache/*
!repocache/repocache.json
Use repocache/* (not repocache/) so repocache/repocache.json can stay tracked.
2) Config schema (repocache/repocache.json)
Top level:
{
"resources": []
}
Each resource is an object with this core schema:
| Field | Required | Used by clone.sh |
Description |
|---|---|---|---|
name |
Yes | Yes | Lookup key used by ./clone.sh <name> |
url |
Yes | Yes | Git clone URL (https://... or git@...) |
path |
Yes | Yes | Clone destination relative to repocache/ (usually org/repo) |
Example:
{
"name": "@trpc/server",
"url": "https://github.com/trpc/trpc.git",
"path": "trpc/trpc"
}
Unknown fields are allowed for agent notes, but the current clone.sh ignores them.
3) Add resources
Workflow A: user gives a GitHub URL
- Derive
pathfrom URL (org/repo). - Choose
name:- npm package name if known (preferred), otherwise repo name.
- Add
{ "name", "url", "path" }torepocache.json. - Clone it:
bash skills/repocache/scripts/clone.sh <name> --root repocache
Workflow B: user gives an npm package name
- Resolve repository URL:
npm view <package-name> repository.url - Normalize URL to a cloneable Git URL (HTTPS or SSH).
- Set
nameto the npm package name. - Set
pathtoorg/repofrom the URL. - Add the resource and run:
bash skills/repocache/scripts/clone.sh <package-name> --root repocache
For monorepos, multiple package names can intentionally point at the same path.
4) Clone/update commands
bash skills/repocache/scripts/clone.sh # sync all (default root: ./repocache)
bash skills/repocache/scripts/clone.sh <name> # sync one
bash skills/repocache/scripts/clone.sh --no-update # clone missing only
bash skills/repocache/scripts/clone.sh <name> --no-update --root repocache
REPOCACHE_DIR=./repocache bash skills/repocache/scripts/clone.sh <name>
Behavior:
- Missing clone:
git clone --depth 1 - Existing clone:
git fetch+git pull --ff-only - Missing
name: exits with error
5) Search process
- Read
repocache/repocache.jsonand find a matchingresources[].name. - Build repo root from
path:repocache/<path>/. - If missing, run
bash skills/repocache/scripts/clone.sh <name> --root repocache. - Search from repo root:
rgfor symbols/stringsGlobfor file discoverySemanticSearchfor behavior-level questionsReadfor exact files and snippets
- For monorepos, narrow manually to likely subdirs (
packages/<pkg>,src, etc.).
Maintenance guidance
- Keep
namestable to avoid lookup misses. - Prefer SSH URLs for private repos.
- If clone/auth fails, switch URL form and retry.
- Update entries when you discover better package naming or path mapping.