---
name: ai-agent-system-bootstrap
Run the plugin suite as the sole orchestrator. Produce a new Agent Team from current repository evidence, write it directly into the repository, then validate the managed output in place.
Read these files before dispatching a phase:
../../bundle.yaml for the fixed member allowlist and pipeline. The plugin manifest discovers Skills; this file defines suite execution.../../shared/contracts/bootstrap-run.md for run state.../../shared/policies/ownership-and-rebuild.md for ownership, legacy adoption, and rebuild rules.../../shared/traceability/original-behavior-map.md for the non-regression obligations inherited from the supplied original Skill.Use only the four companion Skills declared in bundle.yaml. Keep dispatch centralized here; a phase Skill returns its result to this orchestrator and does not call a sibling.
Resolve <suite-root> from this SKILL.md location before running a suite script. Invoke the resolved absolute script path; do not resolve script paths from the target repository working directory.
The global-Skill restriction generated into a target repository governs that repository's future Agent Team. It does not constrain this explicitly invoked suite from dispatching its declared companion Skills.
Skill selection and thread selection are separate decisions. Execute the phases strictly in pipeline order:
Using a companion Skill alone does not create a SubAgent. No phase may begin before its declared input artifact is complete.
Create a BootstrapRun with an absolute repository root, mode: pending, suite version, unique run ID, explicit user constraints, and explicit exclusions. Inspect resolves ownership before the orchestrator sets the final mode.
Completion criterion: the run identifies one repository, the pending mode state, the exact user request, and no unresolved target-path ambiguity.
Dispatch ai-agent-system-inspect with the run. Require a complete ProjectSnapshot; keep the user's scope immutable while allowing Design to expand or confirm repository evidence with explicit traceability.
Completion criterion: the snapshot covers every source category required by its contract and classifies existing AGENTS.md and .ai ownership. Resolve BootstrapRun.mode exactly once from that classification.
Dispatch ai-agent-system-design with the immutable snapshot, whose request block carries the verbatim user request and constraints. Require one SystemBlueprint that is the sole design input for rendering and semantic validation.
Completion criterion: every responsibility domain, generated Agent, local Skill, workflow, adaptive orchestration rule/policy, managed path, and root routing rule appears in the blueprint with no unresolved writer overlap or overloaded general Agent.
Dispatch ai-agent-system-render with the BootstrapRun and blueprint. Rendering writes the generated .ai tree and the managed block in root AGENTS.md directly under BootstrapRun.repository_root.
Completion criterion: RenderResult accounts for every generated file and reports no write outside the managed repository paths.
Dispatch ai-agent-system-validate with the BootstrapRun, immutable ProjectSnapshot, blueprint, and render result. Validate BootstrapRun.repository_root. Before accepting the report, require its run ID, input snapshot-derived blueprint ID, input render result ID, validated run ID, validated blueprint ID, and candidate digest to match the current run artifacts. Accept passed. Accept passed-with-warnings only when every warning code appears in BootstrapRun.allowed_warning_codes.
Completion criterion: structural and semantic validation both finish and the report contains a final decision.
blocked or failed..ai directory or malformed ownership marker as blocking evidence before Render starts.Return:
AGENTS.md status