protobuf-contracts

Establish design-by-contract conventions for .proto files with buf linting.

Updated Apr 21, 2026
One-click install
npx skills add https://github.com/erikshafer/CritterCab --skill protobuf-contracts
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: protobuf-contracts
Source: https://github.com/erikshafer/CritterCab/tree/main/docs/skills/protobuf-contracts
Command: npx skills add https://github.com/erikshafer/CritterCab --skill protobuf-contracts

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires buf, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides conventions for hand-authored .proto files, ensuring a contract-first design approach that maintains readability and maintainability of protobuf services in CritterCab.

Core Features & Use Cases

  • Contract-First Workflow: Emphasizes the importance of the .proto file in the design process before code generation and implementation.
  • File Layout & Naming: Establishes standards for file structure, package names, and namespaces.
  • Type Conventions: Offers guidelines for using specific types like strings, timestamps, durations, and monetary amounts.
  • Field Numbering & Versioning: Explains numbering strategies and how to handle major version transitions.

Quick Start

Author your .proto file using the provided guidelines and run buf breaking to classify changes.

Frequently Asked Questions about protobuf-contracts

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is contract-first design in protobuf services?

Contract-first design in protobuf services prioritizes defining clear .proto files before code generation. This methodology ensures readability, maintainability, and clarity for service interfaces, message structures, and event sourcing.

How do I handle protobuf field numbering and versioning?

Handle protobuf field numbering and versioning by applying established numbering strategies and managing major version transitions carefully. Utilize buf breaking to classify changes and control versioning effectively.

Do I need buf to maintain .proto file conventions?

Yes, you need buf for linting and versioning control when maintaining .proto file conventions. It helps enforce file layout, package naming standards, and validates structural changes.

What are the best practices for protobuf type conventions and file layout?

Best practices for protobuf type conventions include using specific types for strings, timestamps, durations, and monetary amounts. File layout standards dictate proper structure for package names and namespaces.

How does design by contract support event sourcing in gRPC?

Design by contract supports event sourcing in gRPC by establishing clarity in protobuf definitions for service and message interfaces. This ensures reliable communication and structural integrity across distributed systems.

Why does my protobuf service break after updating .proto definitions?

Your protobuf service breaks after updating .proto definitions due to incompatible structural changes. Run buf breaking to classify changes and manage major version transitions to prevent compatibility issues.