/lattice:bug-fixfrom lattice
Investigates, reproduces, and fixes bugs with regression protection. Composes context, diagnosis, architecture, code quality, and testing into a reproduce-first repair workflow.
Ships in lattice. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Load these skills based on bug scope:
framework:knowledge-priming -- Load project context so the diagnosis grounds in the real codebase. (always)framework:context-anchoring -- Find and load the feature's context doc; capture diagnosis and repair decisions in it. (always)framework:learning-harvest -- Load prior operational learnings at session start; harvest new ones at session end. (always)framework:collaborative-judgment -- Surface hypotheses and repair trade-offs as structured options instead of silently assuming. (always)framework:clean-code -- Keep the fix focused, readable, and free of drive-by changes. (always)framework:test-quality -- Regression tests, characterization baseline, assertion quality. (always)framework:architecture -- Layer placement and dependency direction. (conditional: layer placement is in question — Steps 2/4/5)framework:domain-driven-design -- Domain invariants and aggregate behavior. (conditional: domain invariants involved — Steps 2/5)framework:secure-coding -- Trust bounds and sensitive data handling. (conditional: trust boundary crossed — Steps 2/5)STOP: Before Step 1, read additional_instructions.bug_fix (one line or a list) from .lattice/config.yaml. No file or no key → skip silently.
When lines are found:
Start from the failure, not from a proposed fix.
framework:learning-harvest Load behavior. Focus hint: "bug investigation — focus: reliability, quality signals".framework:context-anchoring Document Discovery to check for an existing context doc covering the affected feature/module:
End the step by summarizing the bug in one sentence:
"Observed X, expected Y, reproducible via Z."
STOP: If you cannot yet state the bug that clearly, gather more evidence before proposing any code changes.
Primary discipline: never present a fix for a bug you have not reproduced.
Reproduce the failure using the strongest evidence available, in this order:
Localize the issue before editing:
framework:architecture to identify which architectural layer the defect originates in.framework:secure-coding applies to the fix (Step 5).framework:domain-driven-design applies to the fix (Step 5).framework:architecture applies to the fix (Steps 4–5).If multiple plausible root causes remain, use framework:collaborative-judgment to present the leading hypotheses and what evidence would distinguish them.
Before writing any regression test, state the root-cause hypothesis explicitly via framework:collaborative-judgment:
"The bug is caused by [X]. When [C holds], the correct outcome should be [P]. We confirm this by writing a test that is red before the fix and green after."
If the user identifies a flaw in the hypothesis, revise it before writing tests.
End the step with an explicit bug contract:
C (bug condition): [exact input/state triggering the bug] P (fix postcondition): [what correct behavior looks like when C holds] Preserved: [what must remain identical for all inputs outside C]
STOP: If you cannot state all three, keep localizing before writing tests.
Persistence check — now that the bug is reproduced and localized, decide whether to persist the investigation:
framework:context-anchoring, then use it as the source of truth.Phase A — Bug-Condition Tests (must start RED)
framework:test-quality inline while writing it.Stopping rule:
framework:clean-code inline and keep the seam minimal.Phase B — Preservation Baseline (must stay GREEN)
Separate the repair strategy from the code change itself.
Before editing, decide:
Default to the smallest safe fix that restores correct behavior without architectural backsliding.
Guardrails:
framework:architecture layering rules when choosing the repair location — do not patch in an outer layer when the rule belongs inward./design-blueprint.Multiple valid repair strategies exist with meaningful trade-offs → present them using framework:collaborative-judgment before proceeding.
Always apply:
framework:clean-code -- keep the delta focused, readable, and easy to reason about.framework:test-quality -- maintain the regression test and any nearby supporting tests.Conditionally apply, based on the localized root cause:
framework:architecture.framework:domain-driven-design.framework:secure-coding.After implementing the fix, before presenting:
Verify the repair on three levels:
When reporting completion, be explicit about the verification scope:
If the fix is narrow and confidence is high, say so briefly. If verification is partial, say so clearly.
If a context doc is active (persistence accepted in Step 2), use framework:context-anchoring Enrich to preserve the important parts of the repair. In non-persistent mode, skip to the harvest below:
No context doc exists and the fix exposed a non-trivial design or domain lesson → suggest creating one so the lesson survives the session.
Harvest learnings: run framework:learning-harvest Harvest behavior. Session context: "bug investigation — root cause diagnosis and repair". Synthesize and propose cross-cutting patterns from this session — root-cause categories, failure modes likely to recur elsewhere, boundary-condition gaps. The user confirms what enters the document. STOP: run this before recommending /review below.
After the fix is complete, recommend /review when the change:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub techygarg/lattice --plugin lattice27 skills in this plugin
/architectureEnforce 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./architecture-compassArchitectural 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'.Other plugins' skills for the same job