/magpie-setup:setup [install|config|adopt|unadopt|update|worktree-init|verify|reconcile|override skill-name|delegate [skill-name]|welcome|uninstall]from magpie-setup
Installs, configures, or adopts Magpie for a repo. Handles setup, verification, drift checks, and uninstallation.
Ships in magpie-setup. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Golden rule — a step the sandbox blocks becomes a vetted operation, never a bypass. This holds for the whole run. When anything you need to do fails on a sandbox restriction (a blocked host or transport, a read-only path, a denied credential or socket):
vetted-op-read, vetted-op,
vetted-op-tracker, vetted-op-git), launched with the literal ~ path.
Publishing a change is covered end to end by vetted-op-git:
git-worktree-add, git-fetch, git-stage, git-commit,
git-push-branch, git-pr-create. Run the checks in the sandbox first
with vetted-op-checks (git-commit refuses what they did not pass),
and never hand those steps to the user as commands to paste./magpie-setup:upstream-fix for it: a
closed-shape vetted operation (fixed argv, validated parameters, destination
from the approved policy, no repository code or configuration steering it,
behind a confirmation) or a documented in-sandbox route. Opening that PR
needs the user's go-ahead, like any other publication.The marketplace install is the default.
One marketplace add, then one plugin install per skill family, and nothing is written to the repo.
Walk-through: install.md → Step M0b, which reads any committed floor first.
Per-agent reference: docs/setup/marketplace.md.
The setup family runs no shared pre-flight, so this skill checks for its first-run welcome guide itself, before any sub-action, silently.
<skill-dir> holds this SKILL.md and carries the checker even before config copies it into its checker_dir.
Append :<skill-dir> only when that directory is outside the project's working tree (a marketplace install's plugin cache);
when this skill runs from inside the repository — the committed .agents/skills/magpie-setup/ bootstrap — leave it off, so the check never imports code the repository ships:
PYTHONPATH="$HOME/.cache/apache-magpie/preflight[:<skill-dir>]" \
magpie-python -P -m setup_preflight.welcome due --skill setup
{"verdict": "ok"}, or the command did not run at all → say nothing and go on to the sub-action.{"verdict": "action", ...} → follow rules.welcome, the same rules a pre-flight welcome finding carries, and run its record command with the PYTHONPATH above.This is the only check: none of the pre-flight's setup, floor or fingerprint findings run here.
| Path | What it sets up | Take it when |
|---|---|---|
marketplace (default) | The agent's own plugin mechanism installs the skills, per machine. Nothing in the repo; updates arrive through the agent's plugin update. | The agent has a plugin / extension mechanism — Claude Code, Codex CLI, VS Code + Copilot, Antigravity, Cursor, microsoft/apm. The normal case. |
marketplace + an adopted floor | The same per-machine install, plus a committed .apache-magpie.lock recording the project's minimum version and plugin set. Contributors are brought up to it by any skill's pre-flight. | The project wants a floor every contributor meets, without pinning anyone to one version. Written by adopt. |
svn-zip / git-tag / git-branch — the pinned snapshot install (fallback) | The gitignored snapshot at <snapshot-dir>, both lock files, gitignored magpie-* symlinks, the overrides scaffold, the post-checkout hook. | Only where a marketplace cannot reach, for one of the reasons Golden rule 10 names. |
local | Committed symlinks into the in-repo skills/ source. No fetch, no snapshot. | The Apache Magpie framework checkout itself (see below). |
A project can have contributors on either path, but one machine takes only one (Golden rule 10).
The pinned-snapshot machinery — what the snapshot is, the fetch methods, symlink naming, the overrides scaffold — is in snapshot-model.md.
A marketplace install needs none of it.
(Pinned-snapshot path only — a marketplace install has no lock files.)
The committed <committed-lock> records what the project pins to; the gitignored <local-lock> records what this machine fetched.
Formats, fields, drift rules, and the source locks of trusted external skill sources: locks.md.
The Sub-actions table maps every invocation to the file it loads; the reference files (locks.md, agents.md, snapshot-model.md, failure-modes.md) are linked where they apply.
Golden rule 1 — never modify the snapshot.
<snapshot-dir> is a gitignored build artefact and read-only to adopters.
Every change an adopter wants goes into .apache-magpie-overrides/, where it is committed and survives the next update.
Neither this skill nor any framework skill reading overrides ever writes to <snapshot-dir>.
Golden rule 5 — .agents/skills/ is canonical; everything
else just relays into it.
Whatever layout the project had before, adopt wires the framework the same way: the canonical magpie-* links live in .agents/skills/, and every other active target (.claude, .github, holdouts) gets per-skill relay symlinks back to them (.claude/skills/magpie-<n> → ../../.agents/skills/magpie-<n>).
The adopter's own non-magpie- skills in those directories are left alone.
See agents.md.
Golden rule 7 — agentic overrides are read at run-time — lookup order and guardrail in overrides.md.
Golden rule 8 — family membership is declared in
frontmatter; two families are always installed, the rest
are opt-in.
Every framework skill declares its family in a family: frontmatter key (e.g. family: repo-health).
The sub-actions read that key from the snapshot to build the adopt/update install choice and to wire each family's symlinks.
Never infer family from the skill-name prefix — families such as repo-health and contributor-growth span several prefixes.
The family vocabulary is validated by skill-and-tool-validator (ALLOWED_FAMILIES) and listed for adopters in README.md → Skill families.
Two families are wired unconditionally on every adopt / update / worktree-init run, without asking: setup (every family: setup skill except the bootstrap setup itself, which is copied per Rule 6) and utilities.
Both are read from frontmatter like any other family — do not keep a list here.
Golden rule 10 — marketplace first; the snapshot install is a
fallback, not the default.
Rules 1–9 govern the pinned-snapshot machinery; this rule decides which path a run takes.
Unless the user passed an explicit method:, install proposes the marketplace install, with the exact commands for the agent in front of it.
It proposes the snapshot only for one of these reasons, named out loud:
svn-zip), not a marketplace clone of the repo;method:local).Never lay the snapshot on top of a working marketplace install "to be safe".
It loads a second copy of every skill, doubling the always-on token cost, and /magpie-<skill> (snapshot) and /magpie-<family>:<skill> (plugin) then resolve to two different versions of the same skill.
Where a repo genuinely needs the pin, the snapshot replaces the marketplace install on that machine — uninstall the plugins first.
Five rules bind only on the pinned-snapshot path — the lock files, drift remediation, .gitignore, copy-versus-symlink, and reloading setup after a self-update (rule 9).
They are in snapshot-model.md with the machinery they govern; a marketplace install is not subject to them.
Golden rule 11 — a missing vetted-ops policy never blocks a setup run.
A repo that has only installed Magpie has no .apache-magpie-overrides/tools/vetted-ops/config.toml; vetted-ops then reads a maintainer's personal copy (<personal layer>/tools/vetted-ops/config.toml), and with neither a vetted-op call fails with no vetted-ops config at ….
During any setup sub-action, report that as n/a in one line and carry on with the remaining steps; never call it a blocker, never stop the run for it, and never write a policy to get past it.
The one sanctioned way to a personal policy is config's personal tool configs step, on the user's explicit yes.
The exemption is this run's only: every other skill still stops when the dispatcher refuses, and a policy that exists but fails to load is a real error here too.
The skill dispatches by the first positional argument:
| Invocation | Loads | Purpose |
|---|---|---|
setup (no args) | install.md | First-time install. Proposes the marketplace install first; falls back to the snapshot only per Golden rule 10, and only that fallback is main-checkout only. Idempotent — on an already-installed repo it behaves like verify. |
setup install | install.md | Same as no-arg — explicit form. Main-checkout only. |
setup install method:marketplace | install.md → Step M0b | The default path, named explicitly. Prints the agent's marketplace add + plugin install commands and writes nothing to the repo. Works in a worktree, and in a repo that has adopted nothing. |
setup install method:svn-zip|git-tag|git-branch | install.md | The pinned snapshot install — the fallback path. Main-checkout only. |
setup config | config.md | Not an install, and not adoption. Configure the installed skills for you, in the personal layer (where it lives). Works on any repo, adopted or not, with nobody's permission. Writes nothing committable and stages nothing. |
setup config <skill> | config.md | The same, narrowed to one skill's required configuration. |
setup config adversarial-review | config.md | Detect the installed model CLIs and configure them as adversarial reviewers. |
setup adopt | adopt.md | Not an install. Commit the repo's recommended default plugin set and scaffold its overrides store, so every contributor arrives with them. Needs an explicit maintainer decision; stages, never commits. Default set is Claude Code only. |
setup update | update.md | Move this install to the new version: refresh the snapshot per <committed-lock>, reconcile overrides, refresh symlinks; on a marketplace install, update the plugins. setup-upgrade runs it as its first step, so "upgrade magpie" goes there, not here. Main-checkout only — worktrees pick it up through the symlink worktree-init installs. |
setup worktree-init | worktree-init.md | Worktree-only. Symlink the worktree's <snapshot-dir> to the main checkout's so both share one framework state. No fetch, no lock files written; idempotent. |
setup verify | verify.md | Read-only health check and drift report. Works in the main checkout and in worktrees. |
setup reconcile | reconcile.md | One-time project-wide sweep: checks anchors and requires_config for every configured or overridden skill, proposes fixes one by one, writes the reconciled: stamp. Any install method. Main-checkout only when the stamp goes to the committed lock (adopted); unrestricted when it goes to the local file. |
setup skill-sources (aka skill-sources add <id>) | skill-sources.md | Fetch, verify, pin and symlink skills from the trusted sources listed in <project-config>/skill-sources.md. Main-checkout only — worktrees share the source snapshots via worktree-init. |
setup override <skill> | overrides.md | Open or scaffold an override file. |
setup delegate [<skill>] | delegates.md | Find the project's own skills that overlap Magpie's and, per match and on the user's yes, write a delegate: block so Magpie runs the project's skill inside its workflow. Magpie's wrapper — confirmation gates, scrubs, the privacy gate — stays around it. |
setup welcome [family] | welcome.md | Alias for the welcome-guide skill: show a welcome guide, or turn one back on after a Dismiss or Don't show again. |
setup uninstall | uninstall.md | Reverse the install: remove the snapshot, the local lock, symlinks, hook, doc sections, and this skill. Leaves .apache-magpie.lock — that is unadopt. Keeps .apache-magpie-overrides/ unless --purge-overrides is passed. Main-checkout only. |
setup unadopt | adopt.md → Unadopt | Remove the committed floor lock .apache-magpie.lock and the .claude/settings.json wiring derived from it. Keeps .apache-magpie-overrides/ unless --purge-overrides is passed. Leaves every install — yours and everyone else's — untouched. |
Main-checkout-only is marked per row above.
Those sub-actions compare git rev-parse --git-dir with --git-common-dir and, in a worktree, refuse and point back at the main checkout.
A marketplace install touches no repo state and runs anywhere.
adopt and update always chain into worktree-init on every linked worktree.
It is a no-op with no worktrees and idempotent where they already look wired, which is how broken symlinks and newly always-on families get repaired — nobody has to re-run anything per worktree.
A missing snapshot with a committed lock turns any sub-action into the recover-snapshot path: re-install per the lock, then continue.
When the first positional argument matches no sub-action in the table above and is not a flag from Inputs (a typo such as updaet, or upgrade, this sub-action's old name), do not guess, and do not fall back to install: follow unknown-subaction.md.
| Flag | Effect |
|---|---|
from:<git-ref> / from:<version> | Install or upgrade from a specific framework ref or version. On install it replaces the prompt; with method:marketplace it pins the marketplace to that tag (/plugin marketplace add apache/magpie@<version>). On update it applies to this run only (update.md → Inputs). |
method:<marketplace|git-branch|git-tag|svn-zip|local> | Pick the install method explicitly. Default on install: marketplace. The others are fallbacks (Golden rule 10). marketplace writes nothing to the repo (install.md → Step M0b). local is framework-checkout only: it self-adopts by linking the in-repo skills/ source instead of fetching a snapshot (install.md → Local self-adoption). |
agents:<list> | Comma-separated agent targets to wire symlinks into (agents.md registry ids). When passed, it replaces the detected set for that run — except universal (.agents/skills/), which is always kept. Defaults on adopt/update: agents.md → Active-target selection. |
skill-families:<list> | Comma-separated opt-in families: what to symlink on the snapshot path, which magpie-<family> plugins to install on the marketplace path. Any opt-in family declared by a family: key in the snapshot. Default on adopt: prompt (install.md Step 5). Default on update: update.md → Inputs. Never accepts the always-on families (setup, utilities); per Golden rule 8 they are wired on every run and cannot be requested or opted out of. |
--purge-overrides | (unadopt and uninstall) Also git rm -r .apache-magpie-overrides/. Default on both: keep. |
--no-overrides | (any framework skill) Skip override lookup for this one invocation and run on framework defaults. Override files on disk are not read, changed, or deleted. The safety baseline (confidentiality, privacy, security) still applies. See One-shot defaults run. |
dry-run | Show what the skill would do without writing anything. |
setup-isolated-setup-install.bubblewrap, socat, claude-code itself): setup-isolated-setup-update.~/.claude-config across machines: setup-shared-config-sync.apache/magpie; the snapshot is read-only.What each sub-action does when the ground is not what it expected, and which cases are recoverable: failure-modes.md.
adopt.md (opens in a new tab)agents.md (opens in a new tab)config.md (opens in a new tab)delegates.md (opens in a new tab)failure-modes.md (opens in a new tab)family-mcp-allows.json (opens in a new tab)install.md (opens in a new tab)local-files/custom-parser.md (opens in a new tab)locks.md (opens in a new tab)overrides.md (opens in a new tab)reconcile.md (opens in a new tab)setup_preflight/__init__.py (opens in a new tab)setup_preflight/__main__.py (opens in a new tab)setup_preflight/attribution.py (opens in a new tab)setup_preflight/claude-settings.asf.fragment.json (opens in a new tab)setup_preflight/cli.py (opens in a new tab)setup_preflight/core.py (opens in a new tab)setup_preflight/delegation.py (opens in a new tab)setup_preflight/discovery.py (opens in a new tab)setup_preflight/families.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
When the user wants Magpie installed, verified, uninstalled, or checked for drift. "Upgrade magpie" goes to `setup-upgrade`, which runs `update` itself when needed. "Configure magpie for me", or a pre-flight asking for project configuration, goes to `config`: gitignored files, nobody's permission needed. "Adopt magpie for this repo" goes to `adopt`: it commits files for every contributor and is not an install. A welcome guide goes to `welcome-guide`.
Three short reads, in order
npx claudepluginhub apache/magpie --plugin magpie-setup12 skills in this plugin
/isolated-setup-doctorProbe the secure-agent setup for restrictions that block legitimate work — SSH agent reachability, port binding, containers, the scratch directory, the signing key, `gh` outside the sandbox, `prek` and `uv` inside it, the global git hook dir. Names the troubleshooting entry and settings fix for each. Read-only./isolated-setup-installWalk an adopter through the first-time install of the secure agent setup (sandbox, approval and clean-environment layers) for Claude Code, Codex, Antigravity, Pi or Goose. Interactive throughout; never runs sudo, edits a shell rc, or overwrites settings on its own./isolated-setup-updateReport drift between the installed secure setup and the framework's current one — checkout, pinned tools, user-scope script copies, denial commands, MCP checkouts. Read-only: it surfaces diffs and the user decides./isolated-setup-verifyCheck the secure agent setup against its checklist and report done, missing or partial for each item, with the evidence — paths, command output, versions. Covers Claude Code, Codex, Antigravity, Pi, Goose and Copilot CLI. Read-only./override-upstreamPromote a local `.apache-magpie-overrides/<skill>.md` into a PR against `apache/magpie`. Once it merges and the adopter upgrades, the override is redundant and the skill offers to remove it./privacy-llmDecide which LLMs this project's skills may send private foundation content to, then prove it. Detects the stack in use, writes <project-config>/privacy-llm.md, and runs the approved-model gate and the PII redactor end to end so the result is demonstrated rather than declared.Other plugins' skills for the same job