provision-repo
Skill0 starsChanged 26 days agoMITView on GitHub
Obtain working copies for a ticket by cloning remotes into an ephemeral, ticket-scoped, multi-repo workspace. The user provides the primary repo link at run time; connected repos found during analysis are added the same way. Used by the autopilot orchestrator.
In this repository9 other files it gives its agents.
- engageSkill
- gate-runnerSkill
- preflightSkill
- pr-formatSkill
- reportingSkill
- review-rubricSkill
- state-protocolSkill
- tdd-procedureSkill
- ticket-updatesSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
When connected repos are identified, for each one:
- Distinctive: line 36
Never invent a remote. Ask when unsure — a wrong repo wastes the run.
- Very specific: line 42
All repos for a ticket share one workspace and one central $STATE.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Provision repo
There is no ticket→repo map — a Jira project can span many repos. You get the primary repo from the user, and grow the set as analysis reveals dependencies. The workspace is multi-repo: ~/.claude/autopilot/work/<TICKET>/repos/<name>/, one clone per repo, all disposable.
Primary repo (at setup)
- Ask the user for the repo link for this ticket — an
owner/reposlug or a git URL. Do not guess; there's no map to fall back on. - Determine the base branch:
config.default_base_branch(defaultmain) unless the user specifies otherwise. - Clone and capture the path:
The final stdout line is the workspace path (REPO="$(${CLAUDE_PLUGIN_ROOT}/bin/provision-repo.sh <TICKET> --remote <owner/repo> --base <base>)"…/work/<TICKET>/repos/<name>). Idempotent;--freshforces re-clone. - Detect the stack:
${CLAUDE_PLUGIN_ROOT}/bin/detect-stack.sh "$REPO". - Record it in
state.json.repos[]withrole: "primary"(name, remote, path, branch_base, stack) — see state-protocol.
Connected repos (during the run)
The requirements-analyst investigates the primary repo and lists any connected repos the change needs (a service it calls, a shared package/client, a consumer of a changed contract) in requirements.md → "Connected repos", each with why and a best-guess remote or "unknown".
When connected repos are identified, for each one:
- Resolve the remote: use the analyst's suggestion; if unknown, try
ghwithinconfig.orgsto find a matching repo and confirm with the user; if still unresolved, ask the user for the link. (Ifconfig.auto_expand_connectedis true, provision resolved ones without asking; always ask when a link can't be resolved.) - Provision it into the same ticket workspace:
${CLAUDE_PLUGIN_ROOT}/bin/provision-repo.sh <TICKET> --remote <owner/repo> --name <name> --base <base> - Append it to
state.json.repos[]withrole: "connected".
Rules
- Never invent a remote. Ask when unsure — a wrong repo wastes the run.
- Config holds no repo paths or maps — only defaults and optional org hints.
Remote form matters. A full URL or
git@remote is cloned with plaingit, so GitHub and Bitbucket both work. A bareowner/repois resolved against GitHub only —config.orgsand theghsearch that suggests connected repos are GitHub-shaped. For a Bitbucket repo, pass the full URL (https://bitbucket.org/<workspace>/<repo>.git); the script says so if a bare slug fails.
One name, three uses. provision-repo.sh prints the workspace path as its last stdout line. Record state.json.repos[].name as the basename of that path — never a tidier name of your own. That single string is the workspace directory, the <label> you pass to every gate, and the $STATE/gates/<label>/ directory. Invent a different one and gate verdicts are written under one name while provisioning clears another, so a re-provisioned clone silently keeps a stale pass.
- All repos for a ticket share one workspace and one central
$STATE; every repo gets its own branch, gates (namespaced by--label <name>), and PR.
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.

