Generated banner for Protobuf Grpc API Review
Generated logo for Protobuf Grpc API Review

Protobuf Grpc API Review

GitHubOfficialFirst committed by MnilaxDistributed by GitHub

  • Skill
  • Review and audit
  • Software development
  • MIT
  • No issues found

From the author

Review Protocol Buffer (.proto) and gRPC API changes for wire and JSON compatibility, safe schema evolution, rollout hazards, and RPC contract quality. Use when reviewing proto diffs, adding or changing messages and services, planning migrations, or diagnosing cross-version failures.
— the description by Mnilax

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a structured methodology for reviewing .proto and gRPC changes to ensure long-term API stability. It guides users through evaluating changes across binary wire formats, JSON/text representations, generated source code, and runtime RPC behavior. By emphasizing mixed-version scenarios and rollout safety, it helps prevent production failures caused by schema evolution, field number reuse, or breaking changes in service contracts.

What it does

  • Analyzes .proto diffs for binary, JSON, and source-level compatibility.
  • Evaluates gRPC service changes including method identity, streaming, and status codes.
  • Traces risks in mixed-version deployments and rollback scenarios.
  • Provides a standardized format for reporting findings with severity levels.
  • Enforces best practices like field reservation and additive evolution.
  • Validates retry policies, deadline propagation, and idempotency requirements.

When to use it

  • When reviewing pull requests that modify .proto files or gRPC service definitions.
  • When planning schema migrations or deprecating fields and methods.
  • When diagnosing cross-version failures or data corruption in distributed systems.
  • When assessing the impact of changing field types, cardinality, or presence rules.

Advantages

  • Reduces the risk of production outages caused by breaking API changes.
  • Ensures consistent handling of wire-format and JSON-transcoded data.
  • Provides clear, evidence-based findings for complex schema evolutions.
  • Promotes safe, staged rollout patterns for distributed services.

Usage examples

“Review this proto diff where a field was moved into a oneof block.”
The agent identifies the potential for data loss during read-modify-write cycles and recommends a safe migration path using a new field instead.
“Is it safe to change this int32 field to an int64?”
The agent flags the change as rollout-dependent, explaining the risks of value truncation for old readers and suggesting a staged migration strategy.
“Review this new gRPC method for retry safety.”
The agent evaluates the method's idempotency, checks for proper deadline propagation, and verifies that status codes are used correctly.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/github/protobuf-grpc-api-review/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip protobuf-grpc-api-review.zip -d .agents/skills

Documentation by Mnilax

Protobuf and gRPC API Review

Review .proto and related gRPC changes as long-lived contracts. Distinguish what the wire format permits from what generated clients, JSON users, stored data, and mixed-version deployments can safely tolerate.

Start With the Compatibility Envelope

Before deciding whether a change is safe, determine:

  • the old and new schema, not only the final file

  • whether payloads use binary protobuf, ProtoJSON, text format, or more than one encoding

  • whether messages persist in databases, queues, logs, caches, or events

  • whether clients exist outside the repository or release independently

  • the protobuf syntax or edition and the generated languages/runtime versions

  • whether HTTP/JSON transcoding, reflection, service config, or schema registries expose the contract

  • the deployment order, rollback window, and duration of mixed-version operation

If context is missing, state the assumption and lower confidence. Do not call a change backward-compatible from the new schema alone.

Review Workflow

1. Inventory Contract Changes

Compare the old and new definitions by fully qualified symbol. Record:

  • message fields: number, name, type, cardinality, presence, oneof, defaults, and relevant options

  • enums: value name, number, aliases, reservations, and zero value

  • services: package, service, method, request and response types, and streaming mode

  • generated API inputs: package options, outer class names, namespaces, and custom options

Ignore formatting-only changes after confirming they do not alter descriptors or generated APIs.

2. Evaluate Four Compatibility Dimensions

Assess each affected symbol independently:

  1. Binary wire — can old and new readers parse both old and new bytes without corruption or loss?

  2. Named formats — do ProtoJSON, text-format, REST-transcoded, or name-based consumers still work?

  3. Source and generated API — will regenerated clients compile and preserve presence, enum, and accessor behavior?

  4. Behavior and operations — do status codes, retry safety, deadlines, authorization, streaming, and resource bounds preserve the RPC contract?

Read protobuf compatibility rules for field, enum, presence, oneof, and serialization changes. Read gRPC contract review when services, methods, or runtime behavior change.

3. Trace Mixed-Version Scenarios

For every non-trivial change, reason through these paths:

  • old writer -> new reader

  • new writer -> old reader

  • old reader modifies and reserializes a new message

  • rollback after new writers have emitted new values

  • persisted old data read after the migration

For conditionally compatible changes, identify the exact writer constraint and the point at which it may be relaxed. A safe rollout commonly requires deploying readers before writers and retaining the old field or method until rollback is no longer needed.

4. Review Repository Evidence

Use the repository's own tooling when available:

  • compile descriptors with the project's protoc, Buf, Gradle, Maven, Bazel, or language-specific task

  • run configured breaking-change or lint checks

  • inspect generated-code diffs only when they are committed by repository convention

  • search call sites for exhaustive enum switches, presence assumptions, JSON field names, method paths, status handling, and retry configuration

  • look for compatibility fixtures or descriptor baselines before proposing a new mechanism

Do not claim a check passed unless you ran it. If a required tool or baseline is unavailable, name the unverified risk.

5. Produce an Actionable Review

Lead with one verdict:

  • Compatible — safe within the stated compatibility envelope

  • Rollout-dependent — parseable, but safe only with explicit sequencing or value constraints

  • Breaking — causes wire, named-format, source, or behavioral incompatibility

  • Insufficient context — the old schema, encoding, consumers, or deployment model is unknown

Then provide only evidence-backed findings. For each finding include:

[severity] Short title
Location: file and symbol or changed lines
Dimension: binary | JSON/text | source | behavior/operations
Change: old contract -> new contract
Impact: concrete failing mixed-version scenario
Remediation: smallest safe schema change or staged migration

Use blocker for corruption, unparsable data, tag reuse, or an unavoidable production break; high for likely cross-version data loss or unsafe RPC behavior; medium for bounded compatibility or operability risks; and low for maintainability issues that do not break the contract. Do not inflate style preferences into compatibility findings.

Conclude with:

  • a compact compatibility matrix for changed symbols

  • the rollout/rollback sequence if migration is required

  • targeted tests that would prove the remaining assumptions

Default Safety Principles

  • Never reuse a field or enum number, even after deletion; reserve deleted numbers and usually names.

  • Treat field-number changes and moving fields into an existing oneof as breaking.

  • Treat type and cardinality changes as migrations, even when their binary wire types are compatible.

  • Remember that adding a field or enum value can still break generated code or exhaustive consumers.

  • Review ProtoJSON separately: names and unknown-field behavior make its compatibility envelope narrower than binary protobuf.

  • Preserve unknown fields through read-modify-write paths when forward compatibility depends on them.

  • Prefer additive evolution: add a new field or RPC, migrate readers and writers, deprecate the old contract, then remove it only after the compatibility window closes.

  • Never recommend retries for a state-changing RPC without establishing idempotency or a deduplication mechanism.

  • Require realistic client deadlines and cancellation-aware server work for production RPCs.

Avoid False Positives

  • Do not require every service to use streaming, retries, health checks, or HTTP transcoding.

  • Do not flag a new optional field as breaking solely because old clients ignore it.

  • Do not call a wire-compatible type change safe without checking value ranges and rollout order.

  • Do not assume a renamed field is harmless when JSON, text format, reflection, or generated source APIs are consumers.

  • Do not demand reservations for fields that never shipped; ask for release history when that distinction matters.

Files

references/protobuf-compatibility.md

Protobuf Compatibility Rules

Use this reference when a review changes messages, fields, enums, serialization, or generated APIs. Apply it to the actual encoding and runtimes in scope.

Classify the Change

Binary wire-unsafe

Treat these as breaking unless all serialized data and every reader/writer can be migrated atomically:

  • changing an existing field number

  • reusing a deleted or previously shipped field number

  • reusing a deleted enum number

  • moving fields into an existing oneof

  • changing between types with different wire encodings, such as string and an integer

Never rely on an apparently unused tag having no historical data. Old binaries, logs, queues, and rollback artifacts may still contain it.

Binary wire-safe, with other dimensions still to review
  • adding a field with a new number

  • removing a field while permanently reserving its number; reserve its name when name reuse is also unsafe

  • adding an enum value with a new number

  • moving one explicit-presence field into a new oneof

  • changing a single-field oneof to an explicit-presence field

  • changing a field to an extension with the same number and type

These can still break source code, business logic, JSON consumers, validation, or exhaustive enum handling.

Binary-compatible but rollout-dependent

These pairs can parse the same wire representation but may change values or lose data. Prefer adding a new field. If a migration is unavoidable, keep writers within the old domain until every reader has upgraded and rollback is closed.

ChangeRequired constraint or risk
int32, uint32, int64, uint64, boolOld readers may truncate or reinterpret values; boolean semantics are especially risky.
sint32 <-> sint64Values outside the narrower range change when read as sint32. These are not compatible with ordinary integer encodings.
fixed32 <-> sfixed32; fixed64 <-> sfixed64Signedness changes application meaning.
string <-> bytesBytes must remain valid UTF-8 for string readers. Generated APIs change.
embedded message <-> bytesBytes must always contain that message encoding; generated APIs change.
enum <-> integer typesUnknown-enum representation and generated behavior vary by language.
singular <-> repeated for strings, bytes, or messagesA singular reader keeps the last primitive value or merges messages; information can be lost.
map <-> its repeated entry messageMap readers may reorder entries and discard duplicate keys.

Numeric repeated fields are normally packed and are not safely interchangeable with singular fields. Treat any cardinality change as a data migration rather than a cleanup.

Deletion and Replacement Pattern

For a shipped field that must change type or meaning:

  1. Add a new field with a new number and a distinct name.

  2. Deploy readers that understand both fields.

  3. Deploy writers that populate the new field, and dual-write if rollback requires it.

  4. Backfill persisted data where needed.

  5. Stop reading and writing the old field only after old binaries and rollback are gone.

  6. Remove the old field and reserve its number and name.

Do not reserve the old number while the field is still declared. Do not reuse the old number for the replacement.

Presence, Defaults, and oneof

  • Changing implicit scalar presence to explicit optional presence is wire-compatible but changes generated APIs and the meaning of default values. Check merge, patch, equality, and serialization behavior.

  • An implicit-presence scalar cannot distinguish "unset" from its default value. If zero, empty, or false is meaningful in an update API, use explicit presence or a field mask.

  • Adding a field to a oneof is generally parseable, but old clients can clear an unknown member when they set a known member and reserialize. Review read-modify-write paths.

  • Removing a oneof member makes it impossible for a new reader to know which removed member had been set. Preserve the number and plan the migration.

  • Never add a required field. Older writers cannot populate it, and partial rollout or rollback becomes unsafe.

  • Do not change explicit defaults in proto2; version-skewed readers can interpret the same absent field differently.

Enums

  • Keep a zero-valued *_UNSPECIFIED first value unless the established contract deliberately uses another zero value.

  • Adding a value is binary-safe but may break exhaustive switches or older business logic. Search generated-language consumers.

  • When deleting a value, reserve both its number and, where names are part of the contract, its name.

  • For aliases, add the new alias after the old one. A safe rename requires staged parser and serializer rollout before removing the old name.

ProtoJSON and Other Named Formats

Review name-based formats separately from the binary wire format:

  • field and enum names can be serialized contract data, so renaming may break readers

  • ProtoJSON does not preserve unknown fields, narrowing forward compatibility

  • adding fields or enum values can fail older parsers that reject unknown names

  • changing json_name, integer/string representation, bytes encoding, or oneof shape can alter the public JSON schema

  • HTTP transcoding can expose message fields and enum names even when the internal transport is binary gRPC

Ask whether stored JSON exists. If it does, include historical payloads in compatibility tests.

Verification Matrix

Use real generated runtimes where behavior can vary by language:

WriterReaderWhat to assert
oldnewValues, presence, enum handling, and validation remain correct.
newoldUnknown data is tolerated and known values are not reinterpreted.
oldnew -> modify -> serialize -> oldUnknown fields survive and known fields are not cleared.
newold -> modify -> serialize -> newNew fields or oneof members are not silently lost.

Also compile descriptors, run the repository's breaking-change checker, test boundary values for widened/narrowed numeric domains, and round-trip any supported JSON representation.

Primary References

Requirements and compatibility

Written for: GitHub Copilot

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

First committed by
GitHub avatar of MnilaxMnilax
Publisher
GitHub (Official)
Distributed by
GitHub
Source
github/awesome-copilot · skills/protobuf-grpc-api-review · commit 797337f
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced
Contributors
Mnilax

AutoGineer is not affiliated with or endorsed by Mnilax or GitHub.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download protobuf-grpc-api-review.zip