Architecture planning

From liza-mas/liza · View interactive version

Architecture planning is an AI agent skill from the GitHub repository liza-mas/liza. Define component boundaries, interfaces, and structural decisions for a change

How to use this skill

Skill file

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

Inputs

Your task provides:

Scope discipline:

relevant codebase areas

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.

  1. Read the assigned goal-spec anchors — the authoritative source for what must be built
  2. Read parent task envelopes and their assigned artifact anchors; follow only declared direct

references needed for an unresolved dependency

  1. Synthesize the assigned obligations and structural scope
  2. Identify:

If conflicts are unresolvable from the spec, surface as Open Questions.

2. Survey

Map the existing architecture before proposing changes.

  1. Explore the codebase: existing components, patterns, boundaries
  2. Identify extension points, constraints, and conventions to follow
  3. Note existing components affected by this change
  4. 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.

  1. Component boundaries — new or modified components, what each is responsible for
  2. Interface contracts — how components communicate; what data crosses boundaries, in what form
  3. Data flow — trace the primary data paths end-to-end
  4. Cross-cutting concerns — error handling, observability, configuration, security
  5. Structural decisions — explicit choices with rationale; logic placed in a resource (e.g.

SQL) commits its proof there

  1. 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.

  1. Identify scopes — natural boundaries from the design
  2. Scope independence — each code-planner should work without waiting for another
  3. Scope completeness — each scope is implementable and testable on its own
  4. Ordering constraints — depends_on only when scope B cannot be implemented without A's output, naming the earliest one that suffices (see False Dependence)
  5. Shared-file audit — overlapping edits to a file or definition need depends_on unless 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:

5. Self-Review

Before submitting:

Fix issues before submitting.

Constraints

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.

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 |

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.