agentleFS
urvijain02urvijain02/claude-autopilot/skills/provision-repo/SKILL.md

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.

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
  1. Distinctive:

    When connected repos are identified, for each one:

    line 26
  2. Distinctive:

    Never invent a remote. Ask when unsure — a wrong repo wastes the run.

    line 36
  3. Very specific:

    All repos for a ticket share one workspace and one central $STATE.

    line 42

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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)

  1. Ask the user for the repo link for this ticket — an owner/repo slug or a git URL. Do not guess; there's no map to fall back on.
  2. Determine the base branch: config.default_base_branch (default main) unless the user specifies otherwise.
  3. Clone and capture the path:
    REPO="$(${CLAUDE_PLUGIN_ROOT}/bin/provision-repo.sh <TICKET> --remote <owner/repo> --base <base>)"
    The final stdout line is the workspace path (…/work/<TICKET>/repos/<name>). Idempotent; --fresh forces re-clone.
  4. Detect the stack: ${CLAUDE_PLUGIN_ROOT}/bin/detect-stack.sh "$REPO".
  5. Record it in state.json.repos[] with role: "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 gh within config.orgs to find a matching repo and confirm with the user; if still unresolved, ask the user for the link. (If config.auto_expand_connected is 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[] with role: "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 plain git, so GitHub and Bitbucket both work. A bare owner/repo is resolved against GitHub only — config.orgs and the gh search 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.