Skip to content
Back to skills

Transport

ASecurity

gRPC, RabbitMQ standards and Monorepo contracts.

  • 8 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 8, 2026
ai-agentstypescript

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add ngxtm/devkit --skill transport --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Transport?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Transport
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ngxtm-transport/badge)](https://www.skillsdirectory.com/skills/ngxtm-transport)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: NestJS Microservices
description: gRPC, RabbitMQ standards and Monorepo contracts.
metadata:
  labels: [nestjs, microservices, grpc, rabbitmq]
  triggers:
    files: ['main.ts', '**/*.controller.ts']
    keywords: [Transport.GRPC, Transport.RMQ, MicroserviceOptions]
---

# Microservices & Transport Standards

## Transport Strategies

- **Synchronous (RPC)**: Use **gRPC** for low-latency, internal service-to-service calls.
  - **Why**: 10x faster than REST/JSON, centralized `.proto` contracts.
- **Asynchronous (Events)**: Use **RabbitMQ** or **Kafka** for decoupling domains.
  - **Pattern**: Fire-and-forget (`emit()`) for side effects (e.g., "UserCreated" -> "SendEmail").

## Monorepo Architecture

- **Contracts**:
  - **Pattern**: Store all DTOs, `.proto` files, and Interfaces in a **Shared Library** (`libs/contracts`).
  - **Rule**: Services never import code from other services. They only import from `contracts`.
- **Versioning**: Semantic versioning of messages is mandatory. Never change a field type; add a new field.

## Exception Handling

- **Propagation**: Standard `HttpException` is lost over Rpc/Tcp.
- **Standard**: Use `RpcException` and generic Filters.

  ```typescript
  // 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-validator` just like HTTP.
  - **Config**: Apply `useGlobalPipes(new ValidationPipe({ transform: true }))` in the `MicroserviceOptions` setup, not just HTTP app setup.

Files in this skill

  • SKILL.md1.6 KB
  • references/REFERENCE.md354 B
  • references/microservices-patterns.md3.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…