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'.
npx skills add https://github.com/techygarg/lattice --skill bug-fix
Load these skills based on bug scope (see Steps 2 and 5 for when):
framework:knowledge-priming -- (always)framework:context-anchoring -- (always)framework:learning-harvest -- (always)framework:collaborative-judgment -- (always)framework:clean-code -- (always)framework:test-quality -- (always)framework:architecture -- (conditional)framework:domain-driven-design -- (conditional)framework:secure-coding -- (conditional)Start from failure, not proposed fix.
framework:learning-harvest Load behavior. Focus hint: "bug investigation — focus: reliability, quality signals".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."
STOP: If can't state bug clearly yet, gather more 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.
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]
STOP: 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.
Harvest learnings. Use 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. User confirms what enters the document. STOP: run this before recommending /review below.
After fix complete, recommend /review when change:
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup
Use when implementing any feature or bugfix, before writing implementation code
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
Expert guidance for systematic backtesting of trading strategies. Use when developing, testing, stress-testing, or validating quantitative trading strategies. Covers "beating ideas to death" methodology, parameter robustness testing, slippage modeling, bias prevention, and interpreting backtest results. Applicable when user asks about backtesting, strategy validation, robustness testing, avoiding overfitting, or systematic trading development.
Cloud laboratory platform for automated protein testing and validation. Use when designing proteins and needing experimental validation including binding assays, expression testing, thermostability measurements, enzyme activity assays, or protein sequence optimization. Also use for submitting experiments via API, tracking experiment status, downloading results, optimizing protein sequences for better expression using computational tools (NetSolP, SoluProt, SolubleMPNN, ESM), or managing protein design workflows with wet-lab validation.
This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.
Take techygarg/bug-fix from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.