last update
May 23, 2026
license
MITv1.0.0
format
SKILL.md
- Install
// Downloads SKILL.md into ~/.claude/skills/nestjs-architect/
$ curl -fsSL --create-dirs -o ~/.claude/skills/nestjs-architect/SKILL.md https://claudeskil.com/skills/nestjs-architect/SKILL.md - Invoke
// Inside Claude Code, type the skill name as a slash command
> /nestjs-architect scaffold a typed REST endpoint - Or just ask
// Claude loads the skill by itself when a request matches its description
> scaffold a typed REST endpoint
- name:
- NestJS Architect
- slug:
- nestjs-architect
- version:
- v1.0.0
- license:
- MIT
- author:
- @chiragthummar16
- categories:
- tags:
- #nestjs#typescript#graphql#rest#prisma
- description:
Modular NestJS apps: DI, decorators, guards, GraphQL or REST, Prisma — enterprise Node done well.
README.md
NestJS Architect
NestJS Architect helps you build and extend NestJS backends the way the framework intends — feature modules wired through dependency injection, request handling layered with guards and interceptors, and a data layer backed by Prisma. It's aimed at TypeScript developers building production APIs who want consistent structure across REST and GraphQL surfaces rather than ad-hoc controllers glued together by hand.
When to use it
- Standing up a new service and you want a clean module boundary (
UsersModule,AuthModule) instead of dumping everything inAppModule. - Adding a resource end to end: entity, DTOs with validation, service, and controller or resolver.
- Introducing cross-cutting concerns — JWT auth guards, role-based
CanActivatechecks, logging or transform interceptors, exception filters. - Wiring Prisma into the DI container and exposing a typed
PrismaService. - Generating OpenAPI/Swagger docs from existing decorators, or designing a code-first GraphQL schema.
What it does
It scaffolds against the real Nest building blocks. Modules use @Module({ imports, controllers, providers, exports }); providers are injected via constructor parameters and @Injectable(). For HTTP it generates controllers with @Controller(), route decorators (@Get, @Post, @Param, @Body), and DTOs validated by class-validator decorators plus a global ValidationPipe. Guards implement CanActivate; interceptors implement NestInterceptor; filters use @Catch().
For GraphQL it favors the code-first approach with @ObjectType, @Resolver, @Query, @Mutation, and @Field, emitting schema.gql. OpenAPI generation uses @nestjs/swagger (DocumentBuilder, SwaggerModule.setup) and @ApiProperty. Prisma integration produces a PrismaService extends PrismaClient that hooks onModuleInit, registered in a shared PrismaModule.
Example
curl -fsSL --create-dirs -o ~/.claude/skills/nestjs-architect/SKILL.md https://claudeskil.com/skills/nestjs-architect/SKILL.md
# then, in your project:
"Add a billing module with a REST controller, a Prisma-backed
service, a JWT auth guard, and Swagger docs for the endpoints."
Resulting service sketch:
@Injectable()
export class BillingService {
constructor(private readonly prisma: PrismaService) {}
findAll() {
return this.prisma.invoice.findMany();
}
}
Tips & gotchas
- Providers are singleton-scoped by default. Only reach for
Scope.REQUESTwhen you truly need per-request state — it forces the whole resolution chain to become request-scoped and hurts throughput. - Register
ValidationPipeglobally withwhitelist: trueandtransform: true, otherwise extra payload fields slip through and DTO types stay plain objects. - A guard that depends on another provider must live in a module that can resolve it; export shared providers or use
APP_GUARDfor app-wide guards. - Run
prisma generateafter schema changes so the injected client stays typed; the skill won't migrate your database for you.
FAQ
REST or GraphQL — can I mix them? Yes. Nest supports both in one app; the skill keeps resolvers and controllers in their own modules so they share the same services.
Does it run migrations? No. It generates code and Prisma schema/service wiring; you still run prisma migrate dev yourself.
Code-first or schema-first GraphQL? It defaults to code-first with decorators, but can target an existing .graphql SDL if you prefer schema-first.
$ cat reviews/