Protobuf and gRPC API Review

Protobuf and gRPC API Review

Reviews Protocol Buffer and gRPC API changes for wire and JSON compatibility, safe schema evolution, rollout hazards and contract quality.

Skill files3 files

references/

SKILL.md119 lines
1
---
2
name: protobuf-grpc-api-review
3
description: '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.'
4
---
5
6
# Protobuf and gRPC API Review
7
8
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.
9
10
## Start With the Compatibility Envelope
11
12
Before deciding whether a change is safe, determine:
13
14
- the old and new schema, not only the final file
15
- whether payloads use binary protobuf, ProtoJSON, text format, or more than one encoding
16
- whether messages persist in databases, queues, logs, caches, or events
17
- whether clients exist outside the repository or release independently
18
- the protobuf syntax or edition and the generated languages/runtime versions
19
- whether HTTP/JSON transcoding, reflection, service config, or schema registries expose the contract
20
- the deployment order, rollback window, and duration of mixed-version operation
21
22
If context is missing, state the assumption and lower confidence. Do not call a change backward-compatible from the new schema alone.
23
24
## Review Workflow
25
26
### 1. Inventory Contract Changes
27
28
Compare the old and new definitions by fully qualified symbol. Record:
29
30
- message fields: number, name, type, cardinality, presence, `oneof`, defaults, and relevant options
31
- enums: value name, number, aliases, reservations, and zero value
32
- services: package, service, method, request and response types, and streaming mode
33
- generated API inputs: package options, outer class names, namespaces, and custom options
34
35
Ignore formatting-only changes after confirming they do not alter descriptors or generated APIs.
36
37
### 2. Evaluate Four Compatibility Dimensions
38
39
Assess each affected symbol independently:
40
41
1. **Binary wire** — can old and new readers parse both old and new bytes without corruption or loss?
42
2. **Named formats** — do ProtoJSON, text-format, REST-transcoded, or name-based consumers still work?
43
3. **Source and generated API** — will regenerated clients compile and preserve presence, enum, and accessor behavior?
44
4. **Behavior and operations** — do status codes, retry safety, deadlines, authorization, streaming, and resource bounds preserve the RPC contract?
45
46
Read [protobuf compatibility rules](references/protobuf-compatibility.md) for field, enum, presence, `oneof`, and serialization changes. Read [gRPC contract review](references/grpc-contract-review.md) when services, methods, or runtime behavior change.
47
48
### 3. Trace Mixed-Version Scenarios
49
50
For every non-trivial change, reason through these paths:
51
52
- old writer -> new reader
53
- new writer -> old reader
54
- old reader modifies and reserializes a new message
55
- rollback after new writers have emitted new values
56
- persisted old data read after the migration
57
58
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.
59
60
### 4. Review Repository Evidence
61
62
Use the repository's own tooling when available:
63
64
- compile descriptors with the project's `protoc`, Buf, Gradle, Maven, Bazel, or language-specific task
65
- run configured breaking-change or lint checks
66
- inspect generated-code diffs only when they are committed by repository convention
67
- search call sites for exhaustive enum switches, presence assumptions, JSON field names, method paths, status handling, and retry configuration
68
- look for compatibility fixtures or descriptor baselines before proposing a new mechanism
69
70
Do not claim a check passed unless you ran it. If a required tool or baseline is unavailable, name the unverified risk.
71
72
### 5. Produce an Actionable Review
73
74
Lead with one verdict:
75
76
- **Compatible** — safe within the stated compatibility envelope
77
- **Rollout-dependent** — parseable, but safe only with explicit sequencing or value constraints
78
- **Breaking** — causes wire, named-format, source, or behavioral incompatibility
79
- **Insufficient context** — the old schema, encoding, consumers, or deployment model is unknown
80
81
Then provide only evidence-backed findings. For each finding include:
82
83
```text
84
[severity] Short title
85
Location: file and symbol or changed lines
86
Dimension: binary | JSON/text | source | behavior/operations
87
Change: old contract -> new contract
88
Impact: concrete failing mixed-version scenario
89
Remediation: smallest safe schema change or staged migration
90
```
91
92
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.
93
94
Conclude with:
95
96
- a compact compatibility matrix for changed symbols
97
- the rollout/rollback sequence if migration is required
98
- targeted tests that would prove the remaining assumptions
99
100
## Default Safety Principles
101
102
- Never reuse a field or enum number, even after deletion; reserve deleted numbers and usually names.
103
- Treat field-number changes and moving fields into an existing `oneof` as breaking.
104
- Treat type and cardinality changes as migrations, even when their binary wire types are compatible.
105
- Remember that adding a field or enum value can still break generated code or exhaustive consumers.
106
- Review ProtoJSON separately: names and unknown-field behavior make its compatibility envelope narrower than binary protobuf.
107
- Preserve unknown fields through read-modify-write paths when forward compatibility depends on them.
108
- 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.
109
- Never recommend retries for a state-changing RPC without establishing idempotency or a deduplication mechanism.
110
- Require realistic client deadlines and cancellation-aware server work for production RPCs.
111
112
## Avoid False Positives
113
114
- Do not require every service to use streaming, retries, health checks, or HTTP transcoding.
115
- Do not flag a new optional field as breaking solely because old clients ignore it.
116
- Do not call a wire-compatible type change safe without checking value ranges and rollout order.
117
- Do not assume a renamed field is harmless when JSON, text format, reflection, or generated source APIs are consumers.
118
- Do not demand reservations for fields that never shipped; ask for release history when that distinction matters.
119

© GitHub, Inc. · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…