nextjs-init
- Repo stars 38
- License MIT
- Author updated Live
- Author repo builder-skills
- Domain
- Engineering
- Compatible agents
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- Trust score
- 94 / 100 · audit passed
- Author / version / license
- @kazdenc · MIT
- Token usage
- Lean
- Setup complexity
- Guided setup
- External API key
- Not required
- Operating systems
- Linux
- Runtime requirements
- No special requirements
- Permissions
-
- Read-only
- Write / modify
- Shell exec
- Env read
- Network behavior
- Local-only
- Install commands
- 26 variants
Profile is derived at build time from SKILL.md and install vectors. Subject to drift from author intent.
Heads up: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: nextjs-init
description: Scaffold a Next.js project with App Router, TypeScript, Tailwind CSS, and opinionated defaults.…
category: engineering
runtime: no special runtime
---
# nextjs-init output preview
## PART A: Task fit
- Use case: Scaffold a Next.js project with App Router, TypeScript, Tailwind CSS, and opinionated defaults. Use when user says "start a new project", "scaffold Next.js", "init app", "new Next.js app", "create project", or needs a production-ready project foundation..
- Inputs: target material, constraints, expected output, and acceptance criteria.
- Evidence boundary: follow “Step 1: Run create-next-app / Step 2: Set Up Directory Structure / Step 3: Configure TypeScript” and do not present inference as author intent.
## PART B: Execution result
- **01** The card summarizes the use case; runtime output centers on “Scaffold a Next.js project with App Router, TypeScript, Tailwind CSS, and opinionated defaults. Use when user says "start a new project", "scaffold Next.js", "init app", "new Next.js app", "create project", or needs a production-ready project foundation.”.
- **02** When the source has headings, the agent prioritizes “Step 1: Run create-next-app / Step 2: Set Up Directory Structure / Step 3: Configure TypeScript” so the result follows the author’s structure.
- **03** Typical output includes task judgment, concrete steps, required commands or file edits, validation, and follow-up options.
- **04** Risk context follows the fingerprint: read files, write/modify files, run shell commands, read environment variables; mostly runs locally; usually needs no extra API key.
## Running Rules
- read files, write/modify files, run shell commands, read environment variables; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding scope.
- Return the result, validation criteria, and next iteration options. The source does not require a stable slash command. After installation, invoke the skill by name and describe the task.
Name target files or source material, expected output, forbidden changes, and whether network or shell access is allowed. Permission fingerprint: read files, write/modify files, run shell commands, read environment variables.
Start with a small task and check whether the result follows “Step 1: Run create-next-app / Step 2: Set Up Directory Structure / Step 3: Configure TypeScript”. Inspect diffs, logs, previews, or tests before expanding scope.
Confirm the final output includes a concrete result, evidence, and next action. If it stays generic, tighten inputs, boundaries, and acceptance criteria.
---
name: nextjs-init
description: Scaffold a Next.js project with App Router, TypeScript, Tailwind CSS, and opinionated defaults.…
category: engineering
source: kazdenc/builder-skills
---
# nextjs-init
## When to use
- Scaffold a Next.js project with App Router, TypeScript, Tailwind CSS, and opinionated defaults. Use when user says "st…
- Use it when the task has clear inputs, repeatable steps, and validation criteria.
## What to provide
- Target material, scope, expected result, and forbidden changes.
- Whether network, commands, file writes, or external services are allowed.
## Execution rules
- Organize steps around “Step 1: Run create-next-app / Step 2: Set Up Directory Structure / Step 3: Configure TypeScript” and keep inference separate from source facts.
- read files, write/modify files, run shell commands, read environment variables; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding the task.
## Output requirements
- Return the deliverable, key evidence, validation method, and next action.
- Mark missing information as unknown; do not invent commands, platforms, or dependencies. The author source anchors workflow facts; repository files anchor sources and commands; Fluxly only adds fit, limitations, and quality judgment.
skill "nextjs-init" {
input -> user goal + target files + boundaries + acceptance criteria
context -> Step 1: Run create-next-app / Step 2: Set Up Directory Structure / Step 3: Configure TypeScript
rules -> SKILL.md triggers / order / output contract
runtime -> no special runtime | read files, write/modify files, run shell commands, read environment variables | mostly runs locally
guardrails -> usually needs no extra API key + small-sample validation + diff/log review
output -> copyable result + checklist + next iteration
} Next.js Project Scaffold
Create a production-ready Next.js project with App Router, TypeScript, and Tailwind CSS. If the user provides a target, use it as the project name. Otherwise, ask.
Step 1: Run create-next-app
Execute this command, replacing <project-name> with the target:
npx create-next-app@latest <project-name> \
--typescript \
--tailwind \
--eslint \
--app \
--src-dir \
--import-alias "@/*" \
--use-pnpm
If the user prefers npm or yarn, swap --use-pnpm accordingly. Default to pnpm.
Step 2: Set Up Directory Structure
Create these directories inside src/:
src/
app/ # Routes and layouts (created by create-next-app)
(auth)/ # Auth route group
(dashboard)/ # Main app route group
api/ # API routes
layout.tsx # Root layout
page.tsx # Landing page
components/
ui/ # Reusable primitives (Button, Input, Card)
forms/ # Form components
layout/ # Header, Footer, Sidebar, Nav
lib/
utils.ts # Shared utility functions
constants.ts # App-wide constants
types/
index.ts # Shared TypeScript types
hooks/ # Custom React hooks
styles/
globals.css # Already created by create-next-app
mkdir -p src/{components/{ui,forms,layout},lib,types,hooks,app/{\\(auth\\),\\(dashboard\\),api}}
Step 3: Configure TypeScript
Verify tsconfig.json has these settings. Patch if missing:
{
"compilerOptions": {
"strict": true,
"noUncheckedIndexedAccess": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"@/*": ["./src/*"]
}
}
}
| Setting | Why |
|---|---|
strict: true |
Catches type errors early. Non-negotiable. |
noUncheckedIndexedAccess |
Forces handling of undefined from array/object access |
forceConsistentCasingInFileNames |
Prevents deploy failures on case-sensitive Linux servers |
Step 4: Configure ESLint
Extend .eslintrc.json:
{
"extends": [
"next/core-web-vitals",
"next/typescript"
],
"rules": {
"prefer-const": "error",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }]
}
}
Step 5: Add Prettier
pnpm add -D prettier prettier-plugin-tailwindcss
Create .prettierrc:
{
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"plugins": ["prettier-plugin-tailwindcss"]
}
Create .prettierignore:
node_modules
.next
dist
pnpm-lock.yaml
Step 6: Environment Setup
Create .env.local with a template:
# App
NEXT_PUBLIC_APP_URL=http://localhost:3000
# Database (fill in after setting up Supabase or other DB)
# DATABASE_URL=
# Auth (fill in after setting up auth provider)
# NEXTAUTH_SECRET=
# NEXTAUTH_URL=http://localhost:3000
Create .env.example with the same keys but no values. Ensure .env.local is in .gitignore (create-next-app does this by default).
Step 7: Starter Root Layout
Replace src/app/layout.tsx with:
import type { Metadata } from 'next'
import { Inter } from 'next/font/google'
import '@/styles/globals.css'
const inter = Inter({ subsets: ['latin'] })
export const metadata: Metadata = {
title: 'App Name',
description: 'App description',
}
export default function RootLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
</html>
)
}
Step 8: Add Utility Helpers
Create src/lib/utils.ts:
import { type ClassValue, clsx } from 'clsx'
import { twMerge } from 'tailwind-merge'
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
Install the dependencies:
pnpm add clsx tailwind-merge
Step 9: Verify
Run these checks before handing off:
pnpm build # Must compile without errors
pnpm lint # Must pass with zero warnings
Post-Scaffold Checklist
| Task | Status |
|---|---|
create-next-app ran with correct flags |
|
| Directory structure created | |
| TypeScript strict mode enabled | |
| ESLint configured | |
| Prettier + Tailwind plugin installed | |
.env.local template created |
|
.env.example created (no secrets) |
|
| Root layout uses Inter font + metadata | |
cn() utility installed |
|
pnpm build passes |
|
pnpm lint passes |
Decide Fit First
Design Intent
How To Use It
Boundaries And Review