Scaffolds a NestJS 12 Fastify+TypeORM backend from zero, standalone or apps/api monorepo. Bootstrap a brand-new NestJS backend from scratch following the house convention: NestJS + Fastify + TypeORM(PostgreSQL), Admin/Client dual-interface domain modules, fail-fast env validation, multi-doc Swagger, Docker/K8s-ready observability. Phase 0 decides where it lives: a standalone package at the repo root, or apps/api inside a pnpm workspace monorepo alongside packages/contracts. Use this whenever the user wants to start/set up/scaffold a new Nest project with this stack, phrases like "새 nestjs 프로젝트 세팅해줘", "nest 서버 하나만 만들어줘", "standalone nest 프로젝트", "이 컨벤션대로 백엔드 만들어줘", "bootstrap a Nest backend", "set up the api app in our monorepo", "scaffold a Fastify + TypeORM service". Do NOT use this for: adding a domain to an already-bootstrapped project (use nestjs-domain-module), generating a migration (use nestjs-migration), AWS-serverless-style Nest bootstrap (a different skill/stack), or non-NestJS backends.
Ships in backend. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Orchestrates a full project scaffold from the house convention. This file is the
control flow: run the phases in order, pass each phase's gate, and stop
(don't cascade) on failure. The actual file contents for each phase live in
references/*.md — read the referenced file at the top of each phase, then write
the files. Only two phases delegate to other skills; the rest you execute inline.
app.module before the config layer exists).skipped and continue.
Re-running this skill on a half-built project should finish it, not clobber it.docker compose / installs, should be surfaced before running if the user
hasn't already said "just do it".| # | Phase | Reference | Gate | Delegates |
|---|---|---|---|---|
| 0 | Preflight | — | pnpm ≥ 11 present, host node on the latest LTS major (NODE_LTS) or newer, target dir + layout decided | — |
| 1 | Layout | references/layout.md | monorepo: pnpm-workspace.yaml (with injectWorkspacePackages: true) + apps/api + packages/contracts + root packageManager/engines · standalone: single root package.json with packageManager/engines, no workspace | — |
| 2 | Dependencies | references/dependencies.md | pnpm install exits 0 | — |
| 3 | Build config | references/build-config.md | config files exist (compile+lint deferred — src/ is empty, so any tsc incl. --showConfig/--noEmit fails TS18003 & lint exits 1 (no files); real gate at Phase 13) | — |
| 4 | Config / env | references/config-env.md | Joi schema + repo-root .env.example (no apps/api/.env*, no bare PORT) + registerAs + Stage enum exist | — |
| 5 | Persistence | references/persistence.md | DataSource + CoreEntity/SoftDeletableEntity + migration scripts | — |
| 6 | App bootstrap | references/bootstrap-app.md | main.ts (§4 order) + app.module + module-groups.ts | — |
| 7 | Observability | references/observability.md | exception filter + terminus health + pino logging wired | — |
| 8 | Swagger | references/swagger.md | setSwagger() uses shared arrays behind isLocalLike guard | — |
| 9 | Common module | references/common.md | Pagination DTO + PaginatedResDto + transform helpers | — |
| 10 | Infra | references/infra.md | Dockerfile + docker-compose + .dockerignore | — |
| 11 | Test setup | references/testing.md | vitest config (.mts) + e2e ready() note + test-DB split | — |
| 12 | First domain | — | domain files created + registered in shared arrays | Skill: backend:nestjs-domain-module, then Skill: backend:nestjs-migration |
| 13 | Verify | — | app boots, /api/health green, /docs loads | — |
Create one todo per phase so progress is visible and resumable.
0 · Preflight. Confirm pnpm -v (≥11 — the allowBuilds flow in phase 2 and the Dockerfile assume it; measured on 11.28 and 12.25) and node -v.
The scaffold targets the latest LTS major of Node, resolved now and not from memory, because the answer moves every October:
NODE_LTS=$(node -e 'fetch("https://nodejs.org/dist/index.json").then(r=>r.json()).then(d=>console.log(parseInt(d.find(v=>v.lts).version.slice(1))))' 2>/dev/null || echo 26)
(26 is the offline fallback: Node 26 "Lithium", LTS since 2026-10-28.) Three places take this
value, and every 26 in the references stands for it: engines.node (>=26, layout.md), every
Dockerfile FROM node:26-alpine (infra.md) and @types/node@^26 (dependencies.md). The host's
node -v major has to be NODE_LTS or newer: phase 13 verifies on the host's Node, and a pass on
an older major proves nothing about the runtime the project pins (pnpm only prints
Unsupported engine on every command and carries on). On an older host, stop and
ask the user to install it with their version manager (nvm install --lts, fnm install --lts);
do not switch their default Node yourself. A repo that already pins engines.node keeps its pin:
report it when it sits below NODE_LTS and leave raising it to the user.
NestJS 12 itself runs on Node 22.12+ (or 20.19+), and so does the nest CLI (@nestjs/cli 12 declares
>= 20.11). @nestjs/schematics and @angular-devkit/* declare
^22.22.3 || ^24.15.0 || >=26.0.0, which Node 26 satisfies: the whole scaffold, migrations through
ts-node included, ran on 26.14.0 with no engine warning (measured 2026-12-01).
Then decide the layout — it changes phases 1, 2, 10, 12, 13 and nothing else:
apps/api in a pnpm workspace, with packages/contracts.Look before asking: an existing pnpm-workspace.yaml or apps/ directory settles it
(add apps/api). Greenfield, default to monorepo if a Next.js FE is in the
picture — nextjs-bootstrap joins as apps/web and shares packages/contracts —
otherwise ask, and don't scaffold a whole workspace for a single service the user
never asked to share. Standalone is not a one-way door; layout.md documents the
convert-to-monorepo steps. Gate: toolchain present + target dir and layout agreed.
1 · Layout. Read references/layout.md and write the layout chosen in phase 0.
Every later phase writes relative to the api root — apps/api in monorepo mode,
the repo root standalone.
Monorepo: pnpm-workspace.yaml carrying injectWorkspacePackages: true
(required for pnpm deploy in the prod Dockerfile; pnpm 11 ignores the .npmrc spelling
of this setting, so never put it there; write the key before the first install so the
lockfile records it), root package.json with
packageManager: pnpm@<the host's pnpm -v> + engines.node >=26 (NODE_LTS, phase 0), apps/api, and packages/contracts
(the FE/BE shared contracts package). Gate: workspace resolves (pnpm -r ls runs).
Standalone: one root package.json carrying packageManager + engines + the api
scripts. No pnpm-workspace.yaml, no injectWorkspacePackages, no packages/contracts — the
inject setting only serves pnpm deploy across workspace links, which standalone
doesn't use. Gate: pnpm ls runs and no workspace file was created. (Phase 2 adds a
pnpm-workspace.yaml holding only the allowBuilds answers, no packages: key, so it is
not a workspace; dependencies.md.)
2 · Dependencies. Read references/dependencies.md. Add the minimal bundle +
observability extras to the api root, every @nestjs/* on major 12 (GA since
2026-08-27; all of them ship ESM-only, which is why phase 3's tsconfig says nodenext).
The bundle includes @fastify/static (Swagger UI on Fastify — else boot crashes in
local/docker) and fastify pinned to platform-fastify's exact version (else a
dual-fastify type clash) — install once without it, read the pin off the installed
@nestjs/platform-fastify/package.json, then add it --save-exact (npm's latest and
pnpm's release-age-filtered pick can differ by a patch; dependencies.md). Versions follow one
rule: install the newest, then pnpm peers check names what has to step down, which today is
@fastify/static to ^10, typeorm to ^0.3 and typescript to ^6. Run pnpm install --filter api...
(standalone: pnpm install from the repo root — drop every --filter api in this
skill's commands). pnpm exits 1 after the install with ERR_PNPM_IGNORED_BUILDS: the
packages are installed but no allowBuilds answer is written. Write the answers into pnpm-workspace.yaml yourself
(dependencies.md) or every later pnpm <script> fails the same way.
Gate: install exits 0, node_modules for api is populated, pnpm --filter api why fastify (standalone: pnpm why fastify) shows a single version, pnpm peers check finds no
issues, and a second pnpm install exits 0 (proves the allowBuilds answer landed). Fallback: on install failure, surface the resolver
error and stop — every later phase compiles against these deps.
3 · Build config. Read references/build-config.md. Write tsconfig.json
(strict: true, decorator metadata, skipLibCheck + esModuleInterop +
module/moduleResolution:"nodenext" + isolatedModules + rootDir:"." +
types:["node","vitest/globals"] — required on TS 6 / Nest 12 ESM packages / pnpm; no
baseUrl, no typeRoots; CJS output stays, there is no "type":"module"),
tsconfig.build.json (emit-only, excludes tests), nest-cli.json (asset copy),
.oxlintrc.json + .prettierrc (oxlint type-aware, the nest new 12 default — no ESLint
stack), and the package.json scripts (test uses vitest run --passWithNoTests). No path
aliases (§10.4). Gate: config files exist. Do NOT run any tsc (incl. --showConfig) or
pnpm lint here — src/ is empty, so they fail with TS18003 / oxlint "No files found to lint" exit 1 (not a defect;
under TS 6 --showConfig runs input discovery too). The compile+lint gate is deferred to the Phase 13
build, since main.ts (phase 6) forward-references phase 7–8 files.
4 · Config / env. Read references/config-env.md. Write env.validation.ts
(Joi), .env.example, the repo-root .gitignore (.env* with !.env.example,
node_modules, dist, coverage), config/namespaces/*.config.ts (registerAs), and the Stage
enum + isLocalLike helper. Gate: files present and referenced consistently, and
git check-ignore -q .env.example exits 1.
Fallback: if the user hasn't provided real values, .env.example documents
them and .env stays uncommitted — don't invent secrets.
5 · Persistence. Read references/persistence.md. Write
src/entities/data-source.ts (synchronize:false, migrationsRun:false, pool
cap), src/entities/common/core.entity.ts (CoreEntity + SoftDeletableEntity),
and generate-migration.ts. Gate: DataSource imports the Stage helper and glob
paths are correct.
6 · App bootstrap. Read references/bootstrap-app.md. Write main.ts in the
exact §4 order (transactional context → Fastify+qs → ValidationPipe → cors/cookie
→ prefix+versioning → serializer → exception filter → shutdown hooks → Swagger
guard → listen), app.module.ts (TypeOrmModule.forRootAsync + transactional
dataSourceFactory, ConfigModule with the Joi schema), and module-groups.ts (empty
CLIENT_MODULES / ADMIN_MODULES to be filled by domain modules). Gate: the
three files exist and module-groups.ts arrays are imported by both AppModule and
Swagger.
7 · Observability. Read references/observability.md. Write
AllExceptionsFilter (normalizes HttpException, logs 5xx with stack, supports a
machine-readable code), terminus /health (DB ping), and nestjs-pino logging.
Gate: filter registered globally in main.ts, health controller reachable.
8 · Swagger. Read references/swagger.md. Write setSwagger() building
Admin/Client/All docs from the shared arrays, mounted at /docs*, guarded by
isLocalLike(stage). Gate: setSwagger reads the same arrays as AppModule (no
second registration path).
9 · Common module. Read references/common.md. Write src/common:
PaginationDto, PaginationMetaDto, PaginatedResDto, and transform
helpers (stringToBoolean). Gate: DTOs use @Expose() and the list wrapper is
an abstract base for domains to extend.
10 · Infra. Read references/infra.md. Write the multi-stage Dockerfile
(+ Dockerfile.debug), root docker-compose.yml (app + pinned postgres:16),
and root .dockerignore. Compose and .dockerignore live at the repo root with
context . in both layouts — one docker compose up per repo, and Docker only
reads the .dockerignore next to the context. In monorepo mode the Dockerfile
COPYs pnpm-workspace.yaml alongside the lockfile. It carries
injectWorkspacePackages, without which pnpm deploy --prod fails and the prod image
never builds (§10.1 / layout.md); standalone uses pnpm prune --prod instead, since
pnpm deploy requires a workspace. The monorepo Dockerfile.debug sets
ENV pnpm_config_verify_deps_before_run=false: it installs only --filter api..., and
pnpm 11's pre-run check re-installs the whole workspace as soon as the bind mount shows
another project (e.g. apps/web), which dies with ERR_PNPM_ABORTED_REMOVE_MODULES_DIR_NO_TTY
(infra.md).
If a root docker-compose.yml already exists (a sibling app's bootstrap wrote it),
merge into it — add only the missing service, reuse its db, never rewrite it
wholesale (infra.md → "Merging into an existing root docker-compose.yml").
Gate: images are version-pinned (no latest), every ${VAR} carries a :-default, container
runs as non-root, pre-existing compose services survive with no host port bound twice,
and the prod image actually runs dist/main.js — monorepo via
pnpm --filter api deploy --prod /out (/out/dist/main.js +
node_modules/@app/contracts), standalone via the pruned node_modules.
Before that gate, create the repo-root .env if it is missing: [ -f .env ] || cp .env.example .env
from the repo root, the one .env in both layouts, never apps/api/.env (config-env.md). Phase 4
wrote only the example, and from here on everything that reaches the DB reads .env: the dev-container
check in infra.md's gate, phase 12's migration and phase 13. Do it even when this phase is otherwise skipped.
11 · Test setup. Read references/testing.md. Write vitest.config.mts +
vitest.config.e2e.mts (unit colocated *.spec.ts, e2e under test/; .mts, or Vite warns
on every run), the e2e Fastify ready() reminder, and initializeTransactionalContext() in
setupFiles. vitest is nest new 12's runner and loads the ESM-only @nestjs/* from this
CJS scaffold with no flags (testing.md). Gate: pnpm test picks up config (0 tests passing is
fine — the script carries --passWithNoTests).
12 · First domain. Delegate — do not hand-write the domain:
Skill(backend:nestjs-domain-module) with
{ domainName: <chosen>, interfaces: ["admin","client"], entity: {...}, useContracts: <monorepo> }
— useContracts is true in monorepo mode and false standalone (there is no
contracts package to implement against). <chosen> is the domain of the seeded contract
when one exists (UserSummary in packages/contracts gives user); otherwise ask. A
non-interactive or pre-approved run takes that domain (no seed: user) and marks it assumed.
Take its output; confirm the module was registered in module-groups.ts.migrationNeeded: true, Skill(backend:nestjs-migration) with
{ name: "Create<Pascal>" }. Honor its gate: if verdict: "needs-review",
stop and surface destructiveOps before applying.
Where the runtime has no Skill(...) call, read that sibling skill's own SKILL.md in this
plugin and follow it inline with the same inputs.
Gate: domain files exist, arrays updated, migration generated + reviewed.13 · Verify. The final gate — prove it actually runs, don't just assert it:
pnpm install
docker compose up -d db # from the repo root — where compose lives; or full stack
pnpm --filter api migration:run # standalone: pnpm migration:run
pnpm --filter api exec tsc --noEmit # standalone: pnpm exec tsc --noEmit — the only spec typecheck (vitest never type-checks)
pnpm --filter api format # standalone: pnpm format — the reference templates are hand-wrapped, so prettier rewraps them once
pnpm --filter api lint && pnpm --filter api format:check # standalone: pnpm lint && pnpm format:check
pnpm --filter api start:dev # standalone: pnpm start:dev — or build + start:prod
Then check: GET /ping → pong; GET /api/health returns a non-empty status
object (not {} — the excludeAll trap, observability.md); /docs loads (proves
@fastify/static); the domain list route (e.g. /api/v1/user) returns a serialized
{ pagination, data }; and pnpm --filter api test (standalone: pnpm test) passes. Report which checks
passed with evidence. Fallback: if boot fails, report the stack trace and the
phase most likely responsible — do not claim completion. (Common first-boot crash:
@fastify/static missing → dies at Swagger setup before listen.)
// → nestjs-domain-module
{ "domainName": "user", "interfaces": ["admin","client"],
"entity": { "softDeletable": true, "fields": [...] },
"useContracts": true } // false in standalone layout
// ← returns
{ "createdFiles": [...], "registeredIn": "module-groups.ts", "migrationNeeded": true }
// → nestjs-migration (only if migrationNeeded)
{ "name": "CreateUser", "apiRoot": "apps/api" } // "." in standalone layout
// ← returns
{ "migrationFile": "...", "verdict": "safe|needs-review", "destructiveOps": [] }
Auth/authz policy, cache/Redis strategy, S3 upload, CI/CD, security baseline (helmet/rate-limit), seed data. These are per-project decisions — do not scaffold them here, and don't flag their absence as a gap.
evals/evals.json (opens in a new tab)evals/results-2026-09-22.md (opens in a new tab)evals/results-2026-12-02.md (opens in a new tab)evals/run.sh (opens in a new tab)evals/trigger-eval.json (opens in a new tab)references/bootstrap-app.md (opens in a new tab)references/build-config.md (opens in a new tab)references/common.md (opens in a new tab)references/config-env.md (opens in a new tab)references/dependencies.md (opens in a new tab)references/infra.md (opens in a new tab)references/layout.md (opens in a new tab)references/observability.md (opens in a new tab)references/persistence.md (opens in a new tab)references/swagger.md (opens in a new tab)references/testing.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
/backend:nestjs-bootstrapfrom backend
npx claudepluginhub siu9068/ggyul-skills --plugin backend11 skills in this plugin
/api-creator-bootstrapGenerates a backend repo's `api-creator` + `test-checker` skill pair: set up, port, or bootstrap the API + test skills here. Generate a project-tailored TDD skill PAIR — `api-creator` (scaffold new APIs) and `test-checker` (audit & fill existing unit tests) — for a backend project: extract the proven gated, test-first methodology and fill in THIS project's own conventions (layers, base classes, auth, DTO/serialization, folder layout, test framework, verify commands). Both skills share one discovered recipe so they stay consistent. Use whenever the user wants to "set up api-creator here", "port the api-creator/test-checker skills to this project", "bootstrap the API + test skills for this repo", or bring one project's API + test conventions into another as reusable skills. Do NOT use this to actually build an API or audit tests in the current project (that is the generated skills' job), nor to edit an existing skill (use skill-creator / skill-ops)./axum-bootstrapScaffolds a Rust axum 0.8 + SeaORM 2.0 + PostgreSQL 16 backend from zero, standalone or apps/api monorepo. House convention: DDD-lite domains with Admin/Client route groups, fail-fast env validation, three utoipa OpenAPI docs with Swagger UI, tracing JSON logs, a Docker image, tests against a real Postgres. Phase 0 decides standalone (Cargo workspace at the repo root) or apps/api in a pnpm monorepo next to packages/contracts. Use when the user wants to start, set up or scaffold a new axum or Rust backend with this stack: "러스트 백엔드 새로 세팅해줘", "axum 프로젝트 만들어줘", "sea-orm 붙여서 rust api 서버 깔아줘", "bootstrap an axum backend", "scaffold a Rust API with SeaORM and Postgres", "set up apps/api in Rust". Do NOT use for: adding a domain to an existing axum project (use axum-domain-module), writing a SeaORM migration (use axum-migration), NestJS or FastAPI backends (nestjs-bootstrap / fastapi-bootstrap), the whole multi-app bootstrap chain (project-setup), or other Rust frameworks such as actix-web, rocket, poem or loco.Other plugins' skills for the same job