nextjs-client-auditlisted
Install: claude install-skill radyelkasas/nextjs-client-audit
# nextjs-client-audit
Find every `"use client"` that should not be there (or sits too high in the tree), show what it costs, and hand the developer a fix they can trust. The developer wants a fast, accurate report built from their real code, not a lecture on Server Components.
Why this matters: `"use client"` is not a label for one file. It is a **boundary**. The file and everything it imports gets bundled, shipped and hydrated in the browser. One directive at the top of a page or layout can quietly turn dozens of server-capable modules into client JavaScript. The fix is almost always small, but it has to be placed correctly or the app breaks. That is why this skill leans on a script for the facts and on you for judgment.
## 1. Run the audit (always first)
Find the project root: the folder with `package.json` (listing `next`) and `app/` or `src/app/`. In a monorepo, run once per Next.js app.
```bash
OUT="$(mktemp -d)" # or your scratchpad folder, if the environment gives you one
node <this-skill>/scripts/audit.js <project-root> --json "$OUT/client-audit.json" --md "$OUT/client-audit.md" > /dev/null
```
- The script is **read-only**. It never edits the project, so you can run it without asking.
- It prefers the TypeScript compiler API (resolved from the project's own `node_modules`, which almost every Next.js + TS project has), then `@babel/parser`, then a regex fallback. Check `parser` in the JSON. If it says `regex-heuristic`, tell the user the results are less preci