generic-code-reviewer
Review code for bugs, security vulnerabilities, performance issues, accessibility gaps, and CLAUDE.md workflow compliance. Supports any tech stack - HTML/CSS/JS, React, TypeScript, Node.js, Python, NestJS, Next.js, and more. Use when completing features, before commits, or reviewing pull requests.
What this skill does
# Generic Code Reviewer Review code against production quality standards. Adapts to any project's tech stack. **Full Standards:** See [Code Review Standards](./../_shared/CODE_REVIEW_STANDARDS.md) ## CLAUDE.md Compliance **Always check the project's CLAUDE.md for specific rules.** **Before ANY Commit:** - Task file exists in `tasks/[feature-name].md` - All tests passing - Type checking passing (if TypeScript) - No console errors/warnings - Bundle size within limits ## Tech Stack Detection | Detection | Stack | Key Checks | | ----------------------- | -------- | ------------------------- | | React in package.json | React/TS | Components, hooks, state | | Next.js in package.json | Next.js | SSR, API routes | | NestJS in package.json | NestJS | Guards, DTOs, services | | .html files, no build | Vanilla | Semantic HTML, minimal JS | | .py files | Python | Type hints, validation | ## P0 Issues (Block Merge) ### Security - Frontend - Sanitize input (textContent, not innerHTML) - `unknown` type for external data - No exposed API keys - HTTPS for external requests ### Security - Backend - Input validation on all endpoints - Auth on protected routes - Parameterized queries (no raw SQL) - Secrets in environment variables ### Correctness - Logic errors that break functionality - Type errors in strict mode - Unhandled promise rejections ## P1 Issues (Should Fix) ### Performance | Project Type | Target | | ------------ | ------------------------ | | Static site | < 50KB (excluding media) | | SPA/React | < 100KB gzipped initial | | Full-stack | < 200KB gzipped initial | **Animation:** - GPU-accelerated only (transform, opacity) - 60fps target - Use requestAnimationFrame ### Accessibility (WCAG AA) - Focus indicators on interactive elements - Keyboard navigation (Tab, Enter, Escape) - Color contrast >= 4.5:1 - ARIA labels on icon-only buttons - Alt text for meaningful images - Semantic HTML structure ## P2 Issues (Nice to Have) ### Code Quality - DRY, Single Responsibility - No magic numbers/strings - Self-documenting code - Follow existing patterns - No commented-out/dead code ## Review Output Format Only report issues found (don't list empty categories): **Blocking Issues (P0):** - [Only if found - security, correctness issues] **Should Fix (P1):** - [Only if found - performance, accessibility issues] **Consider (P2):** - [Only if found - code quality polish] **If no issues:** "Code review passed. Ready to merge." ## Judgment Calls When user asks "Is this OK?", consider: | Context | Stricter | More Lenient | | --------------- | ------------------------------ | ------------------------------- | | **Environment** | Production | Prototype/POC | | **Path** | Hot path, frequently executed | One-time setup, admin only | | **Visibility** | Public API, external interface | Internal helper, private method | | **Timeline** | Feature complete | Active iteration | Adjust severity accordingly. P0 security issues are never lenient. ## Quick Checklist **Pre-Commit:** - [ ] Tests pass - [ ] Type/lint pass - [ ] Build succeeds - [ ] No console errors **Before Merge:** - [ ] All P0 issues resolved - [ ] P1 issues addressed or tracked - [ ] P2 issues noted for future ## See Also - [Code Review Standards](./../_shared/CODE_REVIEW_STANDARDS.md) - Full requirements - [Design Patterns](./../_shared/DESIGN_PATTERNS.md) - UI consistency - Project `CLAUDE.md` - Workflow rules
Related in Web Dev
generating-lwc-components
IncludedLightning Web Components with PICKLES methodology and 165-point scoring. Use this skill when the user creates or edits LWC components, builds wire service patterns, or writes Jest tests for LWC. TRIGGER when: user creates/edits LWC components, touches lwc/**/*.js, .html, .css, .js-meta.xml files, or asks about wire service, SLDS, or Jest LWC tests. DO NOT TRIGGER when: Apex classes (use generating-apex), Aura components, or Visualforce.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Set up queries with useQuery, mutations with useMutation, configure QueryClient caching strategies, implement optimistic updates, and handle infinite scroll with useInfiniteQuery. Use when: setting up data fetching in React projects, migrating from v4 to v5, or fixing object syntax required errors, query callbacks removed issues, cacheTime renamed to gcTime, isPending vs isLoading confusion, keepPreviousData removed problems.
document-processor-api
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
nutrient-document-processing
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Covers useMutationState, simplified optimistic updates, throwOnError, network mode (offline/PWA), and infiniteQueryOptions. Use when setting up data fetching, fixing v4→v5 migration errors (object syntax, gcTime, isPending, keepPreviousData), or debugging SSR/hydration issues with streaming server components.
accelint-nextjs-best-practices
IncludedNext.js performance optimization and best practices. Use when writing Next.js code (App Router or Pages Router); implementing Server Components, Server Actions, or API routes; optimizing RSC serialization, data fetching, or server-side rendering; reviewing Next.js code for performance issues; fixing authentication in Server Actions; or implementing Suspense boundaries, parallel data fetching, or request deduplication.