Skip to content
Back to skills

Grpc Service Design

ASecurity

Designs protobuf services with evolution-safe fields, proper status codes and deadlines, then checks changes with buf for breaking compatibility.

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 15, 2026
ai-agentsgogit

Works with

  • cli

Security analysis

A100/100

Scanned November 15, 2026

npx -y skills add workspace-templates/ai-agent-templates --skill grpc-service-design --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Grpc Service Design?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Grpc Service Design
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/workspace-templates-grpc-service-design/badge)](https://www.skillsdirectory.com/skills/workspace-templates-grpc-service-design)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: grpc-service-design
description: Designs protobuf services with evolution-safe fields, proper status codes and deadlines, then checks changes with buf for breaking compatibility.
---

# gRPC service design

Write the proto as if two versions will talk to each other for a year.

## Steps

1. Model one RPC per use case with its own request and response message, even when the response is a single field: `GetOrderRequest` and `GetOrderResponse`. Never reuse a request message across methods, because it ties their futures together.
2. Number fields once and never change or reuse them. When removing a field, add `reserved 4; reserved "old_name";`. Use field numbers 1 to 15 for fields that are set often.
3. Add enums with a zero value named `X_UNSPECIFIED`. Use wrapper types or `optional` when you must tell unset from zero.
4. Use `google.protobuf.Timestamp` and `Duration` for time; money as integer minor units with a currency string; never floats for money.
5. For lists, use page tokens: `page_size` and `page_token` in, `next_page_token` out.
6. Return status codes deliberately: `INVALID_ARGUMENT`, `NOT_FOUND`, `ALREADY_EXISTS`, `FAILED_PRECONDITION`, `PERMISSION_DENIED`, `UNAUTHENTICATED`, `RESOURCE_EXHAUSTED`, `UNAVAILABLE` for retryable faults. Attach details with `errdetails` for field violations.
7. In Go, every client call takes a `context.WithTimeout`; servers pass `ctx` to every downstream call so deadlines propagate and cancelled calls stop work.
8. Run `buf lint` and `buf breaking --against .git#branch=main` before you finish.

## Rules

- Never change a field's type or number in a released message.
- Never use `UNKNOWN` or `INTERNAL` for errors the caller caused.
- Never block a handler without checking `ctx.Done()`.

## Report

The proto diff, status code mapping, deadline defaults and buf results.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.