architecture-compass
Architectural thinking partner for an existing repository — scans the codebase, conducts a structured interview, agrees on current architectural state and…
Guide structured design thinking through 5 progressive levels before any code is written. Levels: Capabilities, Components, Interactions, Contracts, Implementation. Use when building new features, refactoring significant code, designing modules, or when the user says 'design
$ npx -y skills add techygarg/lattice --skill design-first --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/design-firstContext preview
The summary Claude sees to decide when to auto-load this skill.
Guide structured design thinking through 5 progressive levels before any code is written. Levels: Capabilities, Components, Interactions, Contracts, Implementation. Use when building new features, refactoring significant code, designing modules, or when the user says 'design
name: design-first description: "Guide structured design thinking through 5 progressive levels before any code is written. Levels: Capabilities, Components, Interactions, Contracts, Implementation. Use when building new features, refactoring significant code, designing modules, or when the user says 'design this', 'architect this', 'let's think before coding', 'walk me through the design', or 'whiteboard this'. For simple utilities enter at Level 4 (Contracts), for single-component tasks at Level 2 — see Complexity Calibration. Do not use for quick bug patches."
**Purpose**: Confirm scope. Surface the user-facing outcomes the system must deliver. Shared vocabulary check — ensure the human and the AI are talking about the same feature with the same boundaries.
**Output format**: Numbered list of user-facing capabilities, max 5. Each capability is a plain-language outcome, not an implementation detail.
**Boundary**: No components, no architecture, no technical detail. If a capability mentions a specific technology, class, or data structure, it belongs at a later level. This level answers only "what does the user get?"
**Checkpoint**: "Does this Level 1 (Capabilities) look correct? Should I proceed to Level 2 (Components)?"
**Purpose**: Identify the building blocks. What major pieces does the system have, and what is each one responsible for?
**Output format**: 3-5 components, each with a single responsibility and a one-line description. Include an ASCII or Mermaid diagram showing how they relate. Note integration points with existing infrastructure.
**Boundary**: No data flow, no sequence of operations, no interaction detail. Describe each component by what it *is* and what it *owns* — not how it communicates with others. If you find yourself writing "A sends X to B", that belongs at Level 3.
**Checkpoint**: "Does this Level 2 (Components) look correct? Should I proceed to Level 3 (Interactions)?"
**Purpose**: Define the data flow between components. How do the building blocks communicate to deliver the capabilities?
**Output format**: A sequence diagram (ASCII or Mermaid) or a numbered flow showing the order of operations. For each interaction, describe WHAT data passes between components. See `./references/methodology-detail.md` for notation guidance.
**Boundary**: No function signatures, no type definitions, no implementation detail. Focus on what passes between components, not how each component processes internally. If you are defining method parameters or return types, that belongs at Level 4.
**Checkpoint**: "Does this Level 3 (Interactions) look correct? Should I proceed to Level 4 (Contracts)?"
**Purpose**: Define the interfaces, method signatures, and type definitions that formalize the interactions. This is the handoff artifact — the specification that implementation is built against.
**Output format**: Typed interfaces, method signatures, type definitions in a language-appropriate format (TypeScript interfaces, Java interfaces, Python protocols, etc.). Use the project's primary language; if ambiguous, ask before writing contracts. No function bodies — signatures and types only. Include error/failure types where interactions can fail. See `./references/methodology-detail.md` for interface definition patterns.
**Boundary**: No implementation logic. If a function body appears, it belongs at Level 5. Contracts reflect the design agreed at Levels 1-3, nothing more — no utility functions, helper methods, or convenience wrappers that are not part of the design. Every Level 3 interaction must map to at least one interface or type; no new interactions may appear here that were not agreed at Level 3.
**Checkpoint**: "Does this Level 4 (Contracts) look correct? Should I proceed to Level 5 (Implementation)?"
**Purpose**: Write code. Implement against the agreed contracts, within the agreed component boundaries, following the agreed interaction patterns.
**Output format**: Working code that fulfills the contracts defined at Level 4, each component implemented within its agreed boundary. The implementation is reviewable against the design: each component checked against its Level 2 description, each interaction against its Level 3 flow, each interface against its Level 4 contract.
**STOP:** Only after Level 4 is explicitly approved. Implementation follows the design; it must not introduce new components, new interactions, or new contracts that were not agreed upon.
**No code until the design is agreed.**
**STOP:** If you catch yourself writing function bodies before Level 5 is approved, return to the current design level and present only the output appropriate to that level.
| Task Complexity | Start At | Example | |---|---|---| | Simple utility | Level 4 (Contracts) | Date formatter, string helper | | Single component | Level 2 (Components) | Validation service, API endpoint | | Multi-component feature | Level 1 (Capabilities) | Notification system, payment flow | | New system integration | Level 1 + deep Level 3 | Third-party API, event pipeline |
Before producing the first level output, state the entry level and rationale:
"Based on [complexity signal], I'll start at Level [N] ([name]). Earlier levels are implicitly agreed — [brief statement of what's assumed]. Want to start here or go broader?"
Wait for confirmation before producing the first level output. If the user disagrees, adjust the entry point.
At the end of each level:
1. Present the level output in the format specified for that level (numbered list, diagram, sequence flow, or interfaces). 2. Self-chec
Composable AI skills that teach assistants structured thinking — design-first, context-aware, and architecture-guided.
Repo: techygarg/lattice
Architectural thinking partner for an existing repository — scans the codebase, conducts a structured interview, agrees on current architectural state and…
Facilitate a structured conversation to define architecture principles for a repository. Supports multiple architecture styles: clean architecture (default),…
Enforce architectural rules when generating or modifying code, and validate proposed designs before approval (design mode). Defaults to clean architecture;…
Investigate, reproduce, and safely fix a bug with regression protection. Composes context, diagnosis, architecture, code quality, and testing guardrails into a…
Facilitate a structured conversation to define clean code principles for a repository. Produces a formal clean-code.md document that the clean-code atom will…
Apply clean code principles when generating or modifying implementation code. Enforces function focus, naming clarity, complexity management, error handling,…