ワンクリックで
create-node-api
Scaffold a production-ready Node.js API — choose Express TypeScript or NestJS, then select database, auth, and extras.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Scaffold a production-ready Node.js API — choose Express TypeScript or NestJS, then select database, auth, and extras.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Scaffold a new React (Vite), Next.js, or React Native project from scratch, then interactively add integrations. Always installs latest package versions.
Scaffold a Turborepo monorepo with shared packages, then set up each app using the existing /create-frontend-project, /setup-project, and /scaffold-app flows.
Scaffold a production-ready folder structure, base components, routing, types, and env setup for an already-configured React (Vite), Next.js, or React Native project. Run after /setup-project.
Generate a CLAUDE.md file for the current project. Claude Code reads this automatically at the start of every session — it captures the full stack, folder conventions, critical rules, and commands so Claude never needs to re-discover the project setup.
Interactively add integrations to an existing React (Vite), Next.js, or React Native project. Presents options filtered by project type and installs latest versions.
Scaffold a new React (Vite), Next.js, or React Native project from scratch, then interactively add integrations. Always installs latest package versions.
| name | create-node-api |
| description | Scaffold a production-ready Node.js API — choose Express TypeScript or NestJS, then select database, auth, and extras. |
You are a Node.js API scaffolding assistant. Your job is to create a production-ready Node.js API and guide the user through selecting integrations.
~/.claude/project-scaffolding/reference/node/express-api.md~/.claude/project-scaffolding/reference/node/nestjs-api.mdBefore asking anything, check whether you are inside a Turborepo monorepo:
turbo.json in the current directory or up to 3 parent directoriespackage.json with a "workspaces" field and an apps/ directoryIf a monorepo is detected:
Read the root package.json to get the monorepo name. List any existing apps in apps/.
Then ask:
"You're inside the
<monorepo-name>monorepo. Where do you want to create this API? A) Add as a new app in this monorepo (creates inapps/<name>) B) Create as a standalone API (creates in the current directory)"
If no monorepo is detected: Skip and proceed to Step 1.
Store as CONTEXT: monorepo | standalone — affects Steps 2, 7, and the final commit.
Ask:
"Which Node.js framework do you want? A) Express (TypeScript) — lightweight, full control, minimal opinions B) NestJS (TypeScript) — opinionated, decorators, Angular-like DI, great for large teams"
Ask:
"What should the project be named? (kebab-case, e.g.
my-api)"
Ask:
"Which database setup do you need? A) PostgreSQL + Prisma (recommended — great DX, migrations, type safety) B) PostgreSQL + Drizzle (lighter — better for serverless/edge) C) MongoDB + Mongoose (document database) D) No database (pure API / proxy)"
Ask:
"Do you need authentication? A) JWT auth (access + refresh tokens, argon2 hashing) B) API key auth (simple header-based) C) No auth"
Ask (user can select multiple, or none):
"Which extras do you want? (comma-separated, e.g.
1,3ornone)
- BullMQ job queues (Redis-backed background jobs)
- Swagger / OpenAPI docs
- File uploads (multer)
- WebSockets
- None"
Based on the framework chosen in Step 1, read the relevant reference file now:
~/.claude/project-scaffolding/reference/node/express-api.md~/.claude/project-scaffolding/reference/node/nestjs-api.mdFollow it exactly to scaffold the project.
Navigate to apps/ at the monorepo root first:
cd <monorepo-root>/apps
Create the project there. After creation, run yarn install from the monorepo root (not inside the app). Use the monorepo root's existing git repo — do NOT run git init.
Create in the current directory. Run git init as part of the final commit step.
cd into itpackage.json (yarn)tsconfig.json, tsup.config.tssrc/config/env.ts — Zod env validation (fails fast at startup)src/config/logger.ts — Pino loggersrc/middleware/ — error handler, request loggersrc/modules/health/ — health + readiness endpointssrc/app.ts + src/server.ts — app/server split (no port in app.ts)Dockerfile (multi-stage), docker-compose.yml (full stack), docker-compose.dev.yml (databases only), .dockerignore, .env.example, .gitignoreyarn install then yarn build to verify compilationgit init && git add . && git commit -m "chore: init express api"
If monorepo: cd <monorepo-root> && git add apps/<name> && git commit -m "feat: add <name> express api to monorepo"nest new <project-name> --strict --package-manager=npmsrc/config/ — Zod env validation via ConfigModule.forRoot({ validate })src/common/ — global filter, interceptor, guard, pipessrc/main.ts — Helmet, CORS, ValidationPipe, enableShutdownHooks, Swaggersrc/modules/health/ with @nestjs/terminusDockerfile (multi-stage, non-root user), docker-compose.yml (full stack), docker-compose.dev.yml (databases only), .dockerignore, .env.examplenpm run build to verify compilationgit add . && git commit -m "chore: init nestjs api"
If monorepo: cd <monorepo-root> && git add apps/<name> && git commit -m "feat: add <name> nestjs api to monorepo"✓ Project: <name>/
Structure:
src/
config/ — env validation (Zod), logger (Pino)
middleware/ — error handler, auth, request logging
modules/ — feature modules (health[, auth, ...])
app.ts — Express setup (testable, no port binding)
server.ts — port binding + graceful shutdown
Commands:
yarn dev — start with hot reload (tsx watch)
yarn build — compile to dist/ (tsup)
yarn start — run compiled dist/server.js
yarn test — run tests (Vitest)
[If Docker compose]:
npm run docker:dev — start databases only (for local dev)
npm run docker:up — start full stack in Docker (API + databases)
npm run docker:down — stop all containers
npm run docker:logs — tail API logs
Health endpoints:
GET /healthz — liveness
GET /readyz — readiness (checks DB + Redis)
Working endpoints after scaffold:
POST /api/v1/auth/register — create account
POST /api/v1/auth/login — get JWT token
GET /api/v1/auth/me — current user (protected)
GET /api/v1/users — list users (protected)
GET /api/v1/users/:id — get user (protected)
PATCH /api/v1/users/:id — update user (protected)
DELETE /api/v1/users/:id — delete user (protected)
Quick test:
docker compose up -d && npx prisma migrate dev --name init && yarn dev
Add a new module:
src/modules/<feature>/controller.ts|service.ts|routes.ts|schema.ts
Register in src/app.ts
✓ Project: <name>/
Structure:
src/
config/ — env validation (Zod via ConfigModule), app config
common/ — filters, interceptors, guards, decorators
modules/ — feature modules (health[, auth, ...])
app.module.ts — root module
main.ts — bootstrap with global middleware + Swagger
Commands:
npm run start:dev — start with hot reload
npm run build — compile
npm run start:prod — run compiled code
npm run test — unit tests (Jest)
npm run test:e2e — end-to-end tests
[If Swagger enabled]:
http://localhost:3000/api/docs — interactive API docs
[If Docker compose]:
npm run docker:dev — start databases only (for local dev)
npm run docker:up — start full stack in Docker (API + databases)
npm run docker:down — stop all containers
npm run docker:logs — tail API logs
Working endpoints after scaffold:
POST /api/v1/auth/register — create account
POST /api/v1/auth/login — get JWT token
GET /api/v1/auth/me — current user (protected)
GET /api/v1/users — list users (protected)
PATCH /api/v1/users/:id — update user (protected)
DELETE /api/v1/users/:id — delete user (protected)
GET /api/v1/health — health + DB check
Swagger UI: http://localhost:3000/api/docs
Quick test:
docker compose up -d && npx prisma migrate dev --name init && npm run start:dev
Add a new module:
nest generate module modules/<feature>
nest generate controller modules/<feature>
nest generate service modules/<feature>
Register in app.module.ts imports
After printing the summary, ask:
"Want me to start the dev server now? A) Yes — start it now (runs in the background, output will appear here) B) No — I'll run it myself
Note: If you chose a database, make sure to run
yarn docker:dev(ornpm run docker:dev) andnpx prisma migrate dev --name initfirst."
If A — start it now:
Run the correct dev command in the background using the Bash tool with run_in_background: true:
cd <project-dir> && yarn devcd <project-dir> && npm run start:devAfter launching, tell the user:
"Dev server started in the background. API running at: http://localhost:3000 [If Swagger] Swagger docs: http://localhost:3000/api/docs Output will appear here when the server is ready.
If you have a database selected, make sure Docker is running first: yarn docker:dev (starts DB containers) npx prisma migrate dev --name init"
If B — user runs it themselves:
Show the exact commands:
"Run these in your terminal:
cd <project-name> yarn docker:dev # start database (Docker) npx prisma migrate dev --name init # run migrations (if Prisma) yarn dev # Express # or npm run start:dev # NestJS ```"
After the dev server question is resolved, always generate CLAUDE.md without asking.
Follow the complete generate-claude-md skill from Step 1 through Step 6:
CLAUDE.md to the project root, commit itTell the user after generating:
"Generated
CLAUDE.md— Claude will read this automatically at the start of every future session in this project. No need to explain the stack again."
app.ts (Express config) from server.ts (port + graceful shutdown)tsx watch for dev, tsup for production build — NOT ts-nodesrc/config/env.ts — fail fast at startupsrc/modules/APP_GUARD, APP_FILTER, APP_INTERCEPTOR, APP_PIPE tokens for DI-aware global registration — not useGlobalX() in main.ts when you need injectionValidationPipe globally with whitelist: true, forbidNonWhitelisted: true, transform: truenestjs-pino for logging, not the built-in Logger (in production)@nestjs/config + Zod validate function for env validation@nestjs/bullmq (NOT @nestjs/bull — Bull v3 is deprecated)app.enableShutdownHooks() before app.listen() for Kubernetes-safe graceful shutdownnest-cli.json to eliminate @ApiProperty boilerplate