nextjs-code-health

Runs linter, type checker, and static analysis to compute a 0-10 code quality score for Next.js projects.

Updated Sep 8, 2026
One-click install
npx skills add https://github.com/lucaszhh/agents --skill nextjs-code-health-lucaszhh
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: nextjs-code-health
Source: https://github.com/lucaszhh/agents/tree/main/skills/front/nextjs-code-health
Command: npx skills add https://github.com/lucaszhh/agents --skill nextjs-code-health-lucaszhh

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Manually running lint, typecheck, and structural audits across a Next.js codebase produces scattered output with no unified quality signal. This Skill executes all project quality checks, detects technical debt and architecture violations, and computes a single 0-10 health score with historical trend tracking. ## Core Features & Use Cases - Automated Quality Checks: Runs ESLint, TypeScript type checking, module structure analysis, and technical debt detection via a cross-platform Node.js script with no bash pipe dependencies. - Composite Scoring: Computes a 0-10 score from four weighted checks (linter 3pts, TypeScript 3pts, structure 2pts, debt 1pt) minus penalties for files over 1000 lines. - Persistent Reporting: Writes detailed reports to .agents/health/health-report.md and appends score history to .health-history.jsonl for trend analysis. - Use Case: Before a release, ask for a health check to get the current score, see whether it improved or regressed versus previous runs, and receive prioritized fix suggestions for lint errors, type errors, and monolithic files. ## Quick Start Run a full code health check on this project and show me the score with prioritized fixes.

Frequently Asked Questions about nextjs-code-health

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run a code quality check on a Next.js project?▼

Run the health check script with node scripts/check_code_health.mjs, which auto-detects your package manager and package.json scripts. It executes lint, typecheck, structure, and debt checks, then outputs a 0-10 score with fix suggestions.

How to get code quality metrics as JSON for CI pipelines?▼

Use the --json flag to emit structured metrics to stdout, and --save to append results to .health-history.jsonl. The script exits with code 1 when the score drops below 4, making it suitable for CI/CD quality gates.

Does the health check work with npm, yarn, and pnpm?▼

Yes, the script auto-detects the package manager by checking for pnpm-lock.yaml, yarn.lock, bun.lock, or package-lock.json, falling back to the packageManager field in package.json. It runs on Windows, macOS, and Linux without bash pipe dependencies.

What architecture violations does the module structure check detect?▼

It detects business logic placed in src/app/ instead of src/modules/, direct @mui/* imports outside the design system, date-fns/format imports bypassing the centralized date utility, and hardcoded React Query keys outside query/keys.ts files.

When should I not use a full code health check?▼

Skip it when you only need to run the linter, since pnpm run lint is faster directly. For debugging a specific bug use a debug workflow, and for reviewing a specific diff use a code review skill instead.