git-local
Use instead of `git clone` when a request gives a GitHub URL or `owner/repo`, or when a task needs the code of an external GitHub repository.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- kind
- dev
- name
- git-local
- description
- Use instead of `git clone` when a request gives a GitHub URL or `owner/repo`, or when a task needs the code of an external GitHub repository.
02 资源文件 3
- 参考文档references/opensrc-operations.md2.6 KB
- 脚本scripts/opensrc_sync.py23.0 KB
- 脚本scripts/tests/test_opensrc_sync.py9.9 KB
03 SKILL.md 正文
This skill replaces git clone. It puts a GitHub repository in the opensrc cache and reports its path. Use gh for issues, pull requests, and repository metadata that need no copy of the code.
Keep every copy in the cache, never in /tmp, the current folder, or the default path of gh repo clone or git clone. Make a separate checkout only when the user asks for one, or for git history, as Branches, Tags, and Git History says.
Prerequisites
Confirm each tool before the first step. If one is missing, stop and give the user its install command; do not install it yourself.
| Tool | Where | Linux | macOS | Confirm |
|---|---|---|---|---|
opensrc |
the cache machine | mise use -g npm:opensrc |
PNPM_HOME="$HOME/Library/pnpm" "$HOME/Library/pnpm/bin/pnpm" add -g --config.minimum-release-age=10080 --config.strict-dep-builds=true --allow-build=opensrc opensrc |
opensrc --version |
uv |
this machine | mise use -g uv |
brew install uv |
uv --version |
rg, for code search |
the cache machine | mise use -g ripgrep |
brew install ripgrep |
rg --version |
The install commands assume mise on Linux, and Homebrew and pnpm on macOS. On another machine, confirm a tool with ssh <host> '<confirm command>'.
Cache machine
When the fleet skill is installed, its references/fleet.toml names the machine that holds the cache: the one with an opensrc key. Pass that file as --fleet to every Workflow run; on another machine, the script runs opensrc through ssh. Without fleet, the cache is opensrc's default on this machine: $OPENSRC_HOME, or ~/.opensrc.
Workflow
-
Normalize the repository reference to
owner/repo:https://github.com/owner/repo->owner/repohttps://github.com/owner/repo/tree/main/subdir->owner/repo, then readsubdirinside itgit@github.com:owner/repo.git->owner/repogithub.com/owner/repo->owner/repo- Strip any trailing
.gitsuffix
-
Fetch or refresh it:
uv run <this skill's folder>/scripts/opensrc_sync.py --max-age 24h [--fleet <fleet folder>/references/fleet.toml] <owner>/<repo>It fetches a missing repository and refreshes a copy older than 24 hours. Done when it answers
"ok":truewithrepos[0].path, andmachinewhen the cache is on another machine. On a failure, report itserrorsand read OpenSrc Operations; never fetch into another folder -
Report the path, as
<machine>:<path>when the answer names amachine -
If the request names only a repository, stop here. Do not read the code, summarize it, or ask for a next task
-
If a task needs the code, search and read it at that path. When the answer names a
machine, run each command there through thesshvalue of that machine infleet.toml, such asssh <ssh> 'rg -n "pattern" <path>' -
When the cache is on this machine and a graphical session is available, optionally open the path with
openon macOS orxdg-openon Linux
opensrc_sync.py without a repository refreshes every cached repository, downloading each one again; run it so only when the user asks. --help lists its options.
Branches, Tags, and Git History
opensrc stores source snapshots without .git, for reading code. If the user needs git history, branches, remotes, or a writable checkout, say so and create a task-specific clone or worktree outside the cache.
Do Not
- Do not edit files inside the cache unless the user explicitly asks to modify that cached source
- Do not delete or replace cached repositories unless the user asks for a refresh or repair
- Do not modify the workspace's
.gitignore,tsconfig.json, orAGENTS.mdas part of fetching source
04 同仓库更多 Skills
writing-great-skills
Use when creating, modifying, evaluating a skill.
writing-for-agents
Use when creating, editing, or reviewing a skill, AGENTS.md, CLAUDE.md, or another document agents read.
why
Use for questions about design rationale, the history of regressions or incidents, or the evidence behind thresholds and tradeoffs. Use `how` for runtime behavior. Do not use for plain commit or date lookups.
verify-video-archive
Use when validating the macOS or Linux archive workflow reached by `just convert-video`, including real media, prerequisites, terminal progress, source safety, locking, and recovery.
verify-transcript
Use when validating transcript CLI behavior, locating its verification features, or running the paid YouTube end-to-end check.
verify-skills
Use when verifying `just compile-skills`, `just remote-skills`, `just install-skills`, or `just skills-discover` in the skills repository, such as after changing their scripts or adding, renaming, or moving a skill.