一键导入
nean-scaffold
Scaffold an Nx monorepo with NestJS API, Angular frontend, and shared libraries.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Scaffold an Nx monorepo with NestJS API, Angular frontend, and shared libraries.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | nean-scaffold |
| description | Scaffold an Nx monorepo with NestJS API, Angular frontend, and shared libraries. |
| argument-hint | [app-name] [--github] [--public] [--org <org>] [--repo <n>] [--no-push] |
| allowed-tools | Bash, Write, Read, Glob, Grep |
Create a fully working NEAN repo (NestJS + Angular + Nx + TypeORM + PrimeNG) with tooling configured and runnable immediately.
app-name — Project folder name (default: "app")--github — Create GitHub repo and push (requires gh auth)--public — Make GitHub repo public (default: private)--org <n> — Create under org instead of personal account--repo <n> — Override repo name (default: app-name)--no-push — Create repo and commit but don't pushCopy files from templates/ into the project. If a template doesn't exist, generate equivalent content.
Templates provide:
<app-name>/
├── apps/
│ ├── api/ # NestJS backend
│ │ └── src/
│ │ ├── app/ # Root module
│ │ ├── modules/health/ # Health check endpoint
│ │ └── main.ts # Bootstrap with security
│ └── web/ # Angular frontend
│ └── src/
│ ├── app/ # Root component
│ └── main.ts # Bootstrap
├── libs/
│ ├── shared/types/ # DTOs, interfaces, enums
│ ├── api/common/ # Filters, pipes, interceptors
│ └── api/database/ # TypeORM config, entities
├── docs/ # Documentation
│ └── PRD-TEMPLATE.md # Product requirements template for Ralph
├── docker/
│ ├── Dockerfile.api
│ ├── Dockerfile.web
│ └── docker-compose.yml
├── .vscode/ # VS Code workspace config (from templates)
│ ├── settings.json
│ └── extensions.json
├── .github/
│ ├── workflows/
│ │ ├── ci.yml # CI pipeline
│ │ ├── security.yml # Dependency review + TruffleHog
│ │ └── pr-check.yml # PR validation
│ ├── CODEOWNERS # Code ownership rules
│ ├── SECURITY.md # Vulnerability reporting
│ ├── dependabot.yml # Dependency updates
│ └── pull_request_template.md # PR checklist
├── CLAUDE.md # Repo context for Claude Code
├── nx.json
├── package.json
└── tsconfig.base.json
npx create-nx-workspace@latest <app-name> --preset=apps --nxCloud=skip --interactive=false --skipGit --packageManager=npm
1a. Copy VS Code config from templates: .vscode/settings.json and .vscode/extensions.jsonnpm install -D @nx/nest @nx/angular @nx/jsnpx nx g @nx/nest:application apps/api --e2eTestRunner=none
The NestJS generator does NOT create jest config. Add API test infrastructure manually after generation (see step 3a). 3a. Add API test infrastructure (NestJS generator omits this):
apps/api/jest.config.cts — copy pattern from libs/shared/types/jest.config.cts, change displayName, adjust preset path to ../../jest.preset.js, add moduleNameMapper for all @<app-name>/* aliasesapps/api/.spec.swcrc — copy verbatim from libs/shared/types/.spec.swcrc (enables decorator metadata for NestJS DI)apps/api/tsconfig.spec.json — standard Nx spec tsconfig with jest + node types, referencing tsconfig.app.jsonapps/api/tsconfig.json — add { "path": "./tsconfig.spec.json" } to references arrayNX_IGNORE_UNSUPPORTED_TS_SETUP=true npx nx g @nx/angular:application apps/web --style=scss --routing --e2eTestRunner=playwright --prefix=app
Set
NX_IGNORE_UNSUPPORTED_TS_SETUP=truebefore running Angular generators when Nx uses TypeScript project references.
composite: false, declaration: false, declarationMap: false, isolatedModules: false in apps/web/tsconfig.json and add "dom" to lib. Angular's compiler is incompatible with TypeScript project references settings.apps/web/postcss.config.js with @tailwindcss/postcss pluginapps/web/src/styles.css with @import "tailwindcss" (NOT in .scss)apps/web/src/styles.scss for primeicons only (@use "primeicons/primeicons.css")styles.scss and styles.css to project.json styles arrayprovidePrimeNG({ theme: { preset: Aura } }) in app.config.tsapps/api/webpack.config.js for all @<app-name>/* path mappings. Required because Nx 22 project references don't auto-resolve tsconfig paths for webpack builds.For local development, Homebrew-managed PostgreSQL (
brew services start postgresql@14) is simpler than Docker. The docker-compose.yml is for CI and production deployment.
.github/ config files (CODEOWNERS, SECURITY.md, dependabot.yml, PR template, workflows)npm install
npm run lint
npm run test
npm run build
npm run e2e
If the dev server ran against a live database (TypeORM synchronize: true creates tables automatically), clean up afterward:
nx serve processpsql -U postgres -d <db> -c 'DROP TABLE IF EXISTS <table>;'psql -U postgres -d <db> -c '\dt' should show only pre-existing tables (e.g. migrations)lsof -i :3000 should return nothingThis prevents leftover tables from interfering with future migration-based workflows.
gh auth status to succeedgh repo create <owner>/<repo> --<visibility> --source . --remote origin--no-pushAfter scaffolding, run these skills to complete GitHub security setup:
/github-hooks --platform nean — Install local Git hooks
/github-secure (if --github was used) — Configure repo security via API
.github/ config files are created during scaffold, not github-secure)These are invoked automatically by /nean-kit.
Summarize: structure created, commands available, what tooling is included, GitHub status if applicable, and remind to run github-hooks/github-secure if not using nean-kit.
Scaffold a pnpm + Turborepo MERN monorepo with Next.js, tooling, tests, CI, and optional GitHub repo creation.
Configure GitHub repository security with branch protection, Dependabot, security scanning, and CI workflows. Integrates with mern-scaffold, nean-scaffold, and iOS projects.
Harden a Vercel deployment with security headers, CSP, bot protection, and deployment configuration
Add authentication to an iOS app with Sign in with Apple, biometrics, and Keychain storage.
Scaffold a new feature with View, ViewModel, and tests following ios-std conventions.
Review iOS code for compliance with standards, NFRs, and security policy.