Skip to main content

Configuration Reference

.lattice/config.yaml is the central config file for a Lattice-enabled project. It maps logical keys to project-specific documents that atoms and molecules load at runtime. The file is optional — all skills work out of the box with embedded defaults. Add keys only when you want to customize a skill's behavior. See how-it-works.md for how the resolution algorithm works.

File Structure​

version: 1
language: go
paths:
language_idioms: .lattice/standards/language-idioms.md
knowledge_base: .lattice/standards/knowledge-base.md
clean_code: .lattice/standards/clean-code.md
architecture: .lattice/standards/architecture.md
ddd_principles: .lattice/standards/ddd-principles.md
test_quality: .lattice/standards/test-quality.md
secure_coding: .lattice/standards/secure-coding.md
review_standards: .lattice/standards/review-standards.md
requirement_standards: .lattice/standards/requirement-standards.md
context_base: .lattice/context/
operational_learnings: .lattice/learnings/operational-learnings.md

architecture_mode: clean
requirements_layout: sharded

additional_instructions:
design_blueprint:
- Suffix the context doc name with the platform: {feature}-ios or {feature}-android.

Top-level Fields​

FieldTypeDescription
versionintegerSchema version. Currently 1.
languagestringProject's primary language identifier (e.g., go, rust, python, java, typescript, csharp). Set by lattice-init or language-idioms-refiner; informational metadata describing the project. Atoms do not read this key — language adaptation is driven entirely by paths.language_idioms.
pathsmapLogical key → file path mappings. All keys are optional.
architecture_modestringArchitecture enforcement mode. clean (default) or custom. See below.
requirements_layoutstringRequirements folder layout. sharded (current) or flat (legacy, pre-migration). See below.
additional_instructionsmapMolecule key → list of short workflow instructions, applied with highest priority when that molecule runs. See below.

paths Keys​

KeyPurposeProduced byDefault pathConsumed byMode
language_idiomsLanguage-specific patterns — error handling philosophy, type system, naming conventions, testing idioms, parameter design, dependency management. Cross-cutting: consumed by multiple atoms.language-idioms-refiner.lattice/standards/language-idioms.mdclean-code, test-quality, secure-coding, domain-driven-design, architecture atomsstandalone (no overlay/override — always complete)
knowledge_baseProject identity — tech stack, architecture, conventions, trusted sources. No embedded default; every project is unique.knowledge-priming-refiner.lattice/standards/knowledge-base.mdknowledge-priming atomoverride (standard)
clean_codeCode craftsmanship rules — function size, naming, complexity, error handling.clean-code-refiner.lattice/standards/clean-code.mdclean-code atomoverlay (recommended)
architectureArchitecture standards — layer structure, dependency rules, structural validation. Used by both clean architecture mode and custom architecture mode.architecture-refiner.lattice/standards/architecture.mdarchitecture atomoverlay (clean mode) or override (custom mode)
ddd_principlesTactical DDD patterns — aggregate design, entity/value object rules, domain services, domain events.ddd-refiner.lattice/standards/ddd-principles.mddomain-driven-design atomoverlay (recommended)
test_qualityTest structure and quality rules — AAA structure, isolation, assertion patterns, naming conventions.No refiner — write by hand or via /knowledge-priming-refiner for general conventions.lattice/standards/test-quality.mdtest-quality atomoverlay (recommended)
secure_codingTrust boundaries and injection prevention — input validation, secrets management, authorization, error message policies.No refiner — write by hand or via /knowledge-priming-refiner for general conventions.lattice/standards/secure-coding.mdsecure-coding atomoverlay (recommended)
review_standardsReview process configuration — atom loading policy, severity classification, report format, insight capture. Molecule-level config, not atom-level.review-refiner.lattice/standards/review-standards.mdreview moleculeoverlay (recommended)
requirement_standardsRequirement standards — epic/feature definitions, scenario structure, AC format, priority notation, status workflow, and naming conventions. Consumed by the requirement-quality atom via config resolution; the requirement-forge molecule composes that atom.requirement-forge-refiner.lattice/standards/requirement-standards.mdrequirement-quality atomoverlay (recommended)
context_baseDirectory path for per-feature living documents. Unlike all other keys, this is a directory, not a file.(none — managed by context-anchoring atom).lattice/context/context-anchoring atomN/A
operational_learningsOperational learnings file — accumulated patterns from practice (design, implementation, review, repair). Living document managed by learning-harvest atom, not a standards doc.(none — managed by learning-harvest atom).lattice/learnings/operational-learnings.mdlearning-harvest atomN/A (append-only living document, no overlay/override)

Path values: relative paths resolve from the repo root. Absolute paths and ~ work too, including locations outside the repo — your agent host must allow reading and writing there. The requirements folder and the review log have no paths key; to move them, add a line under additional_instructions for the molecule that writes them (recipes in docs/practical-guide.md).

architecture_mode Key​

Controls which enforcement rules the architecture atom loads internally. This key determines the atom's behavior — it does not affect what other atoms or molecules do.

ValueBehavior
clean (default if absent)The architecture atom loads clean architecture enforcement rules (references/clean-architecture.md) and uses references/clean-architecture-defaults.md as the base content. If paths.architecture is set, the custom document is applied as overlay or override on top of the clean-architecture defaults.
customThe architecture atom loads custom architecture enforcement rules (references/custom-architecture.md) and reads the team's document at paths.architecture as the sole content. No embedded defaults — the document IS the standard.

When to use each:

  • Team uses clean architecture (default, no config needed): Atom loads built-in clean-arch rules. No setup required.
  • Team uses clean architecture with customizations: Run /architecture-refiner, choose "Clean Architecture", customize sections. Produces a document with mode: overlay or mode: override. Config: paths.architecture set, architecture_mode absent (defaults to clean).
  • Team uses hexagonal, modular monolith, or custom style: Run /architecture-refiner, choose the appropriate style. Produces a document with mode: override. Config: paths.architecture set, architecture_mode: custom.

The architecture-refiner sets architecture_mode automatically based on the user's style choice.

requirements_layout Key​

Controls whether requirement-forge treats .lattice/requirements/ as sharded-by-epic or expects the legacy flat form.

ValueBehavior
sharded (current)index.md is a thin apex; each epic has its own file at epics/{epic-slug}.md with a generated feature table listing name and summary only — no status, priority, or dependency columns. requirement-forge writes only feature files during normal work — epic and index rollups regenerate only when a feature is added, removed, or renamed under an epic, never on a status/priority/dependency change; those fields live solely in each feature file's own frontmatter.
flat / absent with a pre-existing index.mdLegacy layout — every epic's feature table lives inline in index.md itself. requirement-forge will not attempt migration; it points the user at /lattice-init to check for and apply available upgrades.

Set automatically — by requirement-forge when it creates the first epic in a new project, or by lattice-init's migration step for existing projects. Not intended to be hand-edited.

Requirements do not have to live in this repo at all — see docs/practical-guide.md for teams that keep specs in a separate repo or track requirements in an external system instead.

additional_instructions Key​

A few lines of your own workflow habits for a molecule — what to read first, how to name its output, which extra check to run — loaded only when that molecule runs. One line or a list. Supported keys: requirement_forge, design_blueprint, code_forge, refactor_safely, bug_fix, review, architecture_compass. Setup molecules (lattice-init, refiners-update) do not read it.

additional_instructions:
design_blueprint:
- Suffix the context doc name with the platform: {feature}-ios or {feature}-android.
- Before designing, read the other platform's context doc if it exists.
- In the handoff, name the reviews this design needs: eng review always, design review if it has a UI.
RuleBehavior
Highest priorityThese lines sit on top of every other layer — the molecule's own steps, approval gates, and STOP rules, the atoms it composes, your standards documents, and operational learnings. On conflict, the line wins. A line can add a gate or remove one; that is your call.
VisibleThe molecule shows the loaded lines verbatim at session start, so anyone reading the session can see what changed its behavior.
Molecules onlyAtoms are shared by many molecules; changing one would quietly change all of them. There is no atom-level key; a line can still override an atom's rule, but only inside that molecule's sessions.

Nothing below is enforced — the molecule applies whatever you write. It is advice for keeping the file useful.

Choosing where an instruction goes​

The three places load at different times and serve different purposes. Pick by asking two questions, in order:

  1. Does it need to apply when this molecule is not running? (a plain chat, a quick edit, another molecule) → AGENTS.md / CLAUDE.md. Your agent instruction file loads in every session, cross-cutting. Lattice never reads or replaces it.
  2. Does it shape the artifact or the session? If it changes what the output contains (spec format, ticket ID on every spec, coding or architecture rules) → usually a standards document under .lattice/standards/, via the matching refiner, so every molecule using that atom picks it up; a short rule meant only for this molecule's runs can live here. If it changes how this molecule's session runs (what to read first, how to name the output, which extra check or review to call for) → additional_instructions.{molecule}.
AGENTS.md / CLAUDE.mdadditional_instructions.{molecule}.lattice/standards/*.md
ScopeEvery agent session, cross-cuttingOne molecule's sessions onlyThe atom(s) that read the document, in every molecule that composes them
LoadsAlwaysOnly when that molecule runsWhen the atom runs
HoldsRepo-wide habits: build/test commands, commit and branch rules, tone, "never touch X"Workflow habits for that molecule: inputs to read, output naming, extra checks, handoff stepsDurable rules for what the artifact must look like
SizeWhatever your host toleratesA handful of lines — they load on every runA full document
Example"Run make test before saying done.""Before designing, read the other platform's context doc if it exists.""Every spec carries the Jira ticket ID."

Common mistakes

  • Copying AGENTS.md / CLAUDE.md lines here. If the agent already loads it every session, repeating it costs tokens and creates a second source that drifts.
  • Moving cross-cutting rules here to save tokens. A line under design_blueprint is invisible to every other session — the agent will not follow it during a quick fix or a different molecule.
  • Growing a full rule set here. A few standard lines are fine; once it reads like a standards document, a refiner's document is easier to maintain and shared by every molecule that uses the atom.
  • Same line under several molecules. If it applies to every Lattice workflow and beyond, it belongs in AGENTS.md / CLAUDE.md.

Not hand-edited by any skill — write and maintain it yourself.

Custom Document Frontmatter​

Standards documents (the files pointed to by paths keys) declare their merge mode in YAML frontmatter:

---
mode: overlay
---
ModeBehavior
overlay (default)Custom document's sections are applied on top of the atom's embedded defaults. Sections are matched by heading — a custom section replaces the matching default section; new sections are appended.
overrideCustom document fully replaces the atom's embedded defaults. Use when your standards are fundamentally different and you want complete control.

knowledge_base is always override — project identity is unique and replaces generic defaults entirely. Custom architecture documents (architecture_mode: custom) are also always override — there are no defaults to overlay onto. language_idioms is always standalone — there are no embedded language defaults in atoms; the document provides the complete language context that atoms reference by section heading.

Creating and Updating Config​

Via a refiner (recommended): Run the corresponding refiner skill (e.g., /architecture-refiner). The guided interview produces the standards document and writes the config key automatically.

By hand: Create .lattice/config.yaml at the repo root and add keys pointing to documents you have written or will write. Re-run a refiner or edit the standards document directly whenever your standards evolve.