golang-grpc

Implements and reviews production-grade gRPC servers and clients in Go.

Updated May 9, 2026
One-click install
npx skills add https://github.com/LuminaVault/LuminaVaultShared --skill golang-grpc-luminavault
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: golang-grpc
Source: https://github.com/LuminaVault/LuminaVaultShared/tree/main/.agents/skills/golang-grpc
Command: npx skills add https://github.com/LuminaVault/LuminaVaultShared --skill golang-grpc-luminavault

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building gRPC services in Go involves many correctness and operability pitfalls — raw errors becoming codes.Unknown, missing deadlines hanging goroutines, and misconfigured shutdown dropping in-flight RPCs. This Skill encodes the patterns that prevent those failures. ## Core Features & Use Cases - Server & Client Implementation: Guides proto organization with versioned directories, Request/Response wrapper messages, interceptor chains, health check registration, and graceful shutdown with timeout fallback. - Error Handling & Status Codes: Enforces status.Errorf with specific codes (NotFound, InvalidArgument, FailedPrecondition) so clients can make correct retry decisions. - Testing & Operations: Covers bufconn-based in-memory testing, streaming RPC patterns, TLS/mTLS configuration, and client-side load balancing with retry policies for Kubernetes. - Use Case: When asked to write a gRPC handler for GetUser, the Skill ensures the code returns codes.NotFound for missing users and codes.Internal for unexpected errors, rather than a raw error that clients cannot act on. ## Quick Start Ask the agent to write a production-ready Go gRPC server for your service with proper error codes, interceptors, health checks, and graceful shutdown.

Frequently Asked Questions about golang-grpc

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I return proper gRPC errors in Go?▼

Return errors with status.Errorf and a specific code from google.golang.org/grpc/codes, such as codes.NotFound or codes.InvalidArgument. A raw fmt.Errorf becomes codes.Unknown, which prevents clients from deciding whether to retry.

How do I test a Go gRPC service without a network?▼

Use bufconn.Listen to create an in-memory listener and dial it with grpc.WithContextDialer. This exercises the full gRPC stack including serialization and interceptors without TCP overhead, and lets you assert status codes with status.FromError.

Should I use protoc or buf for Go code generation?▼

buf is the recommended modern option: it manages dependencies, lints protos, checks breaking changes, and generates code from a single buf.gen.yaml. Raw protoc works too with protoc-gen-go and protoc-gen-go-grpc plugins.

How do I load balance gRPC clients in Kubernetes?▼

Use the dns:/// scheme against a headless service and set round_robin as the loadBalancingPolicy in the client service config. Add a retryPolicy with retryableStatusCodes containing UNAVAILABLE for transient failure handling.

Why does my gRPC client hang on slow servers?▼

Calls without a deadline wait indefinitely when the upstream is slow. Wrap every call in context.WithTimeout and defer cancel, so slow RPCs fail with codes.DeadlineExceeded instead of leaking goroutines.

When should I use gRPC streaming instead of a large response?▼

Use server streaming when returning large result sets, such as tens of thousands of records. Streaming avoids the default 4 MB per-message limit and reduces memory pressure by sending items incrementally with stream.Send.