> nestjs-transport
gRPC, RabbitMQ standards and Monorepo contracts. Use when implementing gRPC microservices, RabbitMQ messaging, or monorepo transport in NestJS. (triggers: main.ts, **/*.controller.ts, Transport.GRPC, Transport.RMQ, MicroserviceOptions)
curl "https://skillshub.wtf/HoangNguyen0403/agent-skills-standard/nestjs-transport?format=md"Microservices & Transport Standards
Priority: P0 (FOUNDATIONAL)
Microservices communication patterns and transport layer standards.
- Synchronous (RPC): Use gRPC for low-latency, internal service-to-service calls.
- Why: 10x faster than REST/JSON, centralized
.protocontracts.
- Why: 10x faster than REST/JSON, centralized
- Asynchronous (Events): Use RabbitMQ or Kafka for decoupling domains.
- Pattern: Fire-and-forget (
emit()) for side effects (e.g., "UserCreated" -> "SendEmail").
- Pattern: Fire-and-forget (
Monorepo Architecture
- Contracts:
- Pattern: Store all DTOs,
.protofiles, and Interfaces in a Shared Library (libs/contracts). - Rule: Services never import code from other services. They only import from
contracts.
- Pattern: Store all DTOs,
- Versioning: Semantic versioning of messages is mandatory. Never change a field type; add a new field.
Exception Handling
-
Propagation: Standard
HttpExceptionis lost over Rpc/Tcp. -
Standard: Use
RpcExceptionand generic Filters.// Global RPC Filter @Catch() export class RpcExceptionFilter implements RpcExceptionFilter<RpcException> { catch(exception: RpcException, host: ArgumentsHost): Observable<any> { return throwError(() => exception.getError()); } }
Serialization
- Message DTOs: Use
class-validatorjust like HTTP.- Config: Apply
useGlobalPipes(new ValidationPipe({ transform: true }))in theMicroserviceOptionssetup, not just HTTP app setup.
- Config: Apply
🚫 Anti-Patterns
- Do NOT use standard patterns if specific project rules exist.
- Do NOT ignore error handling or edge cases.
> related_skills --same-repo
> typescript-tooling
Development tools, linting, and build config for TypeScript. Use when configuring ESLint, Prettier, Jest, Vitest, tsconfig, or any TS build tooling. (triggers: tsconfig.json, .eslintrc.*, jest.config.*, package.json, eslint, prettier, jest, vitest, build, compile, lint)
> typescript-security
Secure coding practices for TypeScript. Use when validating input, handling auth tokens, sanitizing data, or managing secrets and sensitive configuration. (triggers: **/*.ts, **/*.tsx, validate, sanitize, xss, injection, auth, password, secret, token)
> typescript-language
Modern TypeScript standards for type safety and maintainability. Use when working with types, interfaces, generics, enums, unions, or tsconfig settings. (triggers: **/*.ts, **/*.tsx, tsconfig.json, type, interface, generic, enum, union, intersection, readonly, const, namespace)
> typescript-best-practices
Idiomatic TypeScript patterns for clean, maintainable code. Use when writing or refactoring TypeScript classes, functions, modules, or async logic. (triggers: **/*.ts, **/*.tsx, class, function, module, import, export, async, promise)