architecture-compass
Architectural thinking partner for an existing repository — scans the codebase, conducts a structured interview, agrees on…
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',
Claude Code
$ npx -y skills add techygarg/lattice --skill bug-fix --agent claude-code
Codex
$ npx skills add techygarg/lattice --skill bug-fix -a codex -y
Cursor
$ npx skills add techygarg/lattice --skill bug-fix -a cursor -y
Gemini CLI
$ npx skills add techygarg/lattice --skill bug-fix -a gemini-cli -y
GitHub Copilot
$ npx skills add techygarg/lattice --skill bug-fix -a github-copilot -y
OpenCode
$ npx skills add techygarg/lattice --skill bug-fix -a opencode -y
Windsurf
$ npx skills add techygarg/lattice --skill bug-fix -a windsurf -y
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'."
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)
**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:
1. Show them verbatim under "Additional instructions (from config):". 2. **Highest priority — apply them for the whole session, including on resume.** On any conflict with anything else in this skill — steps, gates, STOP rules — or with its Required Skills, standards documents, or operational learnings, the config line wins.
Start from the failure, not from a proposed fix.
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:
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:
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:
Composable AI skills that teach assistants structured thinking — design-first, context-aware, and architecture-guided.
Architectural thinking partner for an existing repository — scans the codebase, conducts a structured interview, agrees on…
Facilitate a structured conversation to define architecture principles for a repository. Supports multiple architecture styles:…
Enforce architectural rules when generating or modifying code, and validate proposed designs before approval (design mode).…
Facilitate a structured conversation to define clean code principles for a repository. Produces a formal clean-code.md document…
Apply clean code principles when generating or modifying implementation code. Enforces function focus, naming clarity, complexity…
Generate implementation code from an approved design blueprint or verbal requirements. Composes context anchoring, architecture,…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.