/vector-skills:codebase-auditfrom Vector Skills
Performs a forensic whole-codebase audit and staged refactor. Traces execution paths, detects dead code, duplication, technical debt, and stale comments, producing evidence-backed findings and a sequenced refactor plan.
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.
Investigate first, architect second, edit last. This skill turns a vague "clean up my codebase" request into an evidence-backed audit and a sequenced, reversible refactor plan.
These are what make the audit trustworthy. Follow them even when they slow you down.
COMMENT_LIE) — stale comments are how bugs survive review for years.path/file.ext:line-range plus the
minimal excerpt that proves it. Never rely on "this framework usually…" — a codebase that
needs an audit is precisely one that deviates from what's usual.CONFIRMED (traced/proven), LIKELY (strong
static evidence, one inference), or SUSPECTED (needs verification). An inflated
CONFIRMED poisons every decision built on top of it.Confirm with the user (ask only for what you cannot determine yourself by looking):
For anything above ~50k lines, run PHASE 0–2 in one session, 3–5 in another, 6–8 last, feeding the previous phase's report files forward. Trying to hold a large repo in one context produces confident summaries instead of findings.
State the phase plan and the module-by-module review order before beginning, then keep a running
checklist marking every file reviewed or skipped (reason). Nothing may be silently skipped —
skipping is how the one broken module gets missed.
Write each phase to its own file under reports/. Read the referenced file at the start of the
phase that needs it.
PHASE 0 — Reconnaissance → reports/00-map.md
Directory map with a one-line purpose per area derived from reading code. Every entry point
(HTTP routes, GraphQL resolvers, CLI commands, cron jobs, queue consumers, webhooks, websocket
handlers, DB triggers, bootstrap files). Every exit (DBs, caches, brokers, third-party SDKs,
storage, payment/email providers). Config surface: every env var read anywhere vs. every one
defined in .env.example, CI, and deploy manifests — flag read-but-undefined,
defined-but-unread, and the same concept under two names. Data model inventory. Size metrics
(largest files, most-imported modules) to locate hot spots.
PHASE 1 — Reachability & wiring truth → reports/01-wiring.md
Build the call graph from each entry point. Then produce two lists: orphans (exports never
imported, controllers never registered, DI providers never injected, events subscribed that
nobody publishes, tables no code touches, flags nothing checks, unused dependencies) and
broken wiring (route path mismatches between client and server, guards applied to 6 of 9
endpoints — name the 3, migrations diverging from models, async work fired without await so
failures vanish). Also list layering violations and every import cycle explicitly.
PHASE 2 — Duplication audit → reports/02-duplication.md
Read references/duplication.md. Group findings into clusters, never a flat list. The valuable
output is not "these are similar" but how the copies diverge, because divergence is where the
bugs live.
PHASE 3 — Band-aid & unsystematic-code audit → reports/03-bandaids.md
Read references/bandaids.md. For each patch, trace back to the actual root cause. A null check
is only a band-aid if the value can only be null because of an upstream bug — say which.
PHASE 4 — Comment-independent bug hunt → reports/04-bugs.md
Read references/bug-hunt.md. Read the code as an execution engine would, with comments
ignored. Compare against comments only afterwards, and file every mismatch under COMMENT_LIE.
For every confirmed bug, run the defect-class sweep: name the class, find every other
instance of it in the repo, and report the class once with all locations. A bug found in one
place is rarely alone, and fixing only the instance you happened to read is itself a band-aid.
PHASE 5 — Feature integration verification → reports/05-features.md
This is what "100% working" means in this audit. Build the feature inventory from entry points,
not docs. For each feature write the full traced path with file:line at every hop:
client → route → middleware/guards → controller → service(s) → repository → DB/external → response mapping → client consumption. Mark each hop CONNECTED / MISSING / DIVERGENT
(two paths that should agree but don't) / UNVERIFIABLE (name the command that would settle it).
Per feature, verify: happy path, at least two error paths, and the empty-result path; authorization
on every entry to the feature; validation at the trust boundary matching DB constraints; the
frontend calling an endpoint that exists with the shape the server expects and reading the shape
it actually returns; state changes observable on the next read. Output a health table:
Feature | Entry points | Status | Broken hops | Blocking bugs.
PHASE 6 — Test & safety-net reality check → reports/06-tests.md
Coverage of critical paths, not global percentages. Tests asserting nothing meaningful
(expect(true), snapshot-only, assertions on mocks rather than behaviour). Tests that mock the
thing under test. Skipped/.only/quarantined tests and what they used to guard. Then the key
deliverable: the minimum characterization tests that must exist before refactoring starts,
written concretely as input → expected output. These are the safety net for PHASE 7.
PHASE 7 — Refactor plan (plan only) → reports/07-refactor-plan.md
Target architecture with one canonical home per concept and allowed dependency directions;
before → after module map. Per duplication cluster: chosen canonical implementation, why, and
what behaviour from the losing copies must be preserved. Then sequenced steps, each small and
independently shippable:
Step N | Goal | Files touched | Preconditions (tests that must exist first) | Exact change | How to verify | Rollback | Risk | Depends on
Order to minimize risk: characterization tests → dead code removal → mechanical deduplication →
interface extraction → behavioural consolidation → root-cause fixes replacing band-aids →
structural moves. Prefer steps that eliminate a whole defect class (a missing lint rule, a helper
with a footgun signature, an absent abstraction) over steps that patch single instances. Include a do-not-touch list (ugly but load-bearing code, and why) and a
separate list of intentional behaviour changes — including bug fixes users may depend on —
flagged for human sign-off.
Stop here. Present the plan and wait for approval before editing anything.
PHASE 8 — Execution (only after approval)
One step per commit/PR with the step ID in the message. Characterization tests written and
passing first. Never mix a move or rename with a behaviour change in the same commit. When a step
fixes a defect class, fix every instance in that step or state explicitly which are deferred and
why — a half-fixed class reads as fixed and stops getting attention. After each
step: full test suite, smoke path, re-trace the affected PHASE 5 features, report the diff summary
and verification result. If a step reveals the plan was wrong, stop and re-plan rather than
improvising a larger change. Keep CHANGELOG-refactor.md and update reports/ as findings close.
Use references/report-templates.md for the per-finding table schemas.
Maintain reports/SUMMARY.md throughout:
# Audit summary
## Top 10 findings (by impact × confidence, one line each, with location)
## Counts (duplication clusters, band-aids, P0–P3 bugs, orphans, broken hops)
## Module health (Solid / Fragile / Broken, one sentence of evidence each)
## Open questions (everything unverifiable statically + the command or answer needed)
Be terse in prose and exhaustive in coverage. Tables over paragraphs. Every line must be about this codebase and anchored to a file — generic best-practice advice adds length and no value, and it dilutes the findings that matter.
Every file marked reviewed or explicitly skipped with a reason; every entry point traced
end to end with a status; every duplication cluster given a named consolidation target; every
band-aid traced to a root cause; every bug given trigger conditions and evidence; every
unverifiable claim sitting in OPEN_QUESTIONS rather than presented as fact.
What SKILL.md sets; muted values are Claude Code's defaults
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)./bug-fixingA disciplined, architect-level workflow for diagnosing and fixing bugs in an existing codebase — reproduce, read the real code before touching anything, find the true root cause, design the minimal correct fix at the right layer, verify it, and hunt for clones of the same defect. Use this skill for ANY defect work — crashes, exceptions, wrong output, failing or flaky tests, regressions, race conditions, memory leaks, performance degradation, data corruption, integration failures, works-locally-but-not-in-prod problems, or any request phrased as fix, debug, broken, not working, error, or why does X happen. Use it even when the bug looks trivial or the user has already proposed a fix — especially then, because the proposed fix is usually a symptom-level patch. Do NOT use for greenfield feature work with no defect involved./code-implementationDisciplined, architect-grade workflow for implementing features, enhancements, code-level refactors, consolidations, integrations, migrations, and performance work in an existing codebase. Forces reading the real code first, tracing the underlying cause, reusing or unifying existing code instead of duplicating, and verifying end to end with a mandatory pattern sweep. For pure defect/bug diagnosis and fixes (crashes, wrong output, regressions, flaky tests), prefer `bug-fixing`; for folder/file layout moves only, use `project-structure-refactoring`./code-quality-checkRigorous, evidence-backed, read-only code quality review that produces severity-ranked findings, a scorecard, and a merge/ship verdict. Use this skill whenever the user asks for a code review, quality check, PR or diff review, "is this code good", "check my code", "review this file", a health check, a pre-merge gate, a second opinion on code that an AI agent or teammate wrote, or wants best-practice / standards compliance checked — including when they simply paste code and ask what is wrong with it. Also trigger on mentions of code smells, maintainability, readability, dead code, duplicated logic, band-aid fixes, error handling, security review, performance review, test quality, or "make this production ready". Use it even for a single file or a small diff. Do NOT use it to write the fix — produce the findings, then hand off to the implementation or bug-fixing workflow./nestjs-dev-guidelinesProduction-grade NestJS backend standards for writing, reviewing, and evolving NestJS/Nest-style TypeScript services. Use when a repo has modules, controllers, services, DTOs, guards, or pipes, or when designing NestJS APIs, migrations, auth/RBAC, multi-tenancy, DDD layered/hexagonal architecture (ports/adapters, use cases), repository/N+1 queries, validation, pagination, caching, exception filters, BullMQ jobs, webhooks, uploads, decorators, scopes, dynamic modules, circular deps, health/shutdown, OpenTelemetry logging/tracing, testing, code review, version modernization, or AI backends (LLM gateways, SSE streaming, metering/quotas). Verify volatile versions/APIs against official docs and the repo. Plain Express/Fastify/Hono/Koa: cross-cutting guidance only. Not for non-Node backends or pure frontend work./project-structure-refactoringCross-language project structure and structural refactoring standards for designing folder/module layouts and safely restructuring codebases. Use when reorganizing files, choosing or fixing folder structure, deciding where files belong, package-by-feature vs by-layer, fixing messy/flat/deep trees, splitting giant/god files into modules, monorepos (apps/packages, workspaces, Turborepo/Nx), Python src layout, Go cmd/internal, React/Next.js/Expo feature folders, barrel files, path aliases, or updating Dockerfiles/CI/configs after moves. Covers staged green migrations, git mv history preservation, and boundary enforcement. Structural only: hand code-level refactoring (extract/rename/dedupe) to code-implementation or codebase-audit, NestJS layout specifics to nestjs-dev-guidelines. Principles apply to any language.Other plugins' skills for the same job