Agent Skill
2/7/2026

protobuf-developer

Protobuf schema development guidelines. This skill should be used when writing, reviewing, or refactoring Protocol Buffer definitions to ensure consistency, backwards compatibility, and adherence to style guides.

I
imrenagi
0GitHub Stars
1Views
npx skills add imrenagi/skills

SKILL.md

Nameprotobuf-developer
DescriptionProtobuf schema development guidelines. This skill should be used when writing, reviewing, or refactoring Protocol Buffer definitions to ensure consistency, backwards compatibility, and adherence to style guides.

name: protobuf-developer description: Protobuf schema development guidelines. This skill should be used when writing, reviewing, or refactoring Protocol Buffer definitions to ensure consistency, backwards compatibility, and adherence to style guides.

Protobuf Developer

This skill provides best practices and rules for developing Protocol Buffer schemas (proto3).

When to Apply

Reference these guidelines when:

  • Defining new gRPC services and message types.
  • Modifying existing .proto files.
  • Refactoring message structures.
  • Ensuring backwards compatibility for evolving APIs.
  • Configuring Protobuf management, linting, and code generation using Buf.

Google AIP References

The following references are based on Google API Improvement Proposals (AIPs). Use these when designing resource-oriented APIs.

Important: When implementing these patterns, you must modify the protobuf package name and resource type domains to match the current application context (e.g., use package imrenagi.com.v1; instead of package google.example.v1;).

Resource Design

ReferenceWhen to Use
AIP-121: Resource-Oriented DesignDesigning a new API or service; need to structure resources and collections consistently.
AIP-122: Resource NamesDefining the name field for resources; need the correct URI path format for identifiers.
AIP-123: Resource TypesAnnotating messages with google.api.resource; need to define resource type patterns.
AIP-124: Resource AssociationReferencing resources from other messages; using google.api.resource_reference.
AIP-126: EnumerationsDefining enum types; need _UNSPECIFIED zero-value and naming conventions.
AIP-127: HTTP/gRPC TranscodingAdding google.api.http annotations; need to map gRPC methods to REST endpoints.
AIP-128: Declarative-Friendly InterfacesBuilding APIs consumed by infrastructure-as-code tools like Terraform.
AIP-129: Server-Modified ValuesHandling fields computed or modified by the server (e.g., create_time, update_time).

Standard Methods

ReferenceWhen to Use
AIP-130: MethodsUnderstanding the general structure and naming of RPC methods.
AIP-131: Get MethodsImplementing a method to retrieve a single resource by name.
AIP-132: List MethodsImplementing a method to list resources with pagination.
AIP-133: Create MethodsImplementing a method to create a new resource.
AIP-134: Update MethodsImplementing a method to update an existing resource with field masks.
AIP-135: Delete MethodsImplementing a method to delete a resource.
AIP-136: Custom MethodsImplementing non-CRUD actions (e.g., :cancel, :move, :archive).

Field Conventions

ReferenceWhen to Use
AIP-140: Field NamesNaming fields; need snake_case conventions and standard suffixes.
AIP-141: QuantitiesDefining numeric fields for counts, sizes, or quantities.
AIP-142: Time and DurationUsing google.protobuf.Timestamp and google.protobuf.Duration.
AIP-143: Standardized CodesDefining status codes, language codes, or other standardized values.
AIP-144: Repeated FieldsUsing repeated fields for lists; understanding pluralization and ordering.
AIP-145: RangesDefining start/end or min/max field pairs for ranges.
AIP-146: Generic FieldsUsing google.protobuf.Any or google.protobuf.Struct for dynamic data.
AIP-147: Sensitive FieldsMarking fields containing PII or secrets.
AIP-148: Standard FieldsUsing common fields like name, display_name, title, description.
AIP-149: Unset Field ValuesDistinguishing between unset and default values with optional fields.
AIP-203: Field BehaviorAnnotating fields with REQUIRED, OUTPUT_ONLY, IMMUTABLE, etc.

Operations & Patterns

ReferenceWhen to Use
AIP-151: Long-Running OperationsOperations taking > 2 seconds; using google.longrunning.Operation.
AIP-152: JobsModeling user-managed background tasks or recurring operations.
AIP-153: Import/ExportImplementing bulk data import or export operations.
AIP-154: ETagsAdding optimistic concurrency control with ETags.
AIP-155: Request IDsSupporting client-provided request IDs for idempotency.
AIP-156: Singleton ResourcesModeling resources with only one instance (e.g., settings, config).
AIP-157: Partial ResponsesAllowing clients to request specific fields with read masks.
AIP-158: PaginationImplementing page_size and page_token for list methods.
AIP-159: Reading Across CollectionsListing resources across multiple parents (using - wildcard).
AIP-160: FilteringAdding filter expressions to list methods.
AIP-161: Field MasksUsing google.protobuf.FieldMask for partial updates.
AIP-162: Resource RevisionsTracking historical versions or revisions of resources.
AIP-163: Change ValidationValidating changes before applying (dry-run mode).
AIP-164: Soft DeleteImplementing soft-delete with Undelete and retention periods.
AIP-165: PurgeImplementing bulk deletion of soft-deleted resources.

Batch Operations

ReferenceWhen to Use
AIP-231: Batch GetRetrieving multiple resources by name in a single request.
AIP-233: Batch CreateCreating multiple resources in a single request.
AIP-234: Batch UpdateUpdating multiple resources in a single request.
AIP-235: Batch DeleteDeleting multiple resources in a single request.
AIP-236: Policy PreviewPreviewing the effect of policy changes before applying them.

Compatibility & Versioning

ReferenceWhen to Use
AIP-180: Backwards CompatibilityUnderstanding what constitutes a breaking change; evolving APIs safely.
AIP-181: Stability LevelsMarking APIs as alpha, beta, or stable.
AIP-182: External DependenciesManaging dependencies on external proto definitions.
AIP-185: VersioningStructuring package names with version suffixes (v1, v2).

Style & Documentation

ReferenceWhen to Use
AIP-190: Naming ConventionsNaming messages, enums, fields, and services consistently.
AIP-191: File StructureOrganizing proto files within a package.
AIP-192: DocumentationWriting comments and documentation in proto files.
AIP-193: ErrorsReturning structured errors with google.rpc.Status.
AIP-194: RetryDocumenting retry behavior and idempotency.
AIP-200: PrecedentUnderstanding when to follow existing patterns vs. innovation.
AIP-202: Field FormatsUsing format annotations for UUIDs, emails, URIs, etc.
AIP-205: Beta Blocking ChangesManaging breaking changes in beta APIs.
AIP-210: UnicodeHandling Unicode strings and normalization.
AIP-211: AuthorizationDocumenting authorization requirements.
AIP-213: Common ComponentsUsing shared proto definitions across services.
AIP-214: ExpirationModeling time-to-live or expiration for resources.
AIP-215: IsolationDesigning multi-tenant or isolated resource APIs.
AIP-216: StatesModeling resource lifecycle states.
AIP-217: Unreachable ResourcesHandling references to resources that may not exist.

Buf References

Use these references when configuring Buf for linting, breaking change detection, and code generation.

ReferenceWhen to Use
Protobuf Management with BufSetting up Buf for a new project; understanding buf.yaml and core commands.
LintingConfiguring lint rules; resolving conflicts between Buf linter and AIP standards.
Breaking Change DetectionRunning buf breaking to prevent backwards-incompatible changes.
Directory StructureOrganizing proto files and packages for Buf modules.
Code GenerationConfiguring buf.gen.yaml for Go, gRPC-Gateway, and OpenAPI code generation.

How to Use

  1. Read the Rules: Before starting a new feature or refactor, browse the relevant rule files.
  2. Follow the Examples: Use the provided "Correct" code patterns as templates.
  3. Ensure Consistency: Apply the same patterns across all proto files.

Each rule file contains:

  • Brief explanation of the rule
  • "Incorrect" examples (Bad patterns)
  • "Correct" examples (Recommended patterns)
  • Additional context and references
Skills Info
Original Name:protobuf-developerAuthor:imrenagi