generating-grpc-services
Installation
SKILL.md
Generating gRPC Services
Overview
Generate gRPC service definitions, client/server stubs, and implementations from Protocol Buffer (protobuf) .proto files. Scaffold unary, server-streaming, client-streaming, and bidirectional-streaming RPC methods with proper error status codes, interceptors for auth/logging, and health check service registration.
Prerequisites
- Protocol Buffers compiler (
protoc) v3.21+ installed - Language-specific gRPC plugin:
grpc_tools_node_protoc_plugin(Node.js),grpcio-tools(Python), or Go gRPC plugin bufCLI for proto linting and breaking change detection (recommended)- gRPC testing tool:
grpcurl,evans, or BloomRPC - TLS certificates for production transport security (mTLS recommended for service-to-service)
Instructions
- Read existing
.protofiles using Glob and Read, or design new service definitions with message types, RPC methods, and streaming patterns per service requirements. - Define proto3 message types with appropriate field types, using
google.protobuf.Timestampfor dates,google.protobuf.Structfor dynamic fields, andoneoffor polymorphic messages. - Compile
.protofiles withprotocto generate language-specific stubs, server interfaces, and client libraries using the appropriate gRPC plugin. - Implement server-side RPC handlers for each method, returning proper gRPC status codes (
OK,NOT_FOUND,INVALID_ARGUMENT,PERMISSION_DENIED) instead of generic errors.
Related skills