--- name: ai-agent-system-design description: Internal design phase for ai-agent-system-bootstrap that converts an evidence-rich ProjectSnapshot and current repository evidence into a complete SystemBlueprint for the smallest complete project Agent Team. Use only when a bootstrap run supplies the snapshot and requests Agent, local Skill, workflow DAG, and adaptive SubAgent orchestration design. --- # AI Agent System Design Convert one accepted `ProjectSnapshot`, including its immutable request block, into one complete `SystemBlueprint`. Remain read-only. Continue reading the target repository whenever the snapshot evidence needs expansion or confirmation; do not treat the snapshot as a ceiling on project understanding. Do not inspect the old generated Agent Team as a design source. This phase is orchestrator-gated. If a complete accepted ProjectSnapshot with run ID, request, ownership classification, and evidence is not supplied, return `blocked` without reading unrelated repository state or writing files. Explicit direct invocation does not bypass this input gate. ## Required suite material Read all of the following before designing: - [`../../shared/contracts/project-snapshot.md`](../../shared/contracts/project-snapshot.md) - [`../../shared/contracts/system-blueprint.md`](../../shared/contracts/system-blueprint.md) - [`../../shared/policies/generated-team-runtime.md`](../../shared/policies/generated-team-runtime.md) - [`../../shared/policies/agent-team-design.md`](../../shared/policies/agent-team-design.md) - [`../../shared/policies/orchestration-scaling.md`](../../shared/policies/orchestration-scaling.md) - [`../../shared/policies/subagent-execution.md`](../../shared/policies/subagent-execution.md) - [`../../shared/policies/default-minimal-system.md`](../../shared/policies/default-minimal-system.md) only when repository evidence cannot support specialization - [`../../shared/schemas/agents-md.md`](../../shared/schemas/agents-md.md) - [`../../shared/schemas/agent-definition.md`](../../shared/schemas/agent-definition.md) - [`../../shared/schemas/skill-definition.md`](../../shared/schemas/skill-definition.md) - [`../../shared/schemas/workflow-definition.md`](../../shared/schemas/workflow-definition.md) - [`../../shared/schemas/orchestration-definition.md`](../../shared/schemas/orchestration-definition.md) ## Design ### 1. Establish design facts Accept only snapshot facts backed by evidence and snapshot assumptions explicitly carried forward. Block on unresolved ownership conflicts or missing facts that would materially change the generated system. Completion criterion: every design input is classified as evidence, approved assumption, or blocker. ### 2. Define the smallest complete Agent and Skill set Evaluate every responsibility domain in `agent-team-design.md`. Create an Agent when it owns a distinct recurring decision, risk, verification method, module boundary, or output. Combine roles only when all of those dimensions align. Create a project-local Skill only for a repeated executable procedure. Choose one default primary implementation Agent; identify supporting Agents before choosing whether any run inline or as SubAgents. Completion criterion: every domain has an evidenced disposition, every Agent and Skill has a distinct responsibility and repository basis, and the anti-collapse audit finds neither an overloaded general Agent nor a count-only role. ### 3. Define workflows and execution Express each lifecycle as a dependency DAG. For every step declare the Agent, local Skill or none, stable prerequisites, execution mode, read scope, write scope, output, verification, and next gate. Apply the selective SubAgent policy. Default to `inline`; assign read-only isolation to independent exploration and review; assign worktree execution only to stable non-overlapping writers. Resolve every write-scope overlap before completing the blueprint. Completion criterion: all workflow dependencies are acyclic, each parallel group is dependency-independent, and each writable path has one owner per phase. ### 4. Scale orchestration and define generated runtime Choose `inline`, `coordinated`, `isolated`, or `parallel` from `orchestration-scaling.md`. Always place the essential execution, handoff, context, single-writer, integration, and fallback rules in the generated runtime. Add only the `.ai/orchestration` policy files justified by the selected level. Scope global-Skill opt-in rules to the generated repository Agent Team. Declare the complete `.ai` directory suite-owned and only the marked root `AGENTS.md` block suite-owned. Completion criterion: the blueprint fully describes all rendered files, explains the orchestration level from project evidence, and contains no implicit ownership or routing rule. ### 5. Return the blueprint Populate every `SystemBlueprint` field, including traceability from generated components to snapshot evidence and the complete managed path set. Do not add or alter warning acceptance; that authority remains in `BootstrapRun.allowed_warning_codes`. Completion criterion: Render can proceed without a new design decision and Validate can independently compare the blueprint with the snapshot and repository evidence.