From lattice
Investigates, reproduces, and fixes bugs via reproduce-first workflow with regression tests, context loading, architecture checks, and code quality guardrails.
npx claudepluginhub techygarg/lattice --plugin latticeThis skill uses the workspace's default tool permissions.
Load these skills based on bug scope (see Steps 2 and 5 for when):
Fixes bugs and regressions: investigates root cause with GitHub issues/grep/git, applies minimal changes, adds type-appropriate regression tests, verifies tests, reviews code and tests via gates.
Fixes bugs using stop-the-line protocol, triage sequence for root cause diagnosis, and regression test guards. For defects, debugging, and issue resolution.
Share bugs, ideas, or general feedback.
Load these skills based on bug scope (see Steps 2 and 5 for when):
framework:knowledge-priming -- Load project context (tech stack, architecture, conventions) so fix match real project (always)framework:context-anchoring -- Load existing feature context doc when available, capture root cause + repair decisions for future (always)framework:collaborative-judgment -- Surface meaningful repair trade-offs instead of silent patch choice (always)framework:clean-code -- Keep fix focused, readable, minimal scope (always)framework:test-quality -- Create + validate failing regression test that proves bug exists + fix works (always)framework:architecture -- Validate layer placement, dependency direction, correct repair location (conditional)framework:domain-driven-design -- Validate invariants, aggregate boundaries, domain behavior when bug involves domain logic (conditional)framework:secure-coding -- Validate trust boundaries, input handling, authorization, injection safety when bug touches security-sensitive code (conditional)Start from failure, not proposed fix.
.lattice/learnings/review-insights.md exists, read it. Recurring review patterns often point to likely defect classes.framework:context-anchoring Document Discovery to check for existing context doc for affected feature/module.
End this step, summarize bug one sentence:
"Observed X, expected Y, reproducible via Z."
If can't state bug clearly yet, keep gathering evidence before proposing code changes.
Primary discipline: don't present fix for bug you haven't reproduced.
Reproduce failure using strongest evidence available, this order:
Localize issue before editing:
framework:architecture to identify which architectural layer defect originates inframework:secure-codingframework:domain-driven-designframework:architectureIf multiple plausible root causes remain, use framework:collaborative-judgment to present leading hypotheses + what evidence would distinguish. Don't guess and patch speculatively.
Before writing regression test, state root cause hypothesis explicitly, use framework:collaborative-judgment to surface:
"Bug caused by [X]. When [C holds], correct outcome should be [P]. Confirm this by writing test that red before fix, green after."
If user identifies flaw in hypothesis, revise before writing tests.
End step with explicit bug contract:
C (bug condition): [exact input/state triggering bug] P (fix postcondition): [what correct behavior looks like when C holds] Preserved: [what must remain identical for all inputs outside C]
If can't state all three, keep localizing before writing tests.
Optional persistence check: Now that bug reproduced + localized, decide whether persist investigation:
framework:context-anchoring, use as source of truthPhase A — Bug-Condition Tests (must start RED)
framework:test-quality inlineStopping rule:
framework:clean-code inline, keep seam minimal.Phase B — Preservation Baseline (must stay GREEN)
Separate repair strategy from code change itself.
Before editing, decide:
Default to smallest safe fix restoring correct behavior without architectural backsliding.
Guardrails:
framework:architecture layering rules when choosing repair location — don't patch in outer layer when rule belongs inwardIf multiple valid repair strategies with meaningful trade-offs, present using framework:collaborative-judgment before proceeding.
Always apply:
framework:clean-code -- keep delta focused, readable, easy to reason aboutframework:test-quality -- maintain regression test + any nearby supporting testsConditionally apply based on localized root cause:
framework:architectureframework:domain-driven-designframework:secure-codingAfter implementing fix, before presenting:
Verify repair three levels:
When reporting completion, explicit about verification scope:
If fix narrow + confidence high, say so briefly. If verification partial, say so clearly.
Use framework:context-anchoring Enrich behavior to preserve important parts of repair:
If no context doc exists + fix exposed non-trivial design/domain lesson, suggest creating one.
After fix complete, recommend /review when change:
/review provides independent pass on repair, can capture broader learnings for future work.