---
description: Guided setup — install agent-fleet artifacts into a workspace for a chosen coding agent
---

Invoke the agent-fleet:guided-workspace-setup skill.

Run the guided install for a target workspace. If the user passed a workspace path, use it; otherwise ask for it. Detect the running coding agent and confirm it with the user.

Analyse the workspace. If prior install state is found (`.ai/agent-fleet-setup.md` or a populated agent directory), run the **Doctor preflight** first (Step 5) — scan for broken symlinks and stale persona references, present findings as a table, and apply the fixes the user picks before continuing.

The Skills group draws from **two roots**: fleet-native `skills/` and the vendored upstream import `vendor/agent-skills-upstream/skills/` (see `docs/UPSTREAM-SKILLS.md`). On a name collision the native copy wins — never offer the vendored duplicate as a separate row.

Then present the install menu per the skill's Step 1 interaction contract — drive every decision through `AskUserQuestion`, never a printed table awaiting a free-text reply. Open with the **Express question** (fresh workspace: `Recommended ★` / `Everything` / `Custom — group by group` / `Nothing`; existing: `Keep as-is` / `Apply updates` / `Keep + add recommended ★` / `Custom`) — any answer but `Custom` skips all group screens. On `Custom`, run the **7 groups** (4 shared: Skills, Agent personas, Commands/prompts, References & Hooks; 3 pi-only — a claude-code workspace sees just the 4 shared groups): each opens as a single-select quick screen (`Recommended ★ (n)` / `Everything (m)` / `Customise` / `Skip group`, or the installed-state variants with `Remove some…`), and multi-select drill-ins appear only behind `Customise`, chunked by sub-category (lifecycle phase for Skills, `rw`/`ro` for personas, …) at ≤ 4 options per question. Option titles carry `name ★ [st]` (`ok`/`upd`/`mod`/`cflt`/`gone`/`new`/`—`/`brk`); descriptions carry the purpose plus the state in plain words (`mod` → warn that refreshing overwrites local edits). There is **no pre-checking** — installed state shows as counts on quick screens and words in descriptions; leaving an installed item unselected in a drill-in keeps it as-is. `recommended` adds `★` items on top of what is installed — it never removes; cancel = keep-as-is/skip. `cflt` rows are resolved only by showing the three-way diff and asking per row — never by Express or `Apply updates`. Never offer `setup`, `doctor`, or `guided-workspace-setup` — those are installer-only and live in the source agent-fleet repo.

Removal happens **only** on an explicit `Remove some…` multi-select (empty selection = remove nothing), and it is scoped: the screen lists only items whose name is in the agent-fleet inventory **and** that are recorded in `## install-status` (or are symlinks resolving into the source repo). User-authored skills, custom commands, third-party plugins, and unrelated settings/env keys are left untouched and logged as "Skipped — not owned by agent-fleet".

**No cross-tool substitution.** Each row is offered only when the source file the chosen agent needs already exists — for `pi`, that means `.pi/prompts/<name>.md`, `.pi/extensions/<name>/`, etc. Never fall back to `.claude/commands/` (or another agent's tree) to satisfy a pi prompt request; items missing their per-agent source are filtered out of the menu entirely.

**Personas are generated for non-pi targets.** The personas group lists the full availability roster from `node <source-root>/bin/cli.js transform-persona --list --agent <agent>` (pi-only personas — `bowser`, `orchestrator` — appear only when the agent is `pi`). For `claude-code`/`opencode` the apply step installs personas via `transform-persona --agent <agent> --workspace <workspace> <name…>` — always a generated copy, even in symlink mode — and records the rows with `transformed: true`; status checks diff against the generated output, not the raw canonical source.

**pi harness companions.** When the agent is `pi`, installing/refreshing/removing any harness also refreshes its companions — the `justfile` launch recipes, the `team-up`/`coms-net` scripts, the peer/team YAML, `.pi/damage-control-rules.yaml`, and `.pi/harnesses/package.json`. Refresh the `justfile` from the current source (rewriting only the `agent-fleet:harnesses` managed region so user recipes survive) so retired-harness recipes are pruned and new ones added; a stale `justfile` left after a harness change is the regression this prevents.

**No mid-apply overwrite prompts.** The `mod` description already warns that refreshing overwrites local edits. The user's selection is the consent; the Step 9 confirmation is the single gate. During apply, refresh selected items unconditionally — never pause to ask "should I overwrite this file?". Genuine errors (permission denied, missing source) still stop and report.

Offer override sections for the workspace's `.ai/agent-fleet-overrides.md` based on the analysis (print each draft, then `Accept` / `Edit` / `Skip` per section), and record what was installed in `.ai/agent-fleet-setup.md`. Print the plan as compact action-grouped lines (Add / Refresh / Remove / Keep-count / Records / Method), then confirm with one question whose options are `Apply — and remove the installer commands` (default) / `Apply — keep the installer commands` / `Adjust picks` / `Cancel` — write nothing until an Apply is chosen. Then perform the setup, re-scan for any new breakage, and report what changed.
