What problem does it solve?
This skill performs a thorough structural hygiene audit to surface oversized files, dead code, misplaced logic, hook/component boundary violations, multi-component files, and TanStack Router or server-client type mismatches that reduce maintainability and increase technical debt.
Core Features & Use Cases
- Oversized file detection: Scans .ts and .tsx files in src/ and server/src/ and flags files over configurable thresholds with splitting recommendations.
- Dead code and import analysis: Detects unused exports, unreferenced files, long commented-out blocks, unused imports, and stray console.log statements and judges whether they are safe to remove.
- Misplaced code and hook boundaries: Identifies utilities, types, hooks, and data-fetching logic defined inline in components or routes and recommends relocation to src/lib/, src/types/, or src/hooks/.
- Multi-component and naming checks: Finds files exporting multiple components, enforces one-component-per-file convention, and checks PascalCase/component, kebab-case hook, and import alias consistency.
- TanStack Router and type sync checks: Verifies dynamic route param/search access patterns, presence of pending/error/auth guards, and reconciles frontend types with backend Prisma selections to uncover mismatches.
- Use case: Run this as Pass 1 on a TypeScript React frontend and Express/Prisma backend repository to prepare the codebase for deeper DRY, performance, and accessibility reviews.
Quick Start
Run the review-structural-hygiene skill to perform a Pass 1 structural hygiene audit across the repository.