refiners-update
Update existing Lattice standards after a significant change — the update-mode counterpart to lattice-init. Scans .lattice/standards/, asks what changed, and routes each affected standard to its refiner's revise mode, recording a git-native change note. Use when the user says 'update refiners', 'refiners update', 'our standards changed', 'update our standards', 'the architecture changed, update the standards', 'we switched languages, update the standards', 'revise standards after a big change', or 're-run the refiners'.
git clone --depth 1 https://github.com/techygarg/lattice /tmp/refiners-update && cp -r /tmp/refiners-update/skills/molecules/refiners-update ~/.claude/skills/refiners-updateSKILL.md
# Refiners Update
The update-mode counterpart to `lattice-init`. Where `lattice-init` detects *missing* standards and routes you to refiners to **create** them, this molecule detects *existing* standards and routes you to each refiner's **revise** mode to update them after a significant change — then records what changed and why.
It orchestrates the refiners; it never reimplements their interviews. Versioning is git-native: history lives in commits, and each revised document gets a one-line change note. No version numbers are introduced.
## Required Skills
Read, apply:
1. `framework:knowledge-priming` -- Load project context. Understand what the project is and how the code has drifted from the current standards (always).
## What This Does (and does not)
- **Does**: coordinate revising one or more *existing* standards documents after a change, and append a change note to each.
- **Does not**: create standards that do not exist yet (that is `lattice-init` + the relevant refiner), reimplement any refiner's interview, or introduce version numbers.
If the change requires a standard that does not exist yet (e.g. the team just adopted DDD but there is no `ddd-principles.md`), that is **creation** — direct the user to `/lattice-init` or the relevant refiner to create it, and note it in the summary.
## Refiner → standards document map
| Standards doc (in `.lattice/standards/`) | Refiner to revise it | Config key |
|---|---|---|
| `knowledge-base.md` | `/knowledge-priming-refiner` | `paths.knowledge_base` |
| `language-idioms.md` | `/language-idioms-refiner` | `paths.language_idioms` |
| `architecture.md` | `/architecture-refiner` | `paths.architecture` |
| `ddd-principles.md` | `/ddd-refiner` | `paths.ddd_principles` |
| `clean-code.md` | `/clean-code-refiner` | `paths.clean_code` |
| `review-standards.md` | `/review-refiner` | `paths.review_standards` |
| `requirement-standards.md` | `/requirement-forge-refiner` | `paths.requirement_standards` |
> **Maintainer note:** This table mirrors the refiner inventory. When a refiner is added or removed, update this table (and `lattice-init`'s refiner list). `skill-align` flags inventory drift across docs.
## Workflow
### Step 1: Scan existing standards
Read `.lattice/config.yaml`. For each row in the map above, resolve the path (use the config key's value if set, otherwise the default `.lattice/standards/{file}`) and check whether the document exists. For each existing document, read its footer to note the current `mode` (overlay/override) and any prior "Last updated" line.
Present the result:
```
## Current Standards
- knowledge-base.md: [exists (overlay, last updated 2026-05-02) / not found]
- language-idioms.md: [exists / not found]
- architecture.md: [exists / not found]
- ddd-principles.md: [exists / not found]
- clean-code.md: [exists / not found]
- review-standards.md: [exists / not found]
- requirement-standards.md: [exists / not found]
```
**STOP: If no `.lattice/config.yaml` exists, or no standards documents are found:** there is nothing to update. Tell the user: "No existing standards found. Run `/lattice-init` to create them first." Do not proceed.
### Step 2: Capture what changed
Ask the user what changed and why — in one or two sentences. This is the trigger. It becomes the change note recorded on each revised document and drives which standards are affected.
If the answer describes more than one distinct change (e.g. an architecture shift *and* a language switch together), capture each as its own short reason instead of one merged sentence. Each affected standard's change note (Step 4) must carry only the reason(s) that actually apply to it — a doc should never be stamped with a reason for a change that did not touch it.
Prompt with the common change types if the user is unsure:
- Architecture shift (new layer, moved to CQRS, dropped a pattern)
- Language or framework change
- New or revised domain rules (aggregates, invariants)
- New review or quality policy
- Project identity / stack / directory layout change
- A learning that should become a standing rule
### Step 3: Map the change to affected standards
From the trigger, propose which existing standards are likely affected and why. Present the proposed set with reasoning; do not silently decide the scope.
| Change type | Likely-affected standards |
|---|---|
| Architecture shift | `architecture.md`; `review-standards.md` if it gates on architecture rules |
| Language / framework change | `language-idioms.md`; `clean-code.md` if limits are language-specific |
| Domain rules | `ddd-principles.md`; `architecture.md` if the domain layer's placement changed |
| Review / quality policy | `review-standards.md`; `clean-code.md` |
| Project identity / stack / layout | `knowledge-base.md` |
| Requirement / spec policy | `requirement-standards.md` |
| A learning promoted to a standing rule | whichever standard the rule belongs to — `clean-code.md`, `review-standards.md`, or `architecture.md` |
Ask the user to confirm or adjust the set before proceeding. Only documents that actually exist (from Step 1) are eligible — for anything that should change but does not exist yet, follow the creation note above.
If Step 2 captured more than one distinct change, tag each affected standard with which of those change(s) justifies its inclusion — a doc can be justified by more than one. Carry this doc-to-reason tagging into Step 4; it determines what each doc's change note says.
### Step 4: Revise each affected standard
**Execution model:** You — the AI running this molecule — drive each revision yourself: load and apply the refiner skill's revise flow as part of this molecule's execution, then return here to append the change note before moving to the next standard. Do not hand control back to the user and end your turn between revising and noting — the change note is this molecule's responsibility and must be written while you still hold control. (Audit and fix all Lattice documentation, README, docs/, PROJECT.md, GitHub issue templates, and CLAUDE.md to ensure they are fully aligned with the current skill inventory. Documentation drift is the most common source of user confusion in Lattice — a skill exists in the codebase but not in the docs, or a renamed skill leaves a stale reference in the bug report template. If you've made any change to skills/ and haven't run this, run it now. Use when the user says 'align docs', 'audit docs', 'update documentation', 'skill align', 'check docs are in sync', 'audit skill inventory', 'ensure docs are aligned', 'are the docs up to date', or 'what needs updating'. Standalone — does not call other skills.
Create a new Lattice skill — atom, molecule, or refiner — following all framework conventions. Writing skill files manually almost always produces convention violations: wrong section order, missing confirmation gates, defaults.md without the right structure. This skill knows all of that and guides you through it. Use whenever adding any new atom, molecule, or refiner to Lattice, or when the user says 'create a new skill', 'add an atom', 'add a molecule', 'add a refiner', 'build X for Lattice', 'new lattice skill', or 'skill forge'. Does not validate, align docs, or deploy — those are separate skills you run after.
Deep behavioral audit of a Lattice skill — proposes 3 review personas relevant to the skill, runs independent scenario analysis from each persona's perspective, then merges only the high-confidence, practical findings into a severity-ordered gap report with proposed fixes. Structural validation (conventions, cross-references) is skill-validate's job — this skill finds gaps that would realistically surface when someone actually uses the skill: missing scenario handling, ambiguous instructions, silent failure cases, and behavioral inconsistencies. Filters out theoretical edge cases, low-likelihood speculation, and findings owned by other skills. Use after writing or significantly changing any skill, or when the user says 'review this skill', 'deep review', 'does this skill work', 'find gaps in this skill', 'stress test this skill', 'review from different angles', or 'skill review'. Standalone — does not call other skills.
Validate any Lattice SKILL.md against all tier conventions — atoms, molecules, and refiners. Catches structural errors, broken cross-references, and convention violations before they reach the repo. If you just wrote or modified a Lattice skill file and haven't run this yet, run it now — manual review consistently misses the same categories of errors this skill is specifically designed to catch. Use when the user says 'validate this skill', 'check this skill', 'does this follow conventions', 'review this skill file', 'check my SKILL.md', or 'skill validate'. Reports PASS/FAIL with specific file-and-section findings and actionable fixes. Standalone — does not call other skills.
Architectural 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'.
Facilitate a structured conversation to define architecture principles for a repository. Supports multiple architecture styles: clean architecture (default), hexagonal / ports & adapters, modular monolith, or custom. Produces a formal architecture document that the corresponding atom will use. Use when setting up a new project, defining architecture standards, or when the user says 'setup architecture', 'define layers', 'architecture principles', 'help me define my architecture', 'hexagonal architecture', 'modular monolith', 'ports and adapters', or 'define my architecture style'.
Enforce 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.
Investigate, 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'.