Setup Next.js Web
| This documentation was generated with the assistance of AI. Please report any inaccuracies. |
Scaffold a Next.js + TypeScript web application with create-next-app, driven entirely by explicit flags so saved
preferences can never leak in, then layer this catalog’s standard toolchain on top — Vitest with React Testing
Library and jsdom, ESLint flat config with eslint-config-next, Prettier, next typegen && tsc --noEmit,
Playwright against the production build, TypeDoc, optional Sonar, and either a GitHub Pages-ready static export or a
container-ready server build — plus a tested sample feature. It also brings an existing Next.js app up to the same
toolchain, announcing the mode and asking per artifact what to do with anything that already exists.
Purpose
iru-setup-nextjs-web gives a repository a Next.js app whose npm script names (lint, format, format:check,
typecheck, test, coverage, test:e2e, build, start, docs) are exactly the ones
Setup TypeScript GitHub Workflows calls for the nextjs flavor and the TypeScript gate skills
detect. The sample feature (a server-only data layer, async Server Component pages, a Client Component leaf, a Server
Action with Zod validation and an auth stub, Route Handlers, metadata, loading/error/not-found) is the living
example of the iru-nextjs-code-one-task references, adapted to static export or the Pages Router where needed.
Templates are kept in reference/ next to the skill (config-templates.md, app-router-samples.md,
pages-router-samples.md) and were verified in five router/output combinations. The cache-components choice
determines the 16-prev or 16-cc coding profile later tasks apply.
Following the catalog’s UI contract (see Building user interfaces) it also
writes a root .ui-quality.yml (even with e2e: none, because the coding skills read it) (accessibility: none skips the axe tooling and the assistive-technology template attributes) and, with
e2e: playwright, a Playwright component-testing project against a standalone Vite component gallery, the shared
e2e/support/ui-screenshots.ts helper and axe-core checks, so the sample LikeButton and the Home screen are
captured into .ui-screenshots/ across left-to-right/right-to-left × light/dark.
Plugin
Shipped by the iru-nextjs plugin of the ai-catalog marketplace (install with /plugin install iru-nextjs@ai-catalog; see Plugins).
Inputs
Everything is optional: the skill is invoked stand-alone, or driven by
Setup TypeScript Repository, which passes resolved values through args as newline-separated
key: value lines so the matching Step 2 questions are skipped.
| Argument | Required | Description | Default |
|---|---|---|---|
|
No |
Identity values written to |
Asked in Step 2 |
|
No |
|
Asked |
|
No |
|
Asked ( |
|
No |
|
|
|
No |
|
Asked |
|
No |
|
|
|
No |
|
|
|
No |
|
|
|
No |
|
Asked for |
|
No |
|
Asked (TypeDoc recommended) |
|
No |
|
|
|
No |
|
Lockfile present, else |
|
No |
Node major, used as the |
|
|
No |
|
Asked with |
|
No |
Only used to key the Sonar recommendation ( |
Resolved only if the Sonar question is asked; |
|
No |
|
Derived in Step 1 ( |
|
No |
|
|
Contradictions are resolved rather than obeyed and reported: output: static forces cache-components: no and
distribution: none, and router: pages forces cache-components: no.
Outputs
-
A Next.js app (
src/apporsrc/pages) scaffolded bycreate-next-appwith explicit flags,version0.1.0-dev.0,"private": true, and anext.config.tsvariant for the resolvedoutput/distribution. -
Vitest + React Testing Library + jsdom configuration (v8 coverage, 80% thresholds, lcov at
coverage/lcov.info), ESLint flat config, Prettier config, and the shared npm scripts listed in Purpose. -
The sample feature with colocated unit tests (scaffold-from-scratch runs only), plus
playwright.config.tsande2e/specs whene2e: playwright. -
.ui-quality.ymlat the repository root (accessibility,directions,themes), always written. Withe2e: playwrightalso the UI-contract files:e2e/support/ui-screenshots.ts, the component gallery underplaywright/(Vite config,next/link/next/navigation/next/imagestand-ins), thecomponentsPlaywright project with its gallerywebServer,src/components/like-button.story.tsx,e2e/components/like-button.spec.tsande2e/home.spec.ts, plus the@axe-core/playwrightandvitedev dependencies. Their captures go to the gitignored.ui-screenshots/component/LikeButton/and.ui-screenshots/screen/Home/. -
typedoc.jsonwhendocs-tool: typedoc;sonar-project.propertieswhensonaris notnone;Dockerfileand.dockerignorewhendistribution: internal. -
.gitignoreadditions for Playwright,.ui-screenshots/, TypeDoc and the integration-test lock. -
A final report with the mode, per-artifact action (created / updated / replaced / kept as is / removed), resolved options and their sources, every verification result (including the screenshot count under
.ui-screenshots/and any accessibility violation rule ids), the.ui-quality.ymlaction andaccessibilitylevel, and explicit warnings (auth stub, in-memory store, static-export limits, secrets).
Execution flow
Dependencies
Invokes
None — iru-setup-nextjs-web is a leaf skill; it does not call any other skill in this catalog. It runs
npx create-next-app, the package manager, Playwright, TypeDoc and Docker directly. It mentions
Setup Readme (owns the README), Setup TypeScript Gitignore (maintains
the full .gitignore) and Check License only as follow-ups for the user or orchestrator.
Invoked by
-
Setup TypeScript Repository — Step 5, flavor nextjs scaffold, via the
iru-isolated-skill-executoragent.
Source
SKILL.md on GitHub — the file this page was generated from.