agentleFS
NikoxkxNikoxkx/Agent-Skills/skills/web-development/nextjs-app-scaffold/SKILL.md

nextjs-app-scaffold

Skill1 starsChanged 5 months agoApache-2.0View on GitHub

Scaffolds a production Next.js 14+ App Router project with TypeScript, Tailwind, ESLint, Prettier, testing, and CI. Use when starting a new Next.js project from scratch.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Add: zod, clsx, tailwind-merge, @hookform/resolvers, react-hook-form (common), lucide-react or heroicons.

    line 39

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Overview

Provides a complete, production-ready Next.js 14+ (App Router) project scaffold including recommended directory structure, TypeScript strict config, Tailwind, ESLint + Prettier, testing setup (Jest or Vitest + React Testing Library), basic CI with GitHub Actions, environment variable conventions, middleware example, image optimization config, and a Vercel deployment checklist.

When to Use This Skill

  • Starting a brand new Next.js project.
  • The user says "create a new Next.js app", "scaffold Next.js", or "set up a Next.js project with best practices".
  • You want to avoid the default create-next-app minimal setup and jump straight to a hardened production template.

Prerequisites

  • Node.js 18.17+ or 20+.
  • npx create-next-app@latest or manual setup.
  • Git initialized.
  • Vercel account (recommended for deployment) or other hosting.

Steps

  1. Initialize the project:
    npx create-next-app@latest . --yes --tailwind --eslint --yes --app
  2. Upgrade to latest stable and install additional deps:
    • typescript, @types/node, react, react-dom (already there).
    • Add: zod, clsx, tailwind-merge, @hookform/resolvers, react-hook-form (common), lucide-react or heroicons.
    • Dev: prettier, eslint-config-prettier, husky, lint-staged, @testing-library/react, jest or vitest.
  3. Directory structure (create these folders):
    app/
      (marketing)/          # route groups
      (dashboard)/
      api/
    components/
    lib/                    # utils, constants, db clients
    hooks/
    types/
    middleware.ts
    next.config.mjs         # hardened
  4. Configure next.config.mjs with security and performance:
    • Headers for security.
    • Image remote patterns.
    • Experimental features if needed.
    • Output: 'standalone' for Docker if relevant.
  5. Set up environment variables:
    • .env.example
    • NEXT_PUBLIC_ for client-exposed.
    • Server-only vars loaded via process.env with Zod validation in lib/env.ts.
  6. Add middleware for auth redirects, i18n, etc.
  7. Linting & formatting:
    • .eslintrc.json extending recommended + prettier.
    • .prettierrc
    • lint-staged + husky pre-commit hook.
  8. Testing setup:
    • Jest/Vitest config.
    • Example test for a component.
    • testing-library setup.
  9. GitHub Actions CI (.github/workflows/ci.yml):
    • Install, lint, typecheck, test, build.
  10. Vercel / deploy checklist:
    • Environment variables in dashboard.
    • Preview deployments.
    • Custom domain + HTTPS.
    • Analytics + Speed Insights.

Examples

Full next.config.mjs, lib/env.ts Zod schema, sample app/layout.tsx with metadata, middleware example, and CI workflow are provided in the skill output.

Edge Cases & Error Handling

  • Monorepo: Note adjustments for Turborepo or Nx.
  • Internationalization: Recommend next-intl or built-in.
  • Authentication: Suggest adding next-auth or Lucia in a follow-up step.
  • Database: Prisma or Drizzle setup guidance.

Verification

  1. npm run dev — app runs cleanly.
  2. npm run build — successful production build.
  3. npm run lint and typecheck pass.
  4. Run tests.
  5. Deploy to Vercel preview and verify.
  6. Success: Project starts with all modern best practices, zero config debt on day one.

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.