# Golang Grpc

Provides gRPC usage guidelines, protobuf organization, and production-ready patterns...

- Repository: https://github.com/samber/cc-skills-golang (3750 stars)
- Category: Testing
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add samber/cc-skills-golang --skill golang-grpc -g -a claude-code -y`
Codex: `npx skills add samber/cc-skills-golang --skill golang-grpc -g -a codex -y`
Cursor: `npx skills add samber/cc-skills-golang --skill golang-grpc -g -a cursor -y`
Gemini CLI: `npx skills add samber/cc-skills-golang --skill golang-grpc -g -a gemini-cli -y`

## 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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

**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.

## Quick Reference

| Concern | Package / Tool |
| --- | --- |
| Service definition | `protoc` or `buf` with `.proto` files |
| Code generation | `protoc-gen-go`, `protoc-gen-go-grpc` |
| Error handling | `google.golang.org/grpc/status` with `codes` |
| Rich error details | `google.golang.org/genproto/googleapis/rpc/errdetails` |
| Interceptors | `grpc.ChainUnaryInterceptor`, `grpc.ChainStreamInterceptor` |
| Middleware ecosystem | `github.com/grpc-ecosystem/go-grpc-middleware` |
| Testing | `google.golang.org/grpc/test/bufconn` |
| TLS / mTLS | `google.golang.org/grpc/credentials` |
| Health checks | `google.golang.org/grpc/health` |

## Proto File Organization

The rest: https://github.com/samber/cc-skills-golang/blob/HEAD/skills/golang-grpc/SKILL.md
