From alexop-skills
Vendor a library's source code into the current repo as a git subtree under `repos/<name>/`, then wire it into AGENTS.md as reference material so coding agents read real source instead of fighting stale docs. Use when the user types "$clone-repo <url>", "/clone-repo <url>", "vendor <url>", "clone <url> as a subtree", "add <url> as reference for the agent", "feed <url> to the agent", "just clone the repo <url>", or otherwise asks to set up a third-party repo as agent-readable context.
How this skill is triggered — by the user, by Claude, or both
Slash command
/alexop-skills:clone-repoThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Pulls a library's source into the current project at `repos/<name>/` so coding agents can read real source instead of relying on stale training data or doc-CLI shims. Move from Michael Arnaldi's "Vibe Engineering Effect Apps" — agents are post-trained on reading code, not prose, so feed them code.
Pulls a library's source into the current project at repos/<name>/ so coding agents can read real source instead of relying on stale training data or doc-CLI shims. Move from Michael Arnaldi's "Vibe Engineering Effect Apps" — agents are post-trained on reading code, not prose, so feed them code.
The result: a dumb directory the agent treats as "more of my codebase". Distilling what's relevant into project-local patterns/*.md is a separate, on-demand step.
patterns/*.md. That's a per-topic follow-up the user invokes explicitly so they self-select which subset of the library the project actually uses.$clone-repo <url> [name] [branch]
<url> — required. Any clone URL (https or ssh).[name] — optional. Directory under repos/. Defaults to the URL's basename without .git.[branch] — optional. Defaults to the remote's HEAD branch (queried via git ls-remote --symref).If the user just gives a URL, infer name and branch.
Run all of these. If any fails, stop and tell the user exactly what to fix — do not try to fix it for them.
git rev-parse --is-inside-work-tree # must print "true"
git rev-parse HEAD >/dev/null 2>&1 # must succeed — subtree needs ≥1 commit
test -z "$(git status --porcelain)" # working tree must be clean
test ! -e repos/<name> # destination must not exist
Each failure has a concrete remedy to relay:
git init && git commit --allow-empty -m "init"git commit --allow-empty -m "init"repos/<name> exists → either pick a different [name], or run the update command (see Updates)git ls-remote --symref <url> HEAD | awk '/^ref:/ {sub("refs/heads/", "", $2); print $2; exit}'
If the command fails (private repo, network), ask the user for the branch instead of guessing main.
git subtree add --prefix=repos/<name> <url> <branch> --squash
Creates repos/<name>/ with the library's source at that branch's tip, plus a single squashed commit on the current branch. No history pollution; the SHA is pinned by the squash commit.
Find the agent-instructions file in this order: AGENTS.md, CLAUDE.md, .cursor/rules/agents.md. Whichever exists first, append (do not overwrite) a "Reference repositories" section if one isn't already there, then add a bullet for the new subtree:
## Reference repositories
Source-of-truth code for libraries we depend on. Treat as **read-only reference material** — do not edit files under `repos/`. When asked about a library listed below, explore its source here first instead of guessing or relying on training data.
- `repos/<name>/` — <url> @ <branch> (squashed)
If none of those files exist, create AGENTS.md with that section as the only content.
If an entry for repos/<name> already exists, leave it alone.
One short message to the user:
git log -1 --oneline on the current branch).Explore
repos/<name>/for patterns on how to . Save your findings topatterns/<task>.mdwith concrete file references.
Stop there. Do not write patterns yourself unless asked.
To pull upstream changes later:
git subtree pull --prefix=repos/<name> <url> <branch> --squash
.gitmodules machinery, requires git submodule update --init on every clone, agents often skip the contents.git clone + .gitignore — not reproducible across machines or CI runs; the cloned SHA isn't pinned anywhere.npx claudepluginhub alexanderop/skillsGuides collaborative design exploration before implementation: explores context, asks clarifying questions, proposes approaches, and writes a design doc for user approval.
Creates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.
Resolves in-progress git merge or rebase conflicts by analyzing history, understanding intent, and preserving both changes where possible. Runs automated checks after resolution.