Skill

protobuf-design

Protocol Buffers and Interface Definition Languages for service contracts

From formal-specification
Install
1
Run in your terminal
$
npx claudepluginhub melodic-software/claude-code-plugins --plugin formal-specification
Tool Access

This skill is limited to using the following tools:

ReadGlobGrepWriteEditmcp__perplexity__searchmcp__context7__resolve-library-idmcp__context7__query-docs
Supporting Assets
View in Repository
references/csharp-implementation.md
references/grpc-patterns.md
references/proto-syntax.md
references/schema-evolution.md
Skill Content

Protocol Buffers Design Skill

When to Use This Skill

Use this skill when:

  • Designing gRPC services - Protocol Buffers (proto3) for typed service contracts
  • Schema definition - Messages, enums, services, streaming patterns
  • Implementing in C# - gRPC with ASP.NET Core
  • Schema evolution - Backward/forward compatibility, versioning

MANDATORY: Documentation-First Approach

Before creating protobuf definitions:

  1. Invoke docs-management skill for API contract patterns
  2. Verify proto3 syntax via MCP servers (context7 for latest spec)
  3. Base all guidance on Google's Protocol Buffers documentation

Why Protocol Buffers?

BenefitDescription
EfficientBinary format, 3-10x smaller than JSON
TypedStrong typing with code generation
VersionedBuilt-in backward/forward compatibility
Cross-LanguageSupports C#, Java, Python, Go, etc.
gRPC IntegrationNative service definition for gRPC

Proto3 Structure Overview

syntax = "proto3";

package ecommerce.orders.v1;

option csharp_namespace = "ECommerce.Orders.V1";

import "google/protobuf/timestamp.proto";

service OrderService {
  rpc GetOrder(GetOrderRequest) returns (Order);
  rpc ListOrders(ListOrdersRequest) returns (ListOrdersResponse);
  rpc WatchStatus(WatchRequest) returns (stream StatusUpdate);
}

enum OrderStatus {
  ORDER_STATUS_UNSPECIFIED = 0;
  ORDER_STATUS_DRAFT = 1;
  ORDER_STATUS_SUBMITTED = 2;
}

message Order {
  string id = 1;
  string customer_id = 2;
  OrderStatus status = 3;
  google.protobuf.Timestamp created_at = 4;
}

For complete template: See proto-syntax.md

Quick Reference

gRPC RPC Types

PatternSyntaxUse Case
Unaryrpc Get(Req) returns (Resp)Simple CRUD
Server Streamrpc List(Req) returns (stream Resp)Large results, updates
Client Streamrpc Upload(stream Req) returns (Resp)Batch uploads
Bidirectionalrpc Chat(stream Req) returns (stream Resp)Real-time sync

For streaming patterns: See grpc-patterns.md

Naming Conventions

ElementConventionExample
Packagelowercase.dots.versionecommerce.orders.v1
ServicePascalCase + ServiceOrderService
RPCPascalCase verbCreateOrder
MessagePascalCaseOrderCreatedEvent
Fieldsnake_casecustomer_id
EnumSCREAMING_PREFIX_VALUEORDER_STATUS_DRAFT

Workflow

  1. Identify Resources: What entities does the service manage?
  2. Define Messages: Data structures for each resource
  3. Design Service Methods: CRUD operations, queries, commands
  4. Add Streaming: Where real-time updates needed
  5. Document: Comments for all messages and fields
  6. Lint: Use Buf or protolint for consistency
  7. Version: Plan for schema evolution
  8. Generate: Create client/server code

References

Load on-demand based on need:

ReferenceLoad When
proto-syntax.mdCreating proto definitions, well-known types, advanced patterns
grpc-patterns.mdDesigning streaming services (server, client, bidirectional)
csharp-implementation.mdImplementing gRPC in .NET/C# with ASP.NET Core
schema-evolution.mdPlanning schema changes, Buf CLI, versioning

Related Skills (Cross-Plugin)

PhaseSkillPluginPurpose
DESIGNprotobuf-design (this skill)formal-specificationArchitecture research, pattern selection
AUTHORINGN/Aspec-driven-developmentGap: protobuf-authoring not yet created

Workflow: Design (research gRPC patterns) → Author (create .proto files) → Generate (code generation)

Note: Unlike OpenAPI and AsyncAPI, protobuf authoring is typically straightforward enough that the design skill's C# implementation reference covers concrete creation. A dedicated protobuf-authoring skill may be added if demand warrants.

External References

MCP Research

For current protobuf patterns and tools:

perplexity: "Protocol Buffers proto3" "gRPC service design patterns"
context7: "grpc" (for official documentation)
microsoft-learn: "gRPC ASP.NET Core" (for .NET implementation)

Version History

  • v2.0.0 (2026-01-17): Refactored to progressive disclosure pattern
    • Extracted 4 reference files (~550 lines)
    • Hub reduced from 700 to ~130 lines
    • Updated NuGet package versions (Grpc.AspNetCore 2.71.0)
  • v1.0.0 (2025-12-26): Initial release

Last Updated: 2026-01-17

Similar Skills
ui-ux-pro-max

UI/UX design intelligence for web and mobile. Includes 50+ styles, 161 color palettes, 57 font pairings, 161 product types, 99 UX guidelines, and 25 chart types across 10 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind, shadcn/ui, and HTML/CSS). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, and check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, and mobile app. Elements: button, modal, navbar, sidebar, card, table, form, and chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, and flat design. Topics: color systems, accessibility, animation, layout, typography, font pairing, spacing, interaction states, shadow, and gradient. Integrations: shadcn/ui MCP for component search and examples.

49.4k
Stats
Parent Repo Stars40
Parent Repo Forks6
Last CommitJan 17, 2026