git.repo-manager
作者: coinbase
管理GitHub儲存庫本地快取的說明。這通常在用戶想要對…進行研究/分析時執行。
npx skills add https://github.com/coinbase/cds --skill git.repo-managerManages a local repository cache at temp/repo-cache/. Use these patterns for repo lifecycle operations.
Ensure a repo is available and up to date
-
Check whether the repo directory already exists:
test -d temp/repo-cache/<name> && echo "exists" || echo "missing" -
If missing — clone a shallow copy of the default branch:
git clone --depth 1 <repo-url> temp/repo-cache/<name> --quiet -
If already present — pull the latest commits:
cd temp/repo-cache/<name> && git pull --quiet
Clean up a repo
Remove a cached repo when it's no longer needed or when explicitly asked:
rm -rf temp/repo-cache/<name>
Rules
- Always use
temp/repo-cache/as the cache root — never clone repos to other locations - Always clone with
--depth 1(shallow) to minimize disk usage and clone time - Never clone more than the single repo you need for the current task