/SKILL.md
Splits mixed Server/Client Next.js pages into clean boundaries — extracts client logic into `*Client.tsx`, rewrites `page.tsx` as a pure Server Component, flags repeated JSX for componentisation, and detects styling inconsistencies across the codebase. Trigger on: refactor requests, mixed Server/Client files, pages >200 LOC with hooks, duplicated JSX, or any style drift between components.
npx skillsauth add renmaiv/nextjs-app-refactor nextjs-app-refactorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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.
tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
A CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.