/dev-flow:vercel-doctorfrom dev-flow
Scans a Next.js project with vercel-doctor CLI to detect costly Vercel patterns (caching, function duration, image cost) before deployment, then routes fixes to the appropriate skill. Use when Vercel bills are high or optimizing for Vercel.
Ships in dev-flow. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Runs on a project that already exists and targets Vercel. It wraps the third-party vercel-doctor CLI — which scans a Next.js codebase for patterns that cost money on Vercel — and turns its report into applied fixes, routing each finding to the skill that owns it.
Third-party tool. vercel-doctor is not an official Vercel product — it's an independent open-source project by Aniket-508, published to npm as
vercel-doctor(binvercel-doctor, MIT). Verified against the npm registry + repo README (latest at time of writing: 1.2.0 — pin or re-check, the flag set can change). It reads your codebase and phones home unless--offline; treat its AI-fix prompts as suggestions to verify, not gospel.
npx -y vercel-doctor@latest . # scan the project at <path>
npx -y vercel-doctor@latest . --output markdown --report docs/vercel/doctor-report.md
npx -y vercel-doctor@latest . --ai-prompts docs/vercel/doctor-fixes.json
| Flag | Effect |
|---|---|
--output <human|json|markdown> | report format (default human) |
--report <file> | write the report to a file |
--ai-prompts <file> | export fix prompts as JSON (only issues with a known fix strategy) |
--score | print only the health score |
--verbose | list the matching files per rule |
--diff [base] | scan only files changed vs the base branch |
--project <name> / -y, --yes | pick workspace project(s) / scan all without prompting |
--no-lint / --no-dead-code | skip the lint / dead-code analyses |
--offline | skip telemetry |
-v, --version / -h, --help | version / help |
If a flag above is rejected, the CLI has moved — run npx -y vercel-doctor@latest --help and use what
it reports rather than guessing.
--help does not tell you (found by running it)--diff — if the
working tree is dirty the run prints "Scanning uncommitted changes" and looks at just those files.
A dirty tree can therefore produce a confident "No issues found!" that means nothing. Run it on a
clean tree (commit or stash first) when you want a real audit, and check the line that says either
"Found N source files" (full scan) or "Scanning N changed source files" (diff mode) before you
trust the result.--offline also disables the score. Telemetry is what computes it (--help: "anonymous, not
stored, only used to calculate score"). Use --offline for a private codebase and accept there is no
number; drop it only when the user is happy for the scan to phone home.| Area | Typical finding | Who fixes it in dev-flow |
|---|---|---|
| Caching | fetch/routes that opt out of the CDN; missing "use cache" / revalidate | data-fetching (Next 16 Cache Components — "use cache", cacheLife, revalidateTag) |
| Unused code | dead files, exports, types | safe cleanup (delete + tsc verify) — mechanical, this skill |
| Function duration | long-running serverless work, blocking awaits, oversized bundles | this skill flags; heavy refactors → the owning feature skill |
| Image optimization | unoptimized images, missing sizes, raster where SVG fits | design-md-to-app image patterns / next/image config |
| Function invocations | patterns triggering excessive serverless calls (per-request fan-out) | data-fetching (lift reads to Server Components, batch) |
| Platform / config | next.config / vercel.json / region / runtime misconfig | this skill (config is mechanical) |
Preconditions. meta.json#stack.framework ∈ {"next","monorepo"} and the deploy target is Vercel (stack.deploy = "vercel" or the user says so). Refuse otherwise — the checks are Vercel-specific.
Run npx -y vercel-doctor@latest . --output markdown --report docs/vercel/doctor-report.md at the project root (or apps/web/, or --project <name> in a monorepo). Add --ai-prompts docs/vercel/doctor-fixes.json when you want the fix prompts. Capture the markdown report + health score (--score alone if you only need the number).
Triage each finding by area (table above). Verify it in the code before acting — a scan is a signal, not a verdict. Trust the categories unequally:
| Category | Trust | Why |
|---|---|---|
| Caching / route policy | high | reading a route's headers is a fact |
Deployment + config (file count, --archive=tgz, Fluid Compute) | high | mechanical, verifiable |
| Static-asset size | medium | the threshold is low (~25 KB); judge each asset |
| Link prefetch | read the version first — see below | |
Dead code (Unused file / Unused export / Unused type) | lowest — never act on it alone | see below |
⚠️ The dead-code pass is the one that will hurt you. It runs knip, which resolves imports on its
own and does not know about framework-discovered entry points. On a real run against a Next 16 +
eve project it flagged 67 of 115 files (58%) as unused — and every one we spot-checked was wrong:
agent/agent.ts (the eve agent entry point, discovered by path, imported by nobody — deleting it
destroys the agent), db/index.ts (imported by agent/tools/* via a relative path), hooks/use-mobile.ts
(imported through the @/ alias), and buttonVariants (used by components/ui/calendar.tsx).
Open every file before deleting it, and treat anything a framework discovers by convention —
agent/**, route files, middleware/proxy, instrumentation.ts, config files — as a guaranteed
false positive. When in doubt, --no-dead-code and audit that separately.
⚠️ The Link-prefetch advice predates Next 16.3. It says "add prefetch={false}… add prefetch={true}
only to critical links", which was right when every link cost a prefetch request. Under Partial
Prefetching (16.3) Next prefetches one reusable App Shell per route, so rendering a <Link> is
effectively free and prefetch={true} means something different (deeper per-link prefetch + runtime
prefetching). On ≤16.2 the advice stands; on 16.3+ with partialPrefetching on, ignore it and follow
data-fetching §Instant Navigation instead.
Apply the safe, mechanical fixes here (dead-code deletion with tsc --noEmit green, config corrections, next/image sizes/format tweaks).
Route the judgment calls to the owning skill rather than hand-fixing: caching + invocation findings → data-fetching (it owns the Next 16 read/caching ladder); image-pattern findings → design-md-to-app. Don't re-implement their rules here.
Persist: write the report to docs/vercel/doctor-report.md, update meta.json#vercel_doctor, append history. No phase bump.
When meta.json#stack.data_residency is "eu" or "eu-sovereign", a function region outside the EU is not only a latency question. python3 <dev-flow>/scripts/data_residency.py check <root> reports every regions in vercel.json (project-level and per function) and region-bearing hosts in .env*.example that are not EU; surface those in the report as flagged and route the decision to module-add deploy / dev-flow/references/eu-data-sovereignty.md — never move a region on your own (a Blob store's region cannot be changed after creation).
meta.json#vercel_doctor block"vercel_doctor": {
"last_run_at": "<ISO>",
"health_score": 0, // as reported
"findings": { "high": 0, "medium": 0, "low": 0 },
"fixed": ["unused-code","image-sizes"],
"routed": { "data-fetching": ["caching","invocations"], "design-md-to-app": ["images"] }
}
Horizontal capability — run any time. dev-flow proposes it as a pre-deploy gate at feature_complete (right beside compliance-audit — legal gate + cost gate before shipping), and re-runs it in the deployed maintenance loop (catch cost regressions after changes). It records meta.json#vercel_doctor + history and never bumps phase. It never blocks the deploy on its own — it surfaces the score + findings so the user decides.
compliance-audit — the sibling gate: legal/privacy risk (GDPR/AI-Act) vs vercel-doctor's cost/perf risk. Both are feature_complete pre-deploy gates, both no-phase-bump, both "auto-fix safe + route/flag the rest."data-fetching — owns the real fix for the two biggest cost areas (caching, invocations). vercel-doctor detects, data-fetching corrects (Next 16 "use cache" / Server-Component reads). Don't duplicate its ladder.shadscan — another of the five gates: UI quality + accessibility. Same shape (pre-deploy, no phase bump, auto-fix safe + route the rest), different surface. Worth noting the contrast in precision: shadscan reports what is present in the file it names, while the dead-code pass here resolves imports speculatively and gets it wrong most of the time.vercel-deploy — the actual Vercel deploy. vercel-doctor runs before it, not instead of it.docs/vercel/doctor-report.md written; meta.json#vercel_doctor populated with the score + findings.tsc green; config/image tweaks); judgment calls routed to data-fetching / design-md-to-app with a one-line pointer each.compliance-audit.vercel-deploy.data-fetching.phase, and never blocks deploy by itself.references/contracts.md — the .workflow/ dev-flow contract (vendored).What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
vercel-cost, nextjs-optimization, cost-audit, pre-deploy-gate
57 skills in this plugin
/animated-iconsAdd a Motion-animated icon to a Next.js app from a shadcn registry instead of hand-animating an SVG. Two registries, picked from the project's icon set: **heroicons-animated** (316 icons, `shadcn add @heroicons-animated/<name>`) and **hugeicons-animated** (165 icons, `shadcn add @hugeicons-animated/<name>`, which also installs a shared `lib/use-icon-animation.ts`). Both MIT, both on the `motion` runtime, both copied into your repo as source. This skill owns the install plus the two things the raw components lack: a `prefers-reduced-motion` guard and timing aligned to the project motion tokens (`lib/motion/`). Use when the user says "animated icon", "animate this icon", "make the bell/heart/menu icon animate on hover", "aggiungi un'icona animata", or wants an icon micro-interaction. Refuses outside Next.js web — for React Native use `rn-animations-gestures`. Not for: static icons, a whole motion system (`transitions`), or installing the runtime itself (`module-add motion`)./app-securityCheck whether an app's own code can be attacked before it ships — vulnerable dependencies, secrets in the code and in git history, Next.js authorization gaps (Server Actions and route handlers without a session check, queries by id with no owner filter — IDOR), data over-exposure, secrets in public env vars, raw SQL — then read the flagged code against an OWASP checklist, with an opt-in dynamic level (Strix) that proves exploits against the app running locally. The fifth pre-deploy gate, beside compliance-audit, vercel-doctor, shadscan and launch-audit; reports and routes, never blocks. Triggers: "security review", "è sicura l'app?", "controllo di sicurezza prima del deploy", "IDOR", "secrets in the repo", "pentest". Not for: GDPR and legal (compliance-audit), UI quality (shadscan), cost (vercel-doctor), launch readiness (launch-audit), a review of one branch diff (Claude Code's /security-review), third-party registry code (registry-intake).npx claudepluginhub lukedj78/dev-flow --plugin dev-flow