nestjs-clean-typescript
Clean NestJS API development with TypeScript following SOLID principles, modular architecture, and comprehensive testing practices.
Works with
--- name: nestjs-clean-typescript description: Clean NestJS API development with TypeScript following SOLID principles, modular architecture, and comprehensive testing practices. license: Apache-2.0 --- # 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
More Testing skills
tdd
mattpocock/skills
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
agent-browser
vercel-labs/agent-browser
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.
setup-pre-commit
mattpocock/skills
Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.

