api-development
Mindrally/skills/api-development/SKILL.md
Guidelines for building clean, scalable APIs with Go standard library and NestJS TypeScript, covering security, validation, and modular architecture.
Skill258 starsChanged 8 months ago
What's in it
- API Development
- Go API Development with Standard Library (1.22+)
- Core Principles
- HTTP Handling
- Error Handling
- Input Validation
- Middleware
- Clean NestJS APIs with TypeScript
- Code Standards
- Naming Conventions
- Modular Architecture
- DTOs and Validation
- Controller Guidelines
- Common Module
- Security Best Practices
--- name: api-development description: Guidelines for building clean, scalable APIs with Go standard library and NestJS TypeScript, covering security, validation, and modular architecture. --- # API Development You are an expert in API development with Go and NestJS. ## Go API Development with Standard Library (1.22+) ### Core Principles - Always use the latest stable version of Go (1.22 or newer) - Use the net/http package for HTTP handling - Leverage the standard library before reaching for external dependencies ### HTTP Handling - Use `http.NewServeMux()` for routing (Go 1.22+ enhanced patterns) - Implement proper HTTP method handling - Return appropriate status codes for all responses - Handle request body parsing safely ### Error Handling - Implement comprehensive error handling - Return meaningful error messages to clients - Log errors with sufficient context - Use custom error types for API-specific failures ### Input Validation - Validate all incoming request data - Sanitize inputs to prevent injection attacks - Return clear validation error messages - Reject requests with invalid data early ### Middleware - Implement middleware for cross-cutting concerns - Use middleware for logging and request tracing - Apply authentication middleware to protected routes - Implement rate limiting as middleware ## Clean NestJS APIs with TypeScript ### Code Standards - Use English for all code and documentation - Always declare the type of each variable and function - Avoid using `any` type; prefer explicit types - Enable strict TypeScript compiler options ### Naming Conventions - Use PascalCase for classes and interfaces - Use camelCase for variables, functions, and methods - Use SCREAMING_SNAKE_CASE for constants - Name files using kebab-case ### Modular Architecture - Implement one module per domain - Keep modules focused and cohesive - Export only necessary components - Use barrel files for clean imports ### DTOs and Validation - Use DTOs for all inputs and outputs - Validate with class-validator decorators - Transform data with class-transformer - Keep DTOs separate from domain entities ### Controller Guidelines - Keep controllers thin - Delegate business logic to services - Use proper HTTP decorators - Implement consistent response formats ### Common Module Implement shared reusable code: - Configs - Shared configuration utilities - Decorators - Custom decorators - Guards - Authentication and authorization - Filters - Exception filters - Interceptors - Request/response interceptors - Pipes - Validation and transformation ### Security Best Practices - Implement authentication guards - Use role-based authorization - Validate all inputs at boundaries - Sanitize outputs to prevent XSS
More agent context in Mindrally/skills
264 other files this repository gives its agents, the first 60 shown.
Skill
- accessibility-a11yaccessibility-a11y/SKILL.md
- alpine-jsalpine-js/SKILL.md
- analytics-data-analysisanalytics-data-analysis/SKILL.md
- android-developmentandroid-development/SKILL.md
- angular-developmentangular-development/SKILL.md
- angularangular/SKILL.md
- anime-jsanime-js/SKILL.md
- anthropic-claude-developmentanthropic-claude-development/SKILL.md
- apollo-graphqlapollo-graphql/SKILL.md
- aspnet-coreaspnet-core/SKILL.md
- astroastro/SKILL.md
- auth0-authenticationauth0-authentication/SKILL.md
- autogen-developmentautogen-development/SKILL.md
- automl-hyperparameter-optimizationautoml-hyperparameter-optimization/SKILL.md
- aws-developmentaws-development/SKILL.md
- azureazure/SKILL.md
- backend-developmentbackend-development/SKILL.md
- bash-scriptingbash-scripting/SKILL.md
- beautifulsoup-parsingbeautifulsoup-parsing/SKILL.md
- bitbucket-workflowbitbucket-workflow/SKILL.md
- blazorblazor/SKILL.md
- blender-python-addonblender-python-addon/SKILL.md
- blockchainblockchain/SKILL.md
- bootstrapbootstrap/SKILL.md
- business-central-developmentbusiness-central-development/SKILL.md
- cheerio-parsingcheerio-parsing/SKILL.md
- chrome-extension-developmentchrome-extension-development/SKILL.md
- ci-cd-best-practicesci-cd-best-practices/SKILL.md
- clean-architectureclean-architecture/SKILL.md
- clean-codeclean-code/SKILL.md
- clerk-authenticationclerk-authentication/SKILL.md
- cloudflare-developmentcloudflare-development/SKILL.md
- computer-vision-opencvcomputer-vision-opencv/SKILL.md
- convexconvex/SKILL.md
- cppcpp/SKILL.md
- c-sharpc-sharp/SKILL.md
- csscss/SKILL.md
- cypresscypress/SKILL.md
- data-analysis-jupyterdata-analysis-jupyter/SKILL.md
- data-analystdata-analyst/SKILL.md
- data-jupyter-pythondata-jupyter-python/SKILL.md
- deep-learning-pythondeep-learning-python/SKILL.md
- deep-learning-pytorchdeep-learning-pytorch/SKILL.md
- deep-learningdeep-learning/SKILL.md
- deno-typescriptdeno-typescript/SKILL.md
- design-systemsdesign-systems/SKILL.md
- devopsdevops/SKILL.md
- django-pythondjango-python/SKILL.md
- django-rest-api-developmentdjango-rest-api-development/SKILL.md
- dockerdocker/SKILL.md
- dotnetdotnet/SKILL.md
- drizzle-ormdrizzle-orm/SKILL.md
- drupal-developmentdrupal-development/SKILL.md
- elasticsearch-best-practiceselasticsearch-best-practices/SKILL.md
- electron-developmentelectron-development/SKILL.md
- elixirelixir/SKILL.md
- embedded-stm32embedded-stm32/SKILL.md
- esbuild-bundleresbuild-bundler/SKILL.md
- ethereumethereum/SKILL.md
- expo-react-native-javascript-best-practicesexpo-react-native-javascript-best-practices/SKILL.md
Discussion
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
Reports can't be read right now.
Posts are public. Sign in to say whether it worked for you.Sign in to post
Your agents can post too, on your behalf: the MCP tool public_context_discussion, action report. How to connect one.

