code-audit

Audits repositories for dead code, FSD violations, and drift with cross-repo verification.

Updated Mar 4, 2026
One-click install
npx skills add https://github.com/gmolike/Claude-Template --skill code-audit-gmolike
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-audit
Source: https://github.com/gmolike/Claude-Template/tree/main/.claude/skills/code-audit
Command: npx skills add https://github.com/gmolike/Claude-Template --skill code-audit-gmolike

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code audits often produce destructive false positives — flagging Prisma junction tables, schema building blocks, or allowed FSD imports as dead code — leading to costly recovery work. This Skill enforces a conservative, cross-repo-verified audit process that never recommends dropping code without proof. ## Core Features & Use Cases - Cross-Code Verification Checklists: Mandatory grep-based checks across all repos before any DROP recommendation, covering Prisma models, M2M junctions, lookup tables, OpenAPI schemas, and asset loaders. - FSD Layer-Inversion Rules: Distinguishes allowed imports (widgets → features) from real inversions (features → widgets, shared → upper layers) to avoid false flags. - Confidence-Graded Reports: Every finding is reported as KEEP / REFACTOR / DROP with a confidence level (high / medium / low / skeptical) and documented grep evidence. - Use Case: Before retiring a Zod schema or a React hook like useSoundEffects, run this audit to verify all consumers across api, shared, and frontend repos, ensuring replacements are feature-complete and no test or type imports break. ## Quick Start Ask the agent to audit a repository or slice for dead code and FSD violations using the code-audit skill, and require cross-repo grep verification before any DROP recommendation.

Frequently Asked Questions about code-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit a repo for dead code without false positives?

Run cross-repo grep verification before flagging anything as unused: check Prisma include clauses, schema building-block usage, test consumers, and frontend type imports. If confidence is below high, recommend KEEP or REFACTOR instead of DROP.

How to detect FSD layer violations correctly?

Check import direction between layers: widgets importing features and pages importing widgets are allowed in Feature-Sliced Design. Only features importing widgets, entities importing features, or shared importing upper layers are real violations requiring refactoring.

Why are Prisma junction tables flagged as dead code?

Many-to-many junction tables with a two-foreign-key pattern are only referenced via include clauses, not direct imports, so naive greps miss them. Always grep for the model name and check for include usage before recommending removal.

When should a Zod schema not be removed as unused?

Do not remove schemas used as building blocks inside other schemas, referenced in OpenAPI route definitions, imported by tests, or consumed via exported types in frontend repos. Variants like CreateX versus UpdateX are intentionally separate and should be kept.

What are the limitations of single-repo code audits?

Single-repo audits miss cross-repo consumers, causing false DROP recommendations for shared schemas, types, and hooks. Always grep all related repositories — api, shared packages, and every frontend — before concluding code is unused.