architecture-compass
Architectural thinking partner for an existing repository — scans the codebase, conducts a structured interview, agrees on current architectural state and…
Manage the operational learnings lifecycle — load prior learnings to inform current work, harvest new patterns worth preserving, and keep the document tight over time. Provides a protocol for accumulating actionable patterns from practice that complement standards and defaults.
$ npx -y skills add techygarg/lattice --skill learning-harvest --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/learning-harvestContext preview
The summary Claude sees to decide when to auto-load this skill.
Manage the operational learnings lifecycle — load prior learnings to inform current work, harvest new patterns worth preserving, and keep the document tight over time. Provides a protocol for accumulating actionable patterns from practice that complement standards and defaults.
name: learning-harvest description: "Manage the operational learnings lifecycle — load prior learnings to inform current work, harvest new patterns worth preserving, and keep the document tight over time. Provides a protocol for accumulating actionable patterns from practice that complement standards and defaults. Use when a workflow session completes and produced insights worth persisting, when starting a session that should benefit from prior patterns, or when the user says 'harvest learnings', 'what have we learned', 'capture this pattern', 'tighten learnings', 'compress learnings', or 'operational learnings'."
Operational learnings are NOT rules. They are what you learn while applying rules.
| Standards (refiner output, atom defaults) | Operational Learnings (this document) | |---|---| | "Domain layer must not import from infrastructure" | "When adding a new aggregate, we keep forgetting to define the repository interface first — design interface before implementation" | | "Functions should have single responsibility" | "Service classes that start small grow past 500 lines within 3 features — split by command type proactively at ~200 lines" | | "Value objects must validate in constructor" | "Date range VOs without explicit inclusive/exclusive documentation cause boundary bugs every time — document semantics alongside validation" |
**The standard is the rule. The operational learning is what we discovered while applying the rule on this project.**
If an entry reads like a rule that should always be followed, it belongs in a standards document (run the relevant refiner). If it reads like "here's what we keep learning the hard way" or "here's an approach that keeps working for us" — it belongs here.
Patterns that recur frequently may graduate to standards via a refiner. That promotion path is part of the Tighten behavior.
1. Check `.lattice/config.yaml` for `paths.operational_learnings`. 2. If set and the file exists at that path → use it. 3. If set but no file exists there → tell the user which configured path is missing, then use the default `.lattice/learnings/operational-learnings.md`. 4. If not set → use the default `.lattice/learnings/operational-learnings.md`.
**Backward compatibility**: If default path not found, check these legacy paths in order:
If found, offer migration to canonical path and format. If user declines, read as flat input. **STOP: do not write to it.**
# Operational Learnings Experiential patterns from practice. Complements standards (what should be) with experience (what we keep learning). ## Design Patterns <!-- Decomposition, architecture choices, scope decisions that proved good or bad --> ## Implementation Craft <!-- Coding approaches, library gotchas, design-to-reality gaps --> ## Quality Signals <!-- Recurring quality issues that keep appearing despite rules --> ## Reliability <!-- Bug root causes, failure modes, fragile areas, boundary condition gaps --> ## Structural Health <!-- Architectural drift, debt accumulation, coupling issues, migration lessons -->
**Entry format**: `- YYYY-MM-DD [context] Pattern — actionable takeaway`
Invoked at session start. Composing workflow passes a **focus hint** (relevant categories).
1. Resolve file path per Config Resolution. 2. If file not found — "No operational learnings yet." Continue. Non-blocking. 3. If found — surface relevant entries (3-5 most recent from matching categories) as brief context. Treat as soft guidance, not hard constraints.
**Active monitoring**: Once loaded, maintain a **silent harvest queue** throughout the session. When a decision or trade-off passes the cross-cutting test below, add it to the queue. **STOP: do not prompt immediately.**
**Cross-cutting test** — a candidate must pass BOTH before queuing: 1. It names a pattern or approach, not a feature-specific fact. 2. A developer on a completely different feature could apply it without knowing this feature's context.
**STOP: if either fails, skip entirely — do not queue.**
Before queuing, check against entries loaded at session start. If the same pattern already exists — skip.
**When to surface:** Surface the queue as a single batch when EITHER condition is true — not at every level or layer:
**STOP: do not surface at every individual level approval or component completion** — that is over-prompting. Once surfaced, clear the queue. Anything remaining at session end goes to Harvest.
> "I noted [N] potential harvest candidates — worth a quick review?"
**Mid-session interrupt** (rare exception): surface a single pattern immediately, outside the queue, only when it would be impossible to reconstruct by session end — a live debate that resolved unexpectedly, a library gotcha caught mid-implementation. If in doubt, queue instead.
Session-end Harvest is the primary mechanism.
Invoked at session end. Composing workflow passes a **session context** (what kind of work happened).
**Governing principle: STOP: the atom never writes autonomously.** Session-end Harvest is the primary capture event — mid-session prompting is the exception.
**Steps**:
1. **Drain the queue.** Collect all candidates from active monitoring queue plus any new ones surfaced by reviewing session decisions and outcomes. Each candidate must have passed the cross-cutting test (active monitoring) or pass it now.
2. **Propose as a batch.** Present queued candidates t
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,…