Splits mixed Server/Client pages into separate files with clean boundaries — extracting client logic into a `<DescriptiveName>Client.tsx` and rewriting `page.tsx` as a pure Server Component — and flags repeated JSX structures for extraction into shared typed components. Apply when working in a Next.js App Router project and you detect `export const metadata` alongside `"use client"`, hooks in a Server Component, a page file that has grown unwieldy (>200–300 LOC) with interactive logic, or the same layout block duplicated inline multiple times.
97
97%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Passed
No known issues
State: what was detected, why it's a problem, what you'll change. Wait for approval before modifying any file.
metadata never in a "use client" file — use layout.tsx if it spans multiple routesuseState, useEffect, useRouter, etc.) must live in Client Componentsmetadata in a Client Component, or Server/Client concerns mixed in one fileapp/<route>/<FeatureName>Client.tsx — move "use client", all hooks, JSX, handlerspage.tsx:import type { Metadata } from 'next';
import FeatureNameClient from './FeatureNameClient';
export const metadata: Metadata = { /* ... */ };
export default function Page() { return <FeatureNameClient />; }"use client" or hooks in page.tsx, no syntax errors, project buildsFlag 2+ JSX blocks with identical structure (same wrapper, classNames, child layout) differing only in data values, or .map() calls rendering >3 elements per item. Extract into a domain-named component (ProjectSection, WorkEntry) — not Section1. Confirm before extracting.
During any refactor or property change, scan for drift. Flag when 2+ places share an apparently intentional value but express it inconsistently.
| Category | What to flag |
|---|---|
| Layout & Spacing | Duplicate/overriding utilities on one element (px-4 px-6); inconsistent scale values across instances; same pattern using different responsive prefixes (md: vs lg:); style={{}} overrides conflicting with classNames; same component with diverging Tailwind variants across call sites |
| Color & Tokens | text-[#3B82F6] vs text-blue-500 — hardcoded hex matching an existing token; shadow-md, shadow-lg, inline box-shadow mixed for the same elevation level |
| Structure & Scale | <Button /> exists but some sites recreate it with raw classes; same class defined differently across .module.css files; hardcoded z-index values with no defined scale |
When detected: list affected files/locations, propose a CSS variable/Tailwind token or base component, wait for approval.
Full file contents only. No placeholders. Code must compile.