Skillshub 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)
install
source · Clone the upstream repo
git clone https://github.com/ComeOnOliver/skillshub
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ComeOnOliver/skillshub "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/HoangNguyen0403/agent-skills-standard/nestjs-transport" ~/.claude/skills/comeonoliver-skillshub-nestjs-transport && rm -rf "$T"
manifest:
skills/HoangNguyen0403/agent-skills-standard/nestjs-transport/SKILL.mdsource content
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
contracts..proto
- Why: 10x faster than REST/JSON, centralized
- Asynchronous (Events): Use RabbitMQ or Kafka for decoupling domains.
- Pattern: Fire-and-forget (
) for side effects (e.g., "UserCreated" -> "SendEmail").emit()
- Pattern: Fire-and-forget (
Monorepo Architecture
- Contracts:
- Pattern: Store all DTOs,
files, and Interfaces in a Shared Library (.proto
).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
is lost over Rpc/Tcp.HttpException -
Standard: Use
and generic Filters.RpcException// 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
just like HTTP.class-validator- Config: Apply
in theuseGlobalPipes(new ValidationPipe({ transform: true }))
setup, not just HTTP app setup.MicroserviceOptions
- Config: Apply
Anti-Patterns
- No cross-service imports: Services must import only from
, never from sibling services.libs/contracts - No HttpException in RPC: Use
with a globalRpcException
for microservice errors.RpcExceptionFilter - No unversioned message schema: Add new fields; never change existing field types — consumers will break.