/vector-skills:bug-fixingfrom Vector Skills
Provides a disciplined, architect-level workflow for diagnosing and fixing bugs in any codebase. Covers crashes, exceptions, wrong output, failing tests, regressions, race conditions, memory leaks, performance degradation, data corruption, and integration failures.
Ships in Vector Skills. 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.
Read when SKILL.md points to them.
A bug is evidence. It tells you that the system's real behavior and your model of the system disagree. The job is not to make the symptom disappear — it is to find why the disagreement exists, fix the cause at the correct layer, and leave the system more coherent than you found it.
Speed comes from understanding, not from typing. A patch shipped in ten minutes that hides a cause costs weeks later.
Follow the phases in order. Do not jump to Phase 4 because the fix "looks obvious" — the obvious fix is the symptom fix in most cases. State which phase you are in as you work, so the reasoning is auditable.
Establish, in writing, before anything else:
If key facts are missing and cannot be discovered from the code or logs, ask. Do not invent them.
A bug you cannot reproduce is a bug you cannot prove you fixed.
Before forming a theory, build an accurate model of the relevant subsystem.
git log -p, git blame. When was the behavior introduced, and what was the intent of that change? git bisect when the regression window is unclear.Read the actual implementation of any dependency behavior you rely on. If the fix depends on how a library handles an edge case, verify it rather than assuming.
Work as a hypothesis loop, not a guessing loop: observe → hypothesize → predict → test → narrow. Each experiment should eliminate possibilities, not merely confirm the hope you started with.
Apply the Five Whys, stopping only when the next "why" leaves the codebase:
The page shows a blank total. → Why?
totalisNaN. → Why? A price arrived as the string"12,50". → Why? The import parser splits CSV without honoring the locale decimal separator. → Why? The parser was written for one locale and no validation exists at the ingestion boundary. → Root cause: the ingestion boundary accepts unvalidated, locale-ambiguous input into the domain model.
Notice that fixing NaN in the view (total || 0) would have "fixed" the report and silently corrupted every downstream number. That is the difference this phase exists to catch.
Useful techniques — see references/root-cause-techniques.md for details and per-class playbooks (concurrency, memory, performance, distributed systems, data corruption, flaky tests, heisenbugs):
Classify the cause — the class determines the correct fix location:
| Class | Typical true cause | Fix normally belongs at |
|---|---|---|
| Input/validation | Unvalidated data crossing a boundary | The boundary (parser, DTO, API edge) |
| Contract mismatch | Caller and callee disagree on types, units, nullability, errors | The contract + both sides aligned |
| State/lifecycle | Object used before init, after dispose, stale cache | State ownership / lifecycle management |
| Concurrency | Unsynchronized shared mutable state, ordering assumption | Design: isolation, immutability, or explicit synchronization |
| Logic | Off-by-one, wrong operator, inverted condition, missed case | The algorithm, plus a test for the missed case |
| Configuration/env | Divergent config, missing var, version skew | Config management + fail-fast validation at startup |
| Resource | Leak, exhaustion, unbounded growth | Ownership/cleanup discipline (scoped, deterministic release) |
| Integration | Retry/timeout/idempotency/error-mapping assumptions | The adapter layer that owns that external system |
| Design | The architecture makes the bug expressible at all | A structural change — propose it, scope it, ask before doing it |
Write the causal chain down. It goes in the final report.
Before writing code, answer these:
If more than one reasonable option exists and they differ materially in risk or scope, present the options with trade-offs before implementing.
Always end with a structured report. Full templates (RCA report, commit message, PR description) are in references/report-templates.md. Minimum content:
## Symptom
What was observed, and how it was reproduced.
## Root cause
The causal chain, ending at the true cause. File:line references.
## Why the obvious fix was wrong
(If applicable) the symptom-level fix considered and why it was rejected.
## The fix
What changed, at which layer, and why that layer is correct.
Files touched, with a one-line rationale each.
## Verification
Test that failed before / passes now. Other tests run. Risks checked.
## Blast radius & compatibility
Callers, data, APIs affected. Migration needed? Yes/no.
## Related findings (not fixed)
Clones of this defect elsewhere, band-aid patches, dead code,
contradicted comments, duplicated services encountered.
Each with location and suggested action — reported, not silently fixed.
The most common failure mode of an AI agent is producing a plausible patch that suppresses the evidence. Learn these by shape — full catalogue with code examples in references/anti-patterns.md.
| Band-aid (do not do) | What it hides | Root fix direction |
|---|---|---|
try { … } catch { /* ignore */ } | A real failure path | Handle or propagate; fix why it throws |
value ?? 0, value || "" at the point of use | Bad data entering earlier | Validate/convert at the boundary that produced it |
| Null check added where the crash happened | Why null got there | Fix the producer; make nullability explicit in the type |
sleep(100) / retry to fix flakiness | A race or missing synchronization | Explicit ordering, awaiting the real condition |
| Tweaking a constant until the test passes | Wrong algorithm or wrong test | Derive the correct value; fix the logic |
if (id === 12345) special case | A general rule modeled incorrectly | Model the general rule |
| Catching and re-fetching to dodge stale cache | Broken invalidation | Fix cache ownership/invalidation |
| Skipping/deleting the failing test | The defect itself | Fix the defect |
| Adding a feature flag to route around it | Unresolved cause on the old path | Fix the path; flags are for rollout, not for hiding bugs |
| Wrapping in a new layer that corrects the output | Wrongness upstream | Correct it upstream and delete the wrapper |
When a quick mitigation is legitimate: an active production incident, where stopping the bleeding beats being right. In that case do all of the following, explicitly: (1) label it as a temporary mitigation in the report and in the code, (2) keep it as small and reversible as possible, (3) file/state the follow-up for the real fix with the causal chain already documented, (4) do not close the investigation. A mitigation without a documented follow-up is just a band-aid with better manners.
Ask these while diagnosing — they separate architect-level work from local patching:
Present the options and trade-offs concisely; do not stall waiting when a safe, reversible investigative step is available.
references/root-cause-techniques.md — debugging playbooks by defect class: concurrency, memory/resources, performance, distributed/integration, data corruption, flaky tests, heisenbugs, plus bisection and instrumentation technique.references/anti-patterns.md — annotated catalogue of band-aid fixes with code examples and the root-fix alternative for each.references/report-templates.md — RCA report, commit message, PR description, and the "related findings" format.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub myatminlu/vector-skills --plugin vector-skills8 skills in this plugin
/app-store-play-store-submissionGet an Expo / React Native app approved on the Apple App Store and Google Play, and fix App Store or Google Play rejections. Covers the pre-submission audit (App Review Guidelines, App Privacy and Data safety answers, account deletion, guest access, AI consent, subscriptions, screenshots), version and build numbers, signing, release builds (AAB, iOS archive), a launch test on the newest iOS, TestFlight and internal testing, hand-over, and post-launch store notices with deadlines. ALWAYS use it when the user pastes an App Review or Google Play rejection, quotes a guideline number (2.1, 2.3.10, 2.5.4, 3.1.1, 4.8, 5.1.1, 5.1.2…) or a Play Console policy warning, even if they only ask "what is this?" — the answer needs the rejection protocol, not just an explanation. Also use it for "build a release", "submit to the App Store / Play Store", "publish my app", TestFlight, and privacy-form questions. Not for building features (use react-native-expo-app-builder)./codebase-auditForensic whole-codebase audit and staged refactor. Use this skill whenever the user wants a codebase reviewed, audited, cleaned up, refactored, or "made systematic" — and also whenever they mention duplicated code, duplicated features or services, copy-pasted modules, band-aid or quick-fix or hacky code, technical debt, legacy vs new implementations living side by side, dead code, code smells, or wants to verify that features, functions and services are actually wired together and working end to end. Trigger it for requests like "review my codebase", "find duplicate logic", "why is this code such a mess", "check if everything is connected properly", or "plan a refactor", even when the user does not say the word "audit". Do NOT use it for a single-file review, a single bug fix, or writing new features.Other plugins' skills for the same job