nestjs-clean-typescript — Claude Code skill: setup and guide
Guides Claude Code to write clean NestJS APIs using TypeScript, MikroORM, class-validator, and Jest testing conventions.
npx skills add Mindrally/skills --skill nestjs-clean-typescript -a claude-codeWhat nestjs-clean-typescript does
This skill applies Alberto Basalo's guidelines for building NestJS services with TypeScript. It enforces explicit types on all parameters and return values. The skill blocks any and requires JSDoc on public methods. Files follow kebab-case naming and carry a single export each.
Logic stays compact under these rules. Functions must stay under 20 instructions and rely on early returns alongside the RO-RO pattern. Classes are capped at 200 instructions, 10 properties, and 10 public methods. Domain architecture dictates one module per route and one service per entity.
Persistence relies on MikroORM entities, while tests use Jest with the Arrange-Act-Assert structure. If your project uses Prisma or TypeORM, the persistence instructions will clash with your setup.
What it helps with
- enforce strict TypeScript types and eliminate any in NestJS
- limit function and class sizes to prevent bloated code
- structure NestJS modules with dedicated entity services
- generate Jest unit and integration tests using Arrange-Act-Assert
Example prompts for the agent
- Build a NestJS billing module following nestjs-clean-typescript guidelines with class-validator DTOs.
- Write a user service with MikroORM entities using early returns and RO-RO pattern.
- Create Jest unit tests for the AuthService methods using the Arrange-Act-Assert structure.
How to install nestjs-clean-typescript
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill nestjs-clean-typescript -a claude-code2Manually: put the files in place
~/.claude/skills/nestjs-clean-typescript/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/nestjs-clean-typescript/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill nestjs-clean-typescript -a codex2Manually: put the files in place
.agents/skills/nestjs-clean-typescript/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill nestjs-clean-typescript -a cursor2Manually: put the files in place
.cursor/skills/nestjs-clean-typescript/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills nestjs-clean-typescript2Manually: put the files in place
.github/skills/nestjs-clean-typescript/SKILL.md1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill nestjs-clean-typescript -a gemini-cli2Platform CLI
gemini skills install https://github.com/Mindrally/skills --path nestjs-clean-typescriptManually: put the files in place
.devin/skills/nestjs-clean-typescript/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add Mindrally/skills --skill nestjs-clean-typescript -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about nestjs-clean-typescript
How to install nestjs-clean-typescript in Claude Code?
Run npx skills add Mindrally/skills --skill nestjs-clean-typescript -a claude-code in your terminal.
What ORM does nestjs-clean-typescript expect?
The skill specifies MikroORM for persistence, assigning a dedicated service to each entity.
What limits does the skill impose on class and function sizes?
Functions must stay below 20 instructions, while classes cannot exceed 200 instructions, 10 properties, and 10 public methods.
Source text
SKILL.md · Apache-2.0
--- name: nestjs-clean-typescript description: Clean NestJS API development with TypeScript following SOLID principles, modular architecture, and comprehensive testing practices. metadata: maintainer: Mindrally source: https://github.com/Mindrally/skills --- # NestJS Clean TypeScript Guidelines by Alberto Basalo for developing clean NestJS APIs using TypeScript. These rules emphasize strong typing, clean code principles, and architectural best practices. ## TypeScript General Principles - Always declare the type of each variable and function (parameters and return value) - Avoid using any; create necessary types instead - Use JSDoc for public classes and methods - One export per file ## Naming Conventions - PascalCase for classes - camelCase for variables and functions - kebab-case for files and directories - UPPERCASE for environment variables - Boolean variables use prefixes: isX, hasX, canX ## Function Design - Write short functions with a single purpose. Less than 20 instructions - Use early returns to avoid nesting - Apply RO-RO pattern: pass objects for multiple parameters, return objects for results ## Data and Classes - Prefer immutability for data with readonly and as const - Follow SOLID principles - Classes should have: - Less than 200 instructions - Fewer than 10 public methods - Fewer than 10 properties ## NestJS Specific Guidelines - Use modular architecture with one module per domain/route - Use MikroORM entities for persistence - One service per entity - DTOs validated with class-validator - Global filters, middlewares, guards, and interceptors in core module ## Testing - Use Jest framework - Follow Arrange-Act-Assert convention - Write unit tests for each public function - Include end-to-end tests per API module
© Mindrally · Apache-2.0 · Mindrally/skills