skills/go-grpc-services/SKILL.md
Inter-service communication with gRPC and Protocol Buffers: contract definition, code generation, client/server patterns. Trigger: When creating gRPC services, defining protobuf contracts, or implementing service-to-service communication.
npx skillsauth add 333-333-333/agents go-grpc-servicesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
| Pattern | Rule |
|---------|------|
| Proto = Contract | Protobuf files are the single source of truth for inter-service APIs |
| Proto lives with the server | Each service owns its .proto files in proto/ |
| Client wraps gRPC | Consumer services use a thin client wrapper, never raw gRPC stubs |
| Domain doesn't know gRPC | Domain ports define interfaces; gRPC is an infrastructure adapter |
| Errors map to domain | gRPC status codes translate to domain errors at the client boundary |
Reference: assets/caregiver.proto
# Install tools
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
# Generate from service directory
protoc \
--go_out=. --go_opt=paths=source_relative \
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
proto/*.proto
Add a Makefile target:
Reference: assets/Makefile
Reference: assets/grpc_handler.go
Reference: assets/grpc_client.go
Reference: assets/grpc_server.go
api/caregiver/
proto/
caregiver.proto # Source of truth
caregiverv1/
caregiver.pb.go # Generated — DO NOT EDIT
caregiver_grpc.pb.go # Generated — DO NOT EDIT
internal/
caregiver/
infrastructure/
handler/
grpc.go # gRPC server implementation
# Install protoc (macOS)
brew install protobuf
# Install Go plugins
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
# Generate code
make proto
# Test with grpcurl
brew install grpcurl
grpcurl -plaintext localhost:9090 list
grpcurl -plaintext -d '{"caregiver_id": "abc123"}' localhost:9090 caregiver.v1.CaregiverService/GetCaregiver
| ❌ Don't | ✅ Do |
|----------|-------|
| Import proto stubs in domain layer | Domain defines its own interfaces; infra maps proto ↔ domain |
| Edit generated .pb.go files | Edit .proto and regenerate |
| Use raw gRPC stubs in application layer | Wrap in a client that implements a domain port |
| Share proto files via copy-paste | Use a shared proto repo or git submodule if needed |
| Skip error code mapping | Map gRPC codes to domain errors at client boundary |
testing
Review Flutter components and screens for UX/UI compliance. Trigger: When user invokes /ux-review command or requests UX audit.
development
TypeScript strict patterns and best practices. Trigger: When implementing or refactoring TypeScript in .ts/.tsx (types, interfaces, generics, const maps, type guards, removing any, tightening unknown).
testing
Testing philosophy and strategy for every feature: test pyramid, mandatory levels per change type, completion checklist, and skill delegation. Trigger: When planning tests for a feature, reviewing test coverage, defining acceptance criteria, or asking what tests a change needs.
development
Terraform security practices: sensitive variables, secret management, state protection, .gitignore patterns, and CI/CD credential handling. Trigger: When handling secrets in Terraform, configuring state backends, reviewing .gitignore for Terraform, or setting up CI/CD pipelines for infrastructure.