Provides gRPC usage guidelines, protobuf organization, and production-ready patterns for Golang microservices. Use when implementing, reviewing, or debugging gRPC servers/clients, writing proto files,
Install
The skill file stays in the publisher's repository.
Paste the copied command in a terminal. It installs this SKILL.md into that agent.
npx skills add samber/cc-skills-golang --skill golang-grpc -a cursor -y
Provides gRPC usage guidelines, protobuf organization, and production-ready patterns for Golang microservices. Use when implementing, reviewing, or debugging gRPC servers/clients, writing proto files, setting up interceptors, handling gRPC errors with status codes, configuring TLS/mTLS, testing with bufconn, or working with streaming RPCs.
Questions
How do I install golang-grpc?
Download skills/golang-grpc/SKILL.md from the publisher, or copy the path and open the repository. PlugMCP lists the skill and does not host the file.
Where does golang-grpc live?
The publisher keeps it at https://github.com/samber/cc-skills-golang.
Which agents can use golang-grpc?
Claude, Cursor, and Codex can read a SKILL.md you add from the publisher's repository.
Provides gRPC usage guidelines, protobuf organization, and production-ready patterns for Golang microservices. Use when implementing, reviewing, or debugging gRPC servers/clients, writing proto files, setting up interceptors, handling gRPC errors with status codes, configuring TLS/mTLS, testing with bufconn, or working with streaming RPCs.
name: golang-grpc
description: "Provides gRPC usage guidelines, protobuf organization, and production-ready patterns for Golang microservices. Use when implementing, reviewing, or debugging gRPC servers/clients, writing proto files, setting up interceptors, handling gRPC errors with status codes, configuring TLS/mTLS, testing with bufconn, or working with streaming RPCs."
user-invocable: true
license: MIT
compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang.
metadata:
author: samber
version: "1.2.2"
openclaw:
emoji: "π"
homepage:
requires:
bins:
- go
- protoc
install:
- kind: brew
formula: protobuf
bins: [protoc]
allowed-tools: Read Edit Write Glob Grep Bash(go:) Bash(git:) AskUserQuestion Bash(godig:) LSP mcp__gopls__*
paths:
Persona: You are a Go distributed systems engineer. You design gRPC services for correctness and operability β proper status codes, deadlines, interceptors, and graceful shutdown matter as much as the happy path.
Modes:
Build mode β implementing a new gRPC server or client from scratch.
Review mode β auditing existing gRPC code for correctness, security, and operability issues.
Dependencies:
protoc: brew install protobuf
protoc-gen-go: go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
protoc-gen-go-grpc: go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
Go gRPC Best Practices
Treat gRPC as a pure transport layer β keep it separate from business logic. The official Go implementation is google.golang.org/grpc.
This skill is not exhaustive β refer to library documentation and code examples for more information:
For Go package docs, symbols, versions, importers, and known vulnerabilities, β See samber/cc-skills-golang@golang-pkg-go-dev skill (godig), preferred over Context7 for Go package facts.
To navigate this library's usage in your own code (definitions, call sites, diagnostics), β See samber/cc-skills-golang@golang-gopls skill (gopls).
Context7 remains a fallback for docs not indexed on pkg.go.dev.
Organize by domain with versioned directories (proto/user/v1/). Always use Request/Response wrapper messages β bare types like string cannot have fields added later. Generate with buf generate or protoc.
Always return gRPC errors using status.Error with a specific code β a raw error becomes codes.Unknown, telling the client nothing actionable. Clients use codes to decide retry vs fail-fast vs degrade.
Code
When to Use
InvalidArgument
Malformed input (missing field, bad format)
NotFound
Entity does not exist
AlreadyExists
Create failed, entity exists
PermissionDenied
Caller lacks permission
Unauthenticated
Missing or invalid token
FailedPrecondition
System not in required state
ResourceExhausted
Rate limit or quota exceeded
Unavailable
Transient issue, safe to retry
Internal
Unexpected bug
DeadlineExceeded
Timeout
// β Bad β caller gets codes.Unknown, can't decide whether to retry
return nil, fmt.Errorf("user not found")
// β Good β specific code lets clients act appropriately
if errors.Is(err, ErrNotFound) {
return nil, status.Errorf(codes.NotFound, "user %q not found", req.UserId)
}
return nil, status.Errorf(codes.Internal, "lookup failed: %v", err)
For field-level validation errors, attach errdetails.BadRequest via status.WithDetails.
Streaming
Pattern
Use Case
Server streaming
Server sends a sequence (log tailing, result sets)
Client streaming
Client sends a sequence, server responds once (file upload, batch)
Bidirectional
Both send independently (chat, real-time sync)
Prefer streaming over large single messages β avoids per-message size limits and lowers memory pressure.
func (s *server) ListUsers(req *pb.ListUsersRequest, stream pb.UserService_ListUsersServer) error {
for _, u := range users {
if err := stream.Send(u); err != nil {
return err
}
}
return nil
}
Testing
Use bufconn for in-memory connections that exercise the full gRPC stack (serialization, interceptors, metadata) without network overhead. Always test that error scenarios return the expected gRPC status codes.