/lattice:architecture-refinerfrom lattice
Facilitates a structured conversation to define architecture principles for a repository. Supports clean, hexagonal, modular monolith, or custom styles. Produces a formal architecture document for project setup.
Ships in lattice. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Before anything else, ask the user which architecture style their team uses:
"What architecture style does your team use?
Branching:
./assets/template-clean-arch.md. Output: .lattice/standards/architecture.md. Config key: paths.architecture. No architecture_mode key needed (defaults to clean)../assets/template-generic.md. Output: .lattice/standards/architecture.md. Config key: paths.architecture. Additionally, set architecture_mode: custom in .lattice/config.yaml.The rest of this document describes the clean architecture flow (Option 1). For the generic flow (Options 2–4), read ./assets/template-generic.md and follow its <!-- INTERVIEW GUIDANCE: --> comments. The facilitation approach, conversation style, output assembly, and document quality checks below apply to both flows — substitute the appropriate template, output path, and config key.
For clean architecture (Option 1):
.lattice/standards/architecture.md (or custom path from .lattice/config.yaml → paths.architecture)mode: overlay): A slim document containing only sections that differ from the defaults. The architecture atom reads its embedded clean-architecture defaults first, then applies this document's sections on top. This is the expected common case.mode: override): A comprehensive standalone document that fully replaces the atom's embedded defaults. For teams that want to define clean architecture from scratch.paths.architecture in .lattice/config.yaml./assets/template-clean-arch.md for the full document structure, default content, and interview guidance commentsFor other styles (Options 2–4):
.lattice/standards/architecture.md (or custom path from .lattice/config.yaml → paths.architecture)override — there are no embedded defaults to overlay onto for non-clean-architecture stylespaths.architecture in .lattice/config.yamlarchitecture_mode: custom in .lattice/config.yaml./assets/template-generic.md for the document structure and interview guidance commentsBefore starting the interview, check whether a custom document already exists:
.lattice/config.yaml — check paths.architecture.Look for signals that inform the conversation:
src/ (or equivalent) already have layers? What are they named?Share relevant findings with the user at the start: "I noticed your project already has [X structure]. I'll use that as context."
If the project is new with no code, proceed with pure defaults as the starting point.
The first decision in the conversation. Present the three options:
"How would you like to define your architecture principles?
The defaults cover standard clean architecture well. Option 1 is recommended unless your architecture is fundamentally different."
Map the choice:
mode: overlaymode: overrideThis should be fast. Many sections will be "keep as-is."
This is thorough. Every section gets attention and appears in the output.
Read ./assets/template-clean-arch.md (for clean architecture) or ./assets/template-generic.md (for other styles) and follow the <!-- INTERVIEW GUIDANCE: --> comments for each section. Those comments contain the specific questions to ask, probing questions, and what is customizable vs fixed.
Decisions in early sections affect later sections. When a user changes an early section, flag the dependent sections:
| Decision in | Affects | How |
|---|---|---|
| §1 — Layer names | All sections | Names must be consistent everywhere |
| §1 — Extra layers | §2 (diagram), §3 (per-layer rules) | New layers need dependency placement and rules |
| §3.2 — Service pattern (unified vs CQRS) | §4.1, §4.2 | CQRS uses separate handlers instead of unified service |
| §3.4 — Provider pattern (yes/no) | §4.2, §4.3, §6 | No Provider → reads go through Repository; comparison table and checklist change |
When a dependency is triggered, inform the user: "Since you changed [X], we should also review [Y] — it's affected by that decision."
For each of the 6 default sections:
For each of the 6 default sections:
mode: overlayclean-architecture-defaults.md exactly (the atom matches sections by heading)mode: overrideStrip all <!-- INTERVIEW GUIDANCE: --> comments from the output. The final document is a clean specification.
Determine output path:
.lattice/config.yaml exists and has paths.architecture, use that path..lattice/standards/architecture.md.This is the same for all styles — both clean architecture customizations and other styles write to paths.architecture.
Write the document:
.lattice/standards/ directory (and .lattice/ parent) if it does not exist.Update config:
For clean architecture (Option 1):
.lattice/config.yaml does not exist, create it with:
paths:
architecture: .lattice/standards/architecture.md
.lattice/config.yaml exists but has no paths.architecture, add the key. Preserve all existing content..lattice/config.yaml exists and already has the key, no config change needed.For other styles (Options 2–4):
.lattice/config.yaml does not exist, create it with:
paths:
architecture: .lattice/standards/architecture.md
architecture_mode: custom
.lattice/config.yaml exists, add or update:
paths.architecture pointing to the output patharchitecture_mode: customConfirm to user:
For clean architecture:
"Your architecture document has been written to [PATH] in [overlay|override] mode. The architecture atom will now use it [on top of the clean-architecture defaults | instead of the clean-architecture defaults]."
For other styles:
"Your architecture document has been written to [PATH] with architecture_mode: custom. The architecture atom will use it as your project's sole architecture standard."
Before writing the final document, verify:
defaults.md exactly (for section matching by the atom)<!-- INTERVIEW GUIDANCE: --> comments remainmode: overlay<!-- INTERVIEW GUIDANCE: --> comments remainmode: overridemode: override in frontmatter<!-- INTERVIEW GUIDANCE: --> comments remainarchitecture_mode: custom set.lattice/config.yaml) is correctly updatedWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub techygarg/lattice --plugin lattice27 skills in this plugin
/architectureEnforce architectural rules when generating or modifying code, and validate proposed designs before approval (design mode). Defaults to clean architecture; supports any architecture style via the architecture-refiner. Validates layer responsibilities, dependency direction, and structural constraints using the loaded architecture rules. Use when generating code, reviewing architecture, creating new files, or when the user mentions 'architecture', 'layers', 'structure', 'dependency rules', 'hexagonal architecture', 'ports and adapters', 'modular monolith', or 'onion architecture'. Also use when reviewing generated code for structural compliance./architecture-compassArchitectural thinking partner for an existing repository — scans the codebase, conducts a structured interview, agrees on current architectural state and recommended direction, and produces a shareable insights document. Scoped to one repository, module, or folder. Does not execute transformation — it orients. Use when the user says 'assess my codebase architecture', 'what direction should my codebase go', 'architecture compass', 'understand my architecture', 'audit architecture drift', 'architectural assessment', or 'help me understand what is wrong with my codebase'./bug-fixInvestigate, reproduce, and safely fix a bug with regression protection. Composes context, diagnosis, architecture, code quality, and testing guardrails into a reproduce-first repair workflow. Use when the user says 'fix this bug', 'debug this', 'investigate this failure', 'patch this regression', 'repair this issue', or 'why is this broken'./clean-codeApply clean code principles when generating or modifying implementation code. Enforces function focus, naming clarity, complexity management, error handling, and self-documenting style. Use when the user mentions 'clean code', 'code quality', 'coding guidelines', or 'implementation quality'. Loaded automatically by the code-generating molecules (code-forge, refactor-safely, bug-fix). This skill governs the craft of writing individual code units -- not architecture (see architecture), not security posture (see secure-coding), not test structure (see test-quality), and not refactoring workflows (see refactor-safely)./clean-code-refinerFacilitate a structured conversation to define clean code principles for a repository. Produces a formal clean-code.md document that the clean-code atom will use as its override. Use when setting up coding standards, defining code quality rules, or when the user says 'setup clean code', 'define coding standards', 'code quality principles', 'coding guidelines', or 'help me define my code standards'./code-forgeGenerate implementation code from an approved design blueprint or verbal requirements. Composes context anchoring, architecture, clean code, DDD, security, and test quality into an inside-out implementation workflow. Use when moving from design to code, implementing approved contracts, or when the user says 'implement', 'code this', 'build it', 'forge the code', or 'generate the code'.Other plugins' skills for the same job