init-nextjs
Installation
SKILL.md
Initialize a New Next.js App
Ask for the project name if not given, then run the phases in order. All @latest tags resolve to current stable at install time — no doc lookups.
1. Create
npx create-next-app@latest <name> --yes
All subsequent commands run inside the <name>/ directory.
2. Prettier
npm i -D prettier eslint-config-prettier
- Write
<name>/.prettierrc→{} - Read
<name>/eslint.config.mjs. Addimport eslintConfigPrettier from "eslint-config-prettier/flat";near the other imports, then appendeslintConfigPrettieras the last element of theeslintConfigarray (after the...compat.extends(...)spread).
3. Husky + lint-staged
npm i -D husky lint-staged
npx husky init
- Overwrite
<name>/.husky/pre-commitwith:npx lint-staged - Add to
<name>/package.json:"lint-staged": { "*": "prettier --ignore-unknown --write" }
4. Verify
npx prettier --write .
npm run lint
Fix any errors before declaring success. Tell the user the project path and that commits now auto-format.