Agent skill
nestjs-typescript-setup
Scaffold or repair a NestJS TypeScript backend with deterministic Nest CLI commands, package-manager aware scripts, strict mode defaults, optional SWC enablement, and verification gates. Use when users ask to install NestJS, bootstrap a new Nest API, add NestJS into an existing repository, fix broken setup commands, or validate Node/CLI version compatibility.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/nestjs-setup
SKILL.md
NestJS TypeScript Setup
Scope and trigger
Use this skill when the request is about creating, repairing, or validating a NestJS + TypeScript project setup.
Inputs to resolve before execution
Collect or confirm these inputs first:
projectPathOrName: required; do not assume a name when missing.packageManager: one ofnpm,pnpm,yarn.targetParentDir: directory where scaffolding should run.existingGitRepo: whether the target parent already has.git.useSwc: optional; defaultfalseunless requested.
If any required input is missing, ask one precise question.
Preconditions
Run preflight checks before scaffolding:
- Confirm Node version satisfies Nest docs baseline (
>= 20) and current CLI engine floor.node -vnpm view @nestjs/cli engines --json
- Confirm package manager is installed.
npm -vorpnpm -voryarn -v
- Confirm target parent exists and is writable.
Stop and report blocker details if preflight fails.
Deterministic scaffold workflow
- Build scaffold command from target parent directory:
npx @nestjs/cli@latest new <projectPathOrName> --package-manager <packageManager> --strict
- If
existingGitRepo=true, append--skip-git. - Execute scaffold command from
targetParentDir. - Change directory into created Nest app root.
- Run startup command with chosen package manager:
npm run start:devpnpm start:devyarn start:dev
- Verify app responds at
http://localhost:3000with default starter response.
Existing repository integration
When adding Nest inside an already versioned repository:
- Run scaffold from repository root or chosen subfolder parent.
- Always include
--skip-git. - Keep all subsequent install/run/lint/test commands in the generated Nest app root.
Optional SWC enablement
Only apply when explicitly requested.
- Install SWC dependencies in project root:
npm i --save-dev @swc/cli @swc/core
- Update
nest-cli.json:
{
"compilerOptions": {
"builder": "swc",
"typeCheck": true
}
}
- Verify with one command:
npx nest start -b swc --type-check
Verification gates
Mark complete only when all checks pass:
- Preflight checks passed (Node, package manager, writable target)
- Scaffold command completed without interactive ambiguity
- Commands executed from generated Nest app root
- Dev server starts successfully
- Local HTTP response check passes (
http://localhost:3000) - Optional SWC path verified when enabled
Recovery rules
- If scaffolding partially succeeds (folder created, install failed), continue from project root and fix dependency/install issues without re-scaffolding unless user requests reset.
- If package manager mismatch is detected after scaffold, align scripts and lockfile usage to the user-selected manager.
- Do not delete user files to recover from setup failures.
Official references
Use reference.md for authoritative links and command details.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?