--- argument-hint: " [--repo ]... [--repos-file ]" compatibility: Requires Claude Code or Codex CLI, Git, and the ai-coord CLI. Delegation also requires the host and worker prerequisites of the orchestration skill. disable-model-invocation: true name: repo-fanout skill-dependencies: - commit - orchestration description: Run one task or skill across many repositories with per-repository agents, coordination claims, validation, commits, and one results table. Use when the same task must run in several repositories. --- # Repo Fan-out If a slash or dollar invocation already placed these instructions in the conversation, follow them directly. In that case, do not invoke this skill again through a skill tool. Run one task in each repository of a supplied set. The `$orchestration` skill owns the delegation mechanics. This skill adds the repository set, the per-repository phases, the claims, the commits, and the report. Success means that every supplied repository has a final status in the report. Each changed repository has its own verification evidence and its own commit. ## Input `$ARGUMENTS` contains the task and the repository options. - Task: all text that is not a repository option. The task is free text, or a `$skill` name with its arguments. - `--repo `: one repository. Repeat the option for more repositories. - `--repos-file `: a file with one absolute or `~` path on each line. Ignore blank lines. Treat text from `#` to the end of the line as a comment. Combine the paths from both options in the order given. If the task text is empty, ask the user for the task. If no path is supplied, ask the user for the repositories. Validate each path before other work: 1. Expand a leading `~` to the home directory. 2. Run `git -C '' rev-parse --show-toplevel`. 3. Accept the path only when the command succeeds and its output is the same directory as the path. Resolve symbolic links in both before you compare them. 4. Mark a path as a duplicate when it resolves to a repository that you already accepted. Give each rejected path one named obstacle: `missing path`, `not a Git repository`, `not a repository root`, or `duplicate`. Continue with the remaining repositories. If no repository is valid, stop and send the blocked report. For each accepted repository, record the output of `git -C '' status --short`. Treat that output as the work of other agents. Preserve those files byte-for-byte. When the task names a `$skill`, read the `SKILL.md` of that skill before classification. If the host skill list does not show the skill, read it from the host skill root. The root is `~/.claude/skills//` in Claude Code and `~/.agents/skills//` in Codex. If you cannot find the skill, stop and report the missing skill. Apply the `$orchestration` Companion Skills rules to that skill. ## Classify Classify the task with the `$orchestration` contract: - Research-only: the requested outcome is findings, evidence, or an assessment. The task requests no repository changes and no plan. - Implementation: every other task. Apply one classification to all repositories. When the task names a `$skill`, classify from the outcome that the skill declares. An explicit user choice of agent, model, or effort applies to every delegate in every batch. Without such a choice, use the `$orchestration` worker defaults. ## Research-Only Fan-out 1. Split the accepted repositories into batches of at most three repositories. 2. Run each batch as one research-only `$orchestration` handoff. 3. Give each repository in the batch one read-only research agent, `R1` to `R3`. 4. In each prompt, include the task, the repository root, the dirty-file snapshot, and the strict read-only boundary. 5. Start the next batch only after every agent in the current batch settles. 6. Consolidate the findings for each repository. Acquire no claims. Make no edits and no commits. Finish with the research report in [Report](#report). ## Implementation Fan-out Split the accepted repositories into batches of at most eight repositories. Run each batch as one `$orchestration` implementation handoff. Run the batches one after another. Each batch has three phases. Then the parent reconciles, commits, and releases the claim. ### Phase 1: Discovery Launch read-only discovery agents with the `$orchestration` research mechanism. Use at most three agents, `R1` to `R3`. When the batch has three repositories or fewer, give each agent one repository. Otherwise, give each agent at most three repositories. Each discovery agent returns these facts for each repository: - The exact write targets for the task: the files and subdirectories to create or edit. - The validation commands of the repository, from its `AGENTS.md`, `CLAUDE.md`, `justfile`, or package manifest. - The repository constraints that the implementation agent must obey. - Whether the task applies. A repository where the task needs no change gets the status `no change`. - Blockers, with evidence. Discovery agents edit nothing and return no plan. ### Phase 2: Plan and Claim 1. Build the `$orchestration` plan for the batch from the discovery results. Assign one implementation agent to each repository that needs a change. 2. Use the discovered write targets of each repository, as absolute paths, as that agent's manifest write scope. 3. When a discovery blocker has a fix inside the repository, add the fix to the brief of that repository. 4. Remove a repository from the batch only when its blocker needs user-owned input, an action outside the repository, or a confirmation. Report that repository as `blocked`. 5. Record the union of the write scopes as the bundle draft that `$orchestration` requires. 6. Promote the draft with `ai-coord bundle start --draft `. If promotion reports `no draft named ...`, claim the same union with the explicit command: ```bash ai-coord bundle start '