architecture-design
Architecture decides which commitments lock in now and which changes stay cheap later. Its job is the simplest structure that upholds real invariants and workload demands while containing costly change behind crisp boundaries — never extra layers, single-implementation interfaces, or fashionable patterns added for symmetry.
Scale depth and output to the ask: a targeted boundary review needs sharp causal findings without unsolicited refactoring, whereas a new subsystem may require an end-to-end design and a throwaway validation spike.
Anchor on invariants, state authority, and concrete scenarios
Extract the business invariants that must never break, the critical user and data paths, who owns writes and truth for each piece of state, and the hard operational constraints. Translate vague quality labels ("scalable", "resilient", "low-latency") into falsifiable scenarios: stimulus, scale or failure mode, and required observable response.
Inspect the live codebase, schemas, deployment topology, and dependencies before proposing structure. Reuse proven stack primitives and platform capabilities first; depart from them only where current capabilities demonstrably fail a driving force, since migration and operational tax are real and theoretical elegance rarely pays them back.
Separate irreversible structural forks (core stack, data ownership, consistency model, external contracts, high-exit-cost vendors) from local reversible implementation details. Resolve local details yourself; bring open structural trade-offs to the user with a clear recommendation before committing dependent code.
Make every boundary and layer pay rent
Draw boundaries around invariant enforcement, single-writer state ownership, independent deployment or change cadence, and failure containment. State each boundary's job in one causal sentence: what invariant it guards, what churn it isolates, or what blast radius it stops.
Audit layers ruthlessly. Pass-through wrappers, generic repositories over an ORM, and interfaces with a single foreseeable implementation add indirection without isolating anything — collapse them unless they protect a real ownership, testing, or compatibility seam. Split modules only when domain policy, infrastructure mechanics, and transport contracts repeatedly collide. Treat patterns (microservices, event buses, CQRS, plugin registries, hexagonal layers) as high-interest debt justified only when present forces pay their coordination, debugging, and consistency cost.