learning-harvest
Learning Harvest manages a living document of experiential patterns discovered during project work, distinct from formal standards. Use it when a workflow session produces insights worth preserving, when starting work that should benefit from prior discoveries, or when the user requests pattern capture or learning review. The skill loads prior learnings to inform current decisions, helps synthesize and propose new patterns for user curation, and supports tightening the collection over time to keep entries actionable and project-specific.
git clone --depth 1 https://github.com/techygarg/lattice /tmp/learning-harvest && cp -r /tmp/learning-harvest/skills/atoms/learning-harvest ~/.claude/skills/learning-harvestSKILL.md
# Learning Harvest ## Purpose Standards define how a team intends to work. Operational learnings capture what the team discovers while doing the work — experiential knowledge that only emerges from practice. This atom helps the user curate a single living document of cross-cutting project patterns. The AI synthesizes and proposes; the user decides what enters. Every entry is user-confirmed. Not a log. Not a report. Not auto-generated. A user-curated collection of experiential patterns. ## Scope Boundary 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. ## Config Resolution 1. Check `.lattice/config.yaml` for `paths.operational_learnings` 2. If found, use that file path 3. If not, use default `.lattice/learnings/operational-learnings.md` **Backward compatibility**: If default path not found but `.lattice/learnings/review-insights.md` exists, suggest migration to the new unified format. If user declines, read legacy file as flat input but do not write to it. ## Document Structure ```markdown # 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` - `context`: type of session (e.g., "design", "implementation", "review", "bug fix", "refactoring"). Not a feature name — learnings are cross-cutting. - Each entry ONE bullet, max 2 lines, scannable in under 10 seconds. ## Load Behavior 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. ## Harvest Behavior Invoked at session end. Composing workflow passes a **session context** (what kind of work happened). **Governing principle:** The atom NEVER writes autonomously. It recommends. The user decides. Prefer omission over speculation. Most sessions will not produce learnings — empty harvest is normal and expected. **Steps**: 1. **Synthesize.** Review session decisions, trade-offs, outcomes. Identify candidates that would help a *different* future session on a *different* feature. 2. **Filter — hard evidence gate.** Each candidate must pass ALL five. If any fails, drop silently. | Filter | Drop if... | |--------|------------| | **Evidence** | No concrete session event produced this — just prior knowledge | | **Cross-cutting** | Only relevant to this feature's specific context | | **Actionable** | Requires this conversation's context to understand | | **Recurrence** | No structural reason it will happen again | | **Confidence** | Below 80% — mere possibility, not grounded insight | No candidates pass? Say so and stop. Do NOT force output. Do NOT lower the bar. 3. **Propose to user.** Present filtered candidates with category and wording. Frame as conversation: > I noticed these cross-cutting patterns that might help future sessions: > 1. [Category] Pattern — takeaway > > Worth capturing? Accept, edit, add your own, or skip entirely. 4. **User decides.** Accept, edit wording, reject some, add their own, or skip all. Do NOT argue for rejected entries. User judgment is final. 5. **Write confirmed entries only.** Dedup against existing entries (update with recurrence note if same pattern exists). Create file/dir if needed. 6. **Assess health.** If document growing dense or entries overlap: suggest Tighten. If pattern recurred 4+ times: suggest promoting to standards. User decides — never auto-prune. ## Tighten Behavior Triggered during Harvest (when bloat detected) or invoked standalone. 1. Read full document. 2. Identify: consolidation opportunities (same pattern, different words), noise (one-off, never recurred), promotion candidates (recurred 4+ times — suggest refiner), stale entries (project has changed). 3. Present proposals to user. Apply only what user confirms. ## Self-Validation Checklist Before writing any entry, verify ALL. If any fails, do not write. 1. **User confirmed** — STOP: Explicit user approval for every entry. No exceptions. 2. **Evidence grounded** — STOP: P
Audit and fix all Lattice documentation, README, docs/, 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. 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'.