Setup NestJS App
| This documentation was generated with the assistance of AI. Please report any inaccuracies. |
Scaffolds a NestJS 12 service with the Nest CLI, or brings an existing NestJS app up to date, and layers this catalog’s toolchain and a small, tested application skeleton on top.
Purpose
iru-setup-nestjs-app generates the app in a temporary directory (the Nest schematics refuse to write next to existing files) and copies it into the repository without overwriting anything. It uses nest new for ESM with Vitest (the default) or the application schematic with --type=cjs for CommonJS with Jest. It then post-processes it:
-
package.jsonwith version0.1.0-dev.0,private: true, and the shared script namesiru-setup-typescript-github-workflowsand theiru-typescript-*gate skills detect:lint(Oxlint type-aware),format/format:check(Prettier),typecheck,test,coverage(80% threshold, lcov atcoverage/lcov.info),test:e2e,build,start,docs(Compodoc or TypeDoc). -
A skeleton that is the first exemplar of the
iru-nestjs-code-one-taskconventions:ConfigModulevalidated by a Zod schema, a globalValidationPipeasAPP_PIPE, a sharedconfigureApp()used by bothmain.tsand the e2e tests,@nestjs/terminusliveness and readiness endpoints, and a tested samplebooksfeature module (only added to an existing app on request). -
Optional persistence (
orm: TypeORM, Prisma 7, Mongoose 9 or Drizzle) with migrations and Testcontainers-backed e2e tests. -
A multi-stage non-root
Dockerfilewith a health check and.env.example(always written), andsonar-project.propertieswhen Sonar is enabled.
Versions are resolved live from npm with verified fallbacks. The skill announces whether it is scaffolding from scratch or updating an existing app and, per owned artifact that already exists, asks Update / Keep as is / Replace (or Stop) unless on-existing pre-answers; application source such as main.ts is recommended as Keep.
Plugin
Shipped by the iru-nestjs plugin of the ai-catalog marketplace (install with /plugin install iru-nestjs@ai-catalog; see Plugins).
Invocation
/iru-setup-nestjs-app
When called from iru-setup-typescript-repository, the resolved answers arrive as args key: value lines.
Inputs
| Argument | Required | Description | Default |
|---|---|---|---|
|
No |
|
Repository directory name; asked |
|
No |
|
Asked (existing apps: read from |
|
No |
Shared pipeline vocabulary; |
Asked or derived ( |
|
No |
|
Asked; |
|
No |
|
|
|
No |
|
|
|
No |
|
|
|
No |
|
|
|
No |
|
|
|
No |
|
|
|
No |
|
Derived: |
|
No |
|
|
publish, storybook, pages and ci-tests are ignored. A root package.json that is not a Nest app makes the skill ask whether to scaffold into a subdirectory or stop.
Outputs
-
The NestJS project:
package.json,nest-cli.json,tsconfig*.json,.oxlintrc.json,.prettierrc/.prettierignore, unit and e2e test configs (Vitest or Jest), and optionallytypedoc.json. -
src/config/,src/app.module.ts,src/app.setup.ts,src/main.ts,src/health/, the samplesrc/books/feature, andtest/e2e specs and app factory, each with specs. The scaffold’s Hello World files, thedeployscript and@nestjs/mauare removed. -
With an ORM:
src/database/wiring, an initial migration, ORM scripts and a Testcontainers global setup. -
Dockerfile,.dockerignore,.env.example, andsonar-project.propertieswhen Sonar is enabled. -
A report: mode, location, resolved choices, the npm scripts written, versions and their source, each verification command and result (unverified items such as Docker-dependent e2e or MySQL called out), and warnings (review generated files, run migrations as a deployment step,
SONAR_TOKENneeded).
No .gitignore, workflows, CHANGELOG.md or README.md are written; the orchestrator runs the dedicated skills for those next.
Execution flow
Dependencies
Invokes
None. It runs the Nest CLI, the package manager and optionally docker directly, and reads its own reference/ files (app templates, ORM variants, Docker and Sonar). Step 12 runs the commands that the iru-typescript-* gate skills and the workflows call, without invoking those skills. The generated code follows the iru-nestjs-code-one-task references.
Invoked by
-
Setup TypeScript Repository — Step 5, flavor nestjs scaffold, via the
iru-isolated-skill-executoragent.
Source
SKILL.md on GitHub — the file this page was generated from.