Agent skill

Bug Fix

by techygarg in techygarg/lattice

Investigate, reproduce, and safely fix a bug with regression protection.

MITAuto-check passedDevelopment

Install Bug Fix

skills CLI
$ npx skills add techygarg/lattice --skill bug-fix -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install techygarg/lattice bug-fix --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/techygarg/lattice.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/bug-fix .claude/skills/bug-fix && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
bug-fix
GitHub stars
198
Token cost
~3k tokens
SKILL.md length
1,609 words
Files
1
Skills in repo
33
Repo updated
First seen
Licence
MIT

At a glance

Investigate, reproduce, and safely fix a bug with regression protection.

  • Works in 7 steps: Establish Bug Context → Reproduce and Localize → Add Regression Protection First → …
  • The user says fix this bug
  • SKILL.md covers Required Skills and Workflow
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Bug Fix is an agent skill from techygarg/lattice. 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'.

Its SKILL.md is about 3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Debugging and Code quality. The repository describes itself as: Install engineering discipline into any AI coding assistant. Composable skills for design, implementation, review, and team standards. Better process, not just better prompts. The licence is MIT.

When your agent uses it

  • The user says fix this bug
  • Investigate this failure
  • Patch this regression
  • Repair this issue

Example prompts

  • “fix this bug”
  • “debug this”
  • “investigate this failure”
  • “/bug-fix”

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Establish Bug Context
  2. Reproduce and Localize
  3. Add Regression Protection First
  4. Choose the Minimal Safe Fix
  5. Implement the Fix
  6. Verify Non-Regression
  7. Capture Root Cause and Close the Loop

What it can do on your machine

Read from SKILL.md and the folder at commit 4d6c35f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Bug Fix loads about 3k tokens when it runs. Until then it costs about 88 tokens; SKILL.md has 1,609 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~88
When it runs · the whole SKILL.md, loaded when a task matches
~3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from techygarg/lattice at commit 4d6c35f, republished under its MIT licence (© techygarg). 1,609 words, ~2,977 tokens.

Download SKILL.mdSave it as .claude/skills/bug-fix/SKILL.md (or your agent's skills folder).
name
bug-fix
description
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'.

Bug Fix

Required Skills

Load these skills based on bug scope:

  1. framework:knowledge-priming -- Load project context so the diagnosis grounds in the real codebase. (always)
  2. framework:context-anchoring -- Find and load the feature's context doc; capture diagnosis and repair decisions in it. (always)
  3. framework:learning-harvest -- Load prior operational learnings at session start; harvest new ones at session end. (always)
  4. framework:collaborative-judgment -- Surface hypotheses and repair trade-offs as structured options instead of silently assuming. (always)
  5. framework:clean-code -- Keep the fix focused, readable, and free of drive-by changes. (always)
  6. framework:test-quality -- Regression tests, characterization baseline, assertion quality. (always)
  7. framework:architecture -- Layer placement and dependency direction. (conditional: layer placement is in question — Steps 2/4/5)
  8. framework:domain-driven-design -- Domain invariants and aggregate behavior. (conditional: domain invariants involved — Steps 2/5)
  9. framework:secure-coding -- Trust bounds and sensitive data handling. (conditional: trust boundary crossed — Steps 2/5)

Workflow

Step 1: Establish Bug Context

Start from the failure, not from a proposed fix.

  • Gather the observed behavior, the expected behavior, the reproduction path, and any evidence: failing test, error message, stack trace, log excerpt, request payload, recent change.
  • Run framework:learning-harvest Load behavior. Focus hint: "bug investigation — focus: reliability, quality signals".
  • Run framework:context-anchoring Document Discovery to check for an existing context doc covering the affected feature/module:
    • Found → Load behavior. Honor every logged decision and constraint as an active commitment while diagnosing. An open investigation of this same bug is already logged in it → confirm with the user whether to resume that investigation or start fresh.
    • Not found → Proceed from the bug report and the current code. Do not block diagnosis on a missing context doc.

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.

Step 2: Reproduce and Localize

Primary discipline: never present a fix for a bug you have not reproduced.

Reproduce the failure using the strongest evidence available, in this order:

  1. Existing failing automated test -- best case; use it as the regression guard.
  2. New failing automated test -- preferred when no test exists yet.
  3. Executable reproduction path -- command, request sequence, or deterministic manual flow when automation is not yet possible.

Localize the issue before editing:

  • Which layer is the likely source? Use the layer definitions from framework:architecture to identify which architectural layer the defect originates in.
  • Production bug or test bug? Sometimes the code is correct and the test or fixture is wrong.
  • Failure symptom or root cause? The crashing line is often downstream of the real defect.
  • Does the bug cross a trust boundary? If yes, framework:secure-coding applies to the fix (Step 5).
  • Does it involve domain invariants or aggregate behavior? If yes, framework:domain-driven-design applies to the fix (Step 5).
  • Will the likely fix touch multiple layers or dependency flow? If yes, 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:

  • Investigation is complex, involves multiple hypotheses, or is likely to span multiple sessions → ask whether the user wants to persist the diagnosis and repair decisions.
  • A relevant context doc exists → enrich it in Step 7.
  • None exists and the user wants persistence → propose creating one; confirm the doc name per framework:context-anchoring, then use it as the source of truth.
  • The user declines persistence, or the bug is narrow and local → continue in non-persistent mode. The repair workflow still applies; decisions remain in-session.
Step 3: Add Regression Protection First

Phase A — Bug-Condition Tests (must start RED)

  • Write the smallest failing test that fires when C holds.
  • Prefer the lowest-level test that reproduces the real failure without losing signal.
  • Name the test for the broken behavior, not the implementation detail.
  • Assert the correct expected outcome (postcondition P), not just the absence of failure.
  • Apply framework:test-quality inline while writing it.
  • Run it against the unfixed code where the environment allows, and confirm RED. If tests cannot be executed here, say so explicitly — the reproducer then counts as unverified, and the limitations below apply.
    • Green before any fix → the bug-condition hypothesis is wrong. STOP: Do not proceed — return to Step 2 and re-localize.

Stopping rule:

  • STOP: If no stable failing automated test can be created or executed, explain why before making any code changes.
  • Record the closest executable reproduction you have.
  • STOP: Never present a speculative fix as complete without an automated reproducer unless the user explicitly accepts the limitation.
  • The bug cannot be tested directly because of tight coupling or deep integration → introduce the minimum structural seam needed to make it testable (method extraction, parameter injection, interface boundary). This is not refactoring — it is a prerequisite for regression protection. Apply framework:clean-code inline and keep the seam minimal.

Phase B — Preservation Baseline (must stay GREEN)

  • Identify existing tests covering behavior outside C.
  • Important adjacent behavior has no coverage → add at most 2–3 targeted characterization tests.
  • Confirm every preservation-baseline test is green before applying the fix.
  • These tests must remain green through every change in Step 5 — any flip to red means the fix has side effects; stop and narrow the scope.
Show full SKILL.md (633 more words)Show less
Step 4: Choose the Minimal Safe Fix

Separate the repair strategy from the code change itself.

Before editing, decide:

  • What is the root cause?
  • What is the smallest safe change that corrects it?
  • Which layer is the right repair location?
  • Does the issue require a local patch or a small structural correction?

Default to the smallest safe fix that restores correct behavior without architectural backsliding.

Guardrails:

  • Apply framework:architecture layering rules when choosing the repair location — do not patch in an outer layer when the rule belongs inward.
  • Do not widen the task into unrelated cleanup.
  • Do not delete or weaken the failing test just to make the suite green.
  • A real fix requires a contract or design change beyond the narrow repair → stop and discuss scope explicitly; if the user agrees the scope is a design change, route to /design-blueprint.
  • Do not add guard clauses, null checks, or defensive handling for inputs outside C — the code path for correct inputs must be byte-for-byte identical before and after the fix.

Multiple valid repair strategies exist with meaningful trade-offs → present them using framework:collaborative-judgment before proceeding.

Step 5: Implement the Fix

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:

  • Fix changes layer responsibilities, dependency direction, or architectural flow → apply framework:architecture.
  • Fix changes domain behavior, invariants, aggregate boundaries, or value objects → apply framework:domain-driven-design.
  • Fix touches input validation, authorization, queries, external boundaries, or sensitive data → apply framework:secure-coding.

After implementing the fix, before presenting:

  1. Re-run the regression test and confirm it is now green. Tests cannot execute in this environment → state that explicitly; never imply the test passed unrun.
  2. Run the applicable atoms' Self-Validation Checklist sections against the changed code.
  3. Run the applicable atoms' Active Anti-Pattern Scan checklists.
  4. Fix violations before presenting the result.
Step 6: Verify Non-Regression

Verify the repair on three levels:

  1. Fix proof -- the regression test that was red before the fix is now green, asserting the correct outcome rather than just the absence of the original failure.
  2. Preservation proof -- tests covering behavior adjacent to the bug still pass. Preservation-baseline tests added in Step 3 must remain green. Any flip from green to red means the fix has side effects — stop and narrow the scope before continuing.
  3. Structural confidence -- the fix introduced no wrong-layer workaround, no dependency violation, no weakened security posture.

When reporting completion, be explicit about the verification scope:

  • What was re-run.
  • What now passes.
  • What was not verified, and why.

If the fix is narrow and confidence is high, say so briefly. If verification is partial, say so clearly.

Step 7: Capture Root Cause and Close the Loop

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:

  • Bug summary: observed vs expected behavior.
  • Root cause: what actually failed, and where.
  • Repair decision: why this fix was chosen over the alternatives.
  • Protection added: the regression test or executable reproducer now guarding the behavior.
  • Key files changed: path + role in the doc's Key Files table (skip a path already listed).

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:

  • touches multiple layers
  • changes security-sensitive code
  • changes domain behavior
  • introduces a non-trivial structural correction

© techygarg, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/bug-fix of techygarg/lattice.

Open the folder on GitHubat commit 4d6c35f

Compare with similar skills

Bug Fix next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Bug Fix compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Bug Fix this skilltechygarg/lattice198—~3kAutomated safety check: PassMIT
Vibe Coding PartnershareAI-lab/Kode-CLI5.2k—~5.6kAutomated safety check: PassApache-2.0
Odoo Workflowunclecatvn/agent-skills143—~4.7kAutomated safety check: PassMIT
Code Review21pounder/terminalAgent1201 repos~650Automated safety check: PassApache-2.0
Code WriterWildGums/Orc.LicenseManager108—~2.3kAutomated safety check: PassCustom licence
Surgical PatchJuliusBrussee/caveman110k1 repos~166Automated safety check: PassApache-2.0

Similar skills

  • Vibe Coding Partner

    shareAI-lab/Kode-CLI

    Gives an agent a set of working rules for any development task: understand first, surface decisions, verify results, and load deeper reference files per scenario.

    5.2k GitHub stars~5.6k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Odoo Workflow

    unclecatvn/agent-skills

    Mandatory pre-code gate and definition-of-done for ANY Odoo change (add field, override method, inherit view/xpath, OWL/JS patch, wizard, cron, controller, report, security, migration, bug fix…

    143 GitHub stars~4.7k tokensUpdated 13 days ago
    DevelopmentAuto-check passed
  • Code Review

    21pounder/terminalAgent

    A skill your agent uses when user asks to "review code", "check for issues", "analyze code quality", "find bugs", or wants feedback on code implementation.

    120 GitHub starsUsed in 1 repo~650 tokens
    DevelopmentAuto-check passed
  • Code Writer

    WildGums/Orc.LicenseManager

    Write production C code following repository coding standards and architecture.

    108 GitHub stars~2.3k tokensUpdated 8 days ago
    DevelopmentAuto-check passed
  • Surgical Patch

    JuliusBrussee/caveman

    Fix bugs and small behavior changes at the narrowest responsible layer. Use when regression proof, preserved surrounding behavior, and task-relevant tests…

    110k GitHub starsUsed in 1 repo~166 tokens
    DevelopmentAuto-check passed
  • Find Bugs

    getsentry/skills

    Official

    Find bugs, security vulnerabilities, and code quality issues in local branch changes.

    1k GitHub starsUsed in 9 repos~708 tokens
    DevelopmentAuto-check passed

More from techygarg/lattice

All 33 skills in this repo
  • Architecture Compass

    techygarg/lattice

    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…

    198 GitHub stars~4.4k tokensUpdated yesterday
    Auto-check passed
  • Lattice Init

    techygarg/lattice

    Guided setup and upgrade-check experience for Lattice projects -- scans the repository, detects existing configuration and outdated conventions, suggests refiners and available upgrades in priority…

    198 GitHub stars~3.3k tokensUpdated yesterday
    Auto-check passed
  • Skill Align

    techygarg/lattice

    Audit and fix all Lattice documentation, README, docs/, PROJECT.md, GitHub issue templates, and CLAUDE.md to ensure they are fully aligned with the current skill inventory.

    198 GitHub stars~2k tokensUpdated yesterday
    Auto-check passed
  • Skill Validate

    techygarg/lattice

    Validate any Lattice SKILL.md against all tier conventions — atoms, molecules, and refiners.

    198 GitHub stars~1.5k tokensUpdated yesterday
    Auto-check passed
  • Architecture Refiner

    techygarg/lattice

    Facilitate a structured conversation to define architecture principles for a repository.

    198 GitHub stars~3.7k tokensUpdated yesterday
    Auto-check passed
  • Clean Code Refiner

    techygarg/lattice

    Facilitate a structured conversation to define clean code principles for a repository.

    198 GitHub stars~3k tokensUpdated yesterday
    Auto-check passed

Categories

Questions about Bug Fix

What does Bug Fix do?

Investigate, reproduce, and safely fix a bug with regression protection. Bug Fix is an agent skill from techygarg/lattice. Investigate, reproduce, and safely fix a bug with regression protection.

When should I use Bug Fix?

Bug Fix fits situations like: the user says fix this bug; investigate this failure; patch this regression; repair this issue.

How do I install Bug Fix in Claude Code?

Run `npx skills add techygarg/lattice --skill bug-fix -a claude-code`. Or copy the skill folder (skills/bug-fix in techygarg/lattice) into .claude/skills/bug-fix in your project. Claude Code loads it when a task matches its description.

How do I install Bug Fix in Codex?

Run `npx skills add techygarg/lattice --skill bug-fix -a codex`. Or copy the skill folder (skills/bug-fix in techygarg/lattice) into .agents/skills/bug-fix in your project. Codex loads it when a task matches its description.

Can I use Bug Fix in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add techygarg/lattice --skill bug-fix -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/bug-fix, .gemini/skills/bug-fix, .github/skills/bug-fix and .opencode/skills/bug-fix in your project.

What does Bug Fix need to run?

SKILL.md names no scripts, command-line tools or credentials: Bug Fix is instructions for the agent only.

Does Bug Fix access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Bug Fix safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Bug Fix use?

Bug Fix is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Bug Fix use?

About 3k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Bug Fix?

Skills that share tags, products or a category with Bug Fix: Vibe Coding Partner (shareAI-lab/Kode-CLI, 5.2k stars), Odoo Workflow (unclecatvn/agent-skills, 143 stars), Code Review (21pounder/terminalAgent, 120 stars) and Code Writer (WildGums/Orc.LicenseManager, 108 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Bug Fix?

techygarg (a GitHub user) maintains it in techygarg/lattice, which has 198 GitHub stars. The repository holds 33 skills in this directory. The repository was last updated on October 6, 2026.

Source: techygarg/lattice on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.