$npx -y skills add techygarg/lattice --skill architectureEnforce architectural rules when generating or modifying code. 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
| 1 | # Architecture |
| 2 | |
| 3 | ## Config Resolution |
| 4 | |
| 5 | **Step 1 — Determine mode:** |
| 6 | |
| 7 | 1. Read `.lattice/config.yaml` in repo root |
| 8 | 2. Check `architecture_mode` key |
| 9 | - If `architecture_mode: custom` → **custom mode** |
| 10 | - If absent, or other value → **clean architecture mode** (default) |
| 11 | |
| 12 | **Step 2 — Load enforce rule:** |
| 13 | |
| 14 | - **Clean architecture mode** → Read `./references/clean-architecture.md` for enforce instruction (Self-Validation Checklist, Anti-Pattern Scan, Ambiguity Signals, structural principles) |
| 15 | - **Custom mode** → Read `./references/custom-architecture.md` for enforce instruction |
| 16 | |
| 17 | **Step 3 — Load architecture content:** |
| 18 | |
| 19 | - **Clean architecture mode:** |
| 20 | 1. Check `paths.architecture` in `.lattice/config.yaml` for custom doc |
| 21 | 2. If found, read doc and check YAML frontmatter for `mode`: |
| 22 | - **`mode: overlay`**: Read `./references/clean-architecture-defaults.md` first, then apply custom doc section on top. Section match by heading — custom section replace matching default, new section append. |
| 23 | - **`mode: override`**: Custom doc take full precedence. Must be comprehensive. |
| 24 | 3. If no custom doc → read `./references/clean-architecture-defaults.md` |
| 25 | |
| 26 | - **Custom mode:** |
| 27 | 1. Check `paths.architecture` in `.lattice/config.yaml` for team architecture doc |
| 28 | 2. If found → read it. Sole reference — no default. |
| 29 | 3. If not found → surface: "No architecture document found. Run `/architecture-refiner` and select your architecture style to define your team's standards." |
| 30 | |
| 31 | **Step 4 — Language adaptation:** |
| 32 | |
| 33 | If `paths.language_idioms` exist in config, read **"Dependency Management"** section and adapt dependency direction enforcement to language idioms (e.g., Go interface-at-consumer, Java DI containers, Rust trait bounds). Language idioms take precedence over pseudocode defaults. |
| 34 | |
| 35 | ## Enforcement |
| 36 | |
| 37 | STOP after generate each component. Read **Self-Validation Checklist** and **Anti-Pattern Scan** from loaded enforce rule (clean-architecture.md or custom-architecture.md) and apply. |
| 38 | |
| 39 | **Project-specific checks:** If architecture content doc (loaded in Step 3) contains a **Validation Checklist** section (§6), apply those checks as additional project-specific validation after the enforce rule checklist. |