This document outlines best practices for versioning, field management, and common data patterns in Protocol Buffers.
From protobuf-toolsnpx claudepluginhub utakatakyosui/c2lab --plugin protobuf-toolsprotobuf-tools/guides//best-practicesYou are an expert in Claude Code plugin development. Provide comprehensive best practices guidance based on the official documentation and lessons learned from the plugin ecosystem.
/best-practicesYou are generating coding best practices documentation for the project. Extract patterns from PR review comments and/or codebase analysis to create actionable guidelines.
/best-practicesLoad project-specific best practices (40+ rules per framework) and audit codebase
/best-practicesHolistic codebase audit that auto-detects the stack and produces a prioritized improvement roadmap with level-of-effort estimates.
/best-practicesPlease perform a comprehensive best practices review of the following code:
This document outlines best practices for versioning, field management, and common data patterns in Protocol Buffers.
Breaking Change を避けるため、パッケージ名にバージョンを含めることを強く推奨します。
package my.server.v1; // Good
reserved を使って再利用を防ぐ。message User {
reserved 2, 15, 9 to 11;
reserved "foo", "bar";
string username = 1;
}
required は proto3 では廃止されました。すべてのフィールドは optional と見なすべきです。時刻を扱う場合は google.protobuf.Timestamp を使用します。
import "google/protobuf/timestamp.proto";
message Log {
google.protobuf.Timestamp created_at = 1;
}
空のメッセージが必要な場合は google.protobuf.Empty を使用します。
import "google/protobuf/empty.proto";
service Health {
rpc Check(google.protobuf.Empty) returns (google.protobuf.Empty);
}