Objective
Consolidate approved upstream deliverables into a cohesive architectural plan that downstream
code-planners can implement independently.
Output: a git-tracked architecture document (specs/arch-plan/<goal-slug>/<timestamp>-<task-id>.md) plus
structured output[] entries, one per code-planning scope. Each output entry becomes a
code-planning child task. The code-planner reads its assigned architecture scope and declared
direct references. Write a locally sufficient structural delta; leave behavioral authority at its
source rather than copying it into the architecture document.
Follow the shared Reference-First Authoring contract.
This skill owns scope-local structure, interfaces, data flow, failure handling, and structural
rationale. It references inherited behavior and shared architecture. Map components, interfaces,
and proof obligations to the requirements they serve, separating the minimum mechanism Must scope
needs from optional extensions; check consequential platform assumptions and place each proof at
its stage per [Priority, Commitments and Proof
Stage](../shared/references/reference-first-authoring.md#priority-commitments-and-proof-stage).
A master groups a shared uncertainty and names its specialist owner instead of investigating it
in every child.
The architect bridges what (spec) and how (code plan). Spec says what to build; the architect
says where each piece goes and how pieces connect. Code-planners turn each scope into
implementation steps.
Trigger
- Orchestrator creates an architecture task (§BRAND_NAME_TITLE§ mode)
- User asks to plan architecture for a feature or change (Pairing mode)
- Implementation planning requires structural decisions before code-planning
Inputs
Your task provides:
- A goal spec (
spec_ref) — what must be built - Parent task context — upstream deliverables being consolidated (many-to-one fan-in)
- An output mechanism —
set-task-outputfor each code-planning scope
Scope discipline:
- Upfront: Read assigned goal/parent anchors and their declared direct references; explore
relevant codebase areas
- On demand: Broader exploration only when structural questions require it
- Declare selected source anchors in the strict
Source Referencessection and map every assigned
obligation to a direct-reference ID
Every new architecture plan must contain exactly one strict ## Source References section using
the shared contract's JSON-quoted grammar, a 40-lowercase-hex source revision, non-empty direct
references, and non-empty obligation coverage. Use exact eligible ATX heading text in fragments,
not slugs.
Output Format
Architecture Plan format at the task-specified path.
Protocol
1. Consolidate
Read and synthesize the assigned anchor spans and direct references before making structural decisions.
- Read the assigned goal-spec anchors — the authoritative source for what must be built
- Read parent task envelopes and their assigned artifact anchors; follow only declared direct
references needed for an unresolved dependency
- Synthesize the assigned obligations and structural scope
- Identify:
- Overlaps — parent deliverables that touch the same area
- Gaps — scope in the goal spec not covered by any parent deliverable
- Conflicts — parent deliverables that make incompatible assumptions
If conflicts are unresolvable from the spec, surface as Open Questions.
2. Survey
Map the existing architecture before proposing changes.
- Explore the codebase: existing components, patterns, boundaries
- Identify extension points, constraints, and conventions to follow
- Note existing components affected by this change
- Read the project's decision record where it keeps one — prior decisions bind unless deliberately revisited
Do not over-explore. Enough understanding for sound structural decisions, not a full architecture
review. For deeper analysis of a specific area, use software-architecture-review in
Code Review Supplement mode.
3. Design
Define structural decisions. Each decision must have a rationale.
- Component boundaries — new or modified components, what each is responsible for
- Interface contracts — how components communicate; what data crosses boundaries, in what form
- Data flow — trace the primary data paths end-to-end
- Cross-cutting concerns — error handling, observability, configuration, security
- Structural decisions — explicit choices with rationale; logic placed in a resource (e.g.
SQL) commits its proof there
- Proof topology — honour the goal's proof environment direction and constraints; what only a
human supplies (provisioning, credentials, recordings) is a prerequisite. Per scope or behavior
class, set each proof at the cheapest level that fails on regression (code plans allocate the
tests): a real resource only where behavior lives in or composes across it, logic on fakes kept
true by contract tests, a few end-to-end tests per flow. For each shared or slow proof, record
its isolation (or what serializes it), runtime basis (measured or labelled estimate) and stage
(per task, at gates, or both). Check it against the task's execution envelope (command limit,
admission cap, session timeout, shared slots, concurrent agents); a master architecture also
checks the sum across its scopes. A misfit or missing envelope is an Open Question with its cost.
Provider freeze: Obtain early epic Provider Ask Inventory; reconcile assigned
epics/source obligations and merged consumers. Answer or concretely defer each
interface ID, consumer epic/ref, operations, fields and statuses. Unavailable asks
block affected freeze; unresolved needs are Design prerequisites, not gap notes. Child scope/preserve rules allow
tests, acceptance manifests and repairs; verify existing-source premises
before binding. Inventory strings create no executable dependency edges.
Scope #### CONTRACT owns interface prose; keep allocations/acceptance/executable
metadata outside. Edit only its preexisting unique subsection; freeze complete output
manifest, allocation and approved resolved proofs.
Decision altitude:
| Too low (code-planner territory) | Right level | Too high (spec territory) |
|----------------------------------|-------------|---------------------------|
| "Function X takes param Y: int" | "Component A exposes a query interface that B calls" | "The system should be reliable" |
| "Use a map[string]Task" | "Tasks are indexed by ID for O(1) lookup" | "Store tasks" |
| "Error wraps with fmt.Errorf" | "Errors propagate up with context; no silent swallowing" | "Handle errors" |
If a decision reads like code, it's too low. If it reads like a requirement, it's too high.
4. Decompose
Map the architecture to code-planning scopes. Each scope becomes one code-planner task.
Scopes correspond to domains or sub-domains — not to implementation steps. Sequencing
work within a scope is code-planner territory.
- Identify scopes — natural boundaries from the design
- Scope independence — each code-planner should work without waiting for another
- Scope completeness — each scope is implementable and testable on its own
- Ordering constraints —
depends_ononly when scope B cannot be implemented without A's output, naming the earliest one that suffices (see False Dependence) - Shared-file audit — overlapping edits to a file or definition need
depends_onunless stated to commute (each keeps the other's behavior; no common key, slot, name or position; neither needs the other's initialization or state). An interface contract removes a consumer's wait, not a writer edge.
Decomposition heuristics:
- A scope requiring >5-8 files to understand is probably too broad
- A scope producing <2-3 meaningful changes is too narrow — merge it with a sibling
- If you can't write a falsifiable
done_when, the scope isn't well-bounded - Prefer scopes aligned with existing package/module boundaries
- If two scopes share one domain and differ only in implementation order, they're one scope
- A domain must have independent user-visible purpose from the spec's perspective. Build config, packaging, module stubs, and boilerplate that exist solely to support a feature are part of that feature's scope — not a separate domain. "Scaffolding then implementation" is an implementation-step split disguised as a domain split.
5. Self-Review
Before submitting:
- [ ] Every component boundary has a clear responsibility statement
- [ ] Every interface contract specifies what crosses the boundary
- [ ] Data flow traces cover primary paths — no orphaned components
- [ ] Structural decisions have explicit rationale
- [ ] Decomposition covers the full goal spec scope
- [ ] Scopes map to domains, not implementation steps within a domain
- [ ] Each scope has a falsifiable
done_when - [ ]
depends_oncaptures true ordering constraints only - [ ] Shared-file conflicts identified and resolved
- [ ] Architecture scopes are locally sufficient from their direct references and task envelopes
- [ ] No decisions prescribe implementation detail below interface level
- [ ] Cross-cutting concerns the source names, or composition needs, are addressed for all components
- [ ] Every proof honours the inherited proof environment; each shared or slow one has isolation, runtime basis and stage, and fits the envelope or is an Open Question
- [ ] Every assigned obligation maps to a direct reference whose anchor span contains it
- [ ] Structural decisions do not silently redefine inherited behavior
- [ ] Provider asks, freeze duty, human-owned prerequisites met
Fix issues before submitting.
Constraints
- Do not write code — architecture plan only
- Do not prescribe implementation detail below the interface level
- Do not modify existing specs unless task explicitly scopes an update
- Do not invent requirements beyond the goal spec
- Inherited NFRs are bounds: refine inside them, never tighten them. Challenge a target that looks
overkill for the business context (e.g. HA for a non-critical tool) as an Open Question with its
build and proof cost. A recorded human decision that states that cost is inherited without
reconfirmation.
- Surface contradictions between parent deliverables as Open Questions
- Respect existing architectural patterns unless there is a concrete reason to deviate (document it)
- Where the project keeps a decision record, write to it any structural decision durable enough to
constrain later work — a deviation from an existing pattern, or an ADR candidate named upstream.
Where it keeps none, name the candidate in the plan. Rationale is already required at step 3;
this decides where the decision lives, not whether to justify it.
Anti-Patterns
| Pattern | What goes wrong |
|---------|----------------|
| Architecture Astronautics | Over-abstraction for hypothetical flexibility. If an interface has one implementation and no planned second, it's a cost not an investment. |
| Scope Inflation | Components or interfaces not required by the spec. The plan should be minimal — just enough structure. |
| Interface Speculation | Defining detailed contracts before understanding data flow. Trace data first; interfaces emerge from what needs to cross boundaries. |
| Monolithic Scope | One giant scope spanning unrelated domain boundaries. Decompose when a scope covers multiple domains. |
| Task-Level Decomposition | Splitting within a domain by implementation steps (e.g., "scaffolding" then "logic", or "core" then "wiring"). Build config and stubs that serve one feature are not a separate domain. Implementation sequencing is code-planner territory; the architect decomposes by domain. |
| False Independence | Scopes sharing state, or making non-commuting edits to one file or definition, without depends_on; files that each replace one whole definition still share it. Shared-file audit catches file overlap; also audit for shared-state overlap. |
| False Dependence | Waiting on more than is consumed: a whole-epic barrier; a client waiting on its provider's implementation when the frozen contract plus contract-derived fixtures suffice — then add a verification task that depends on client and provider and that every consumer of the client's behavior depends on (an invented provider stays forbidden); a consumed fixture bundled with a later proof; writers extending one shared definition (migration, dispatcher, registry, test file) in series when an additive seam (each writer adds its own file, function or entry) was not weighed against every expected writer, including later supplements and corrections; commuting edits ordered for file overlap alone. Each edge adds its upstream's full duration to the critical path. |
| Invisible Decisions | Structural choices without rationale. Every boundary should answer "why here?" |
| Cathedral Planning | Pursuing perfect upfront design. Define boundaries and interfaces; implementation detail crystallizes during code-planning. |
| Pattern Imposition | Forcing design patterns onto the problem. Name the problem first; pattern is the solution, not the starting point. |
| Boundary Amnesia | Components without interface contracts. Every boundary needs a contract. |
| Unbudgeted Proof | Proof runtime or shared-resource use never weighed against the envelope; it surfaces at coding as timeouts, budget exceptions and slot contention, settled task by task. |
Integration
| Skill | Relationship |
|-------|-------------|
| software-architecture-review | Complementary. This skill defines; that skill evaluates. |
| detailed-spec-writing | Upstream. Goal spec is the primary input. |
| systemic-thinking | Used by Architecture Reviewer to evaluate the plan. |
Mode-Specific Behavior
Pairing: Present the architecture plan for human review before writing.
§BRAND_NAME_TITLE§: Autonomous within task scope. Plan submitted for review; Architecture Reviewer validates.
| Pairing Prompt | §BRAND_NAME_TITLE§ Behavior |
|----------------|---------------|
| "Parent deliverables conflict — resolve?" | Surface in Open Questions; document both options |
| "NFR unclear or overkill?" | Open Question with its proof cost; never default to the strictest |
| "Scope too broad — split?" | Decompose further; document split rationale |
| "Existing pattern X — follow or deviate?" | State rationale; reviewer evaluates |
| "Cross-cutting concern Y unaddressed" | Address it if the source names it or composition needs it; otherwise Open Question with its cost |