main-stack-agents-flow
Domain Build - Team-Lead Loop for a Stack's Design, Build, Verify Vertical
You are the team lead for one stack's vertical slice: design, then build, then verify. You detect which stack the work belongs to, dispatch that stack's solution designer to produce an architecture and a decomposition of independent tasks, fan the tasks out to that stack's implementers in parallel, then fan back in with that stack's verifier over the assembled whole - looping any punch-list back to the implementers that own each item until it signs off. Use this whenever a feature or change needs design plus build plus verify inside a single stack. Do not use it for a review-only pass with no build (reach for code-review or the domain verifier alone), for a pipeline of prompt files over an existing target (project-quality-loop), or for work that spans more than one stack (split it first - see Rules).
Execution modes
DELEGATED vs INLINE - the definitions, and why detection keys on dispatch capability, not file presence - is the shared policy project-task-flow owns (its execution-modes reference). Pick the mode once, before DESIGN, hold it for the run. Applied to this vertical: DELEGATED dispatches every domain seat - the designer, each implementer, the verifier - never doing their work itself; INLINE does the same three steps in-session - design, build the tasks in the order the designer would have handed them out, verify against the plan.
Steps
- DESIGN - detect the stack from the work and the touched files. If the feature request is ambiguous or underspecified, clarify it with the user before designing - only the orchestrator can interview, so resolve a vague ask up front (the clarification gate in
project-task-flow) and never fan a designer out against a guessed requirement; a crisply specified request skips straight to design. For a feature or change, dispatch its solution designer (aspnet-solution-designer / angular-solution-designer / wpf-solution-designer / console-solution-designer / mobile-solution-designer / data-solution-designer / devops-solution-designer - see Per-stack seats). The C# stacks split by surface: a web/API host is aspnet, a XAML desktop app is wpf, and a headless Generic-Host worker, bot, daemon, or one-shot CLI (aProgram.cswithHost.CreateApplicationBuilder, aBackgroundService/IHostedService, an<OutputType>Exe</OutputType>project with no web or desktop surface) is console. DevOps work is detected from the touched delivery files - a Dockerfile, a compose file, a .github/workflows pipeline, a deploy script, or the Aspire AppHost. For a reported bug, the plan comes from issue-diagnoser instead - it investigates the root cause and lays out the fix. Either way the output is the same shape: the architecture or the proven root cause, the test strategy, and a decomposition of independent tasks with contracts (each task's boundary and what it hands off or depends on). Gate the returned plan before anything builds: runproject-verify-plan's four audit passes on it in-session (mandatory at fan-out scale; a failed pass is a scoped re-brief to the designer - the policy lives inproject-task-flow). Then get the user's approval - never fan out against an unapproved or unaudited plan. - BUILD (fan-out) - once approved, dispatch one implementer per independent task, all in parallel, from the main session (aspnet-implementer / angular-implementer / ... - the same stack's seat). Fan out every task the designer marked independent, not a token two - the runtime bounds real concurrency, your job is to expose all of it. Hand each implementer exactly one task plus its contract; it never touches anything outside its boundary, which is what keeps the parallel runs collision-free. Dispatch each implementer with the
implementer_modelthe designer stamped on that task card (haiku for the easy tasks, sonnet for the advanced or risk-bearing ones), passed as the per-dispatch model override; the sonnet frontmatter pin is the fallback if a card carries none. Full rule inproject-task-flow's model-routing reference. - VERIFY (fan-in) - once every task lands, dispatch the domain verifier over the assembled whole, not over any single task. If it returns a punch-list, route each item back to the implementer that owns it, resumed with a scoped brief - the failing assertion or check plus the file and symbol to touch, not a fresh full-context re-brief - so the fix round patches the gap without re-navigating the whole task (a full re-dispatch roughly doubles the cell's cost for a one-line fix); then re-dispatch the verifier. The verifier's own independent checks - build, the test suite, the contract-seam probe - are parallelizable; run them concurrently rather than serially where the seat supports it. Loop until the verifier signs off - but bound the loop: cap it at two implementer fix rounds, and if the verifier still fails after that, stop and escalate to the user rather than looping to sign-off forever.