Protobuf with Buf (Project Standard)

We standardize protobuf contract management with Buf.

Files

  • buf.yaml: module + lint/breaking rules
  • buf.gen.yaml: code generation targets
  • proto/: all .proto sources

Typical workflow

Lint

buf lint

Breaking change check

(Requires a reference point, typically the main branch or last release tag)

buf breaking --against '.git#branch=main'

Generate

buf generate

Notes for Haskell (grpc-haskell + proto-lens)

Buf orchestrates protoc invocations, but Haskell codegen still needs a protoc plugin. Two common approaches:

  1. Local plugin: install proto-lens-protoc and configure buf to call it.
  2. Remote plugin: if/when a stable remote plugin is available.

We will add Haskell generation into core/src-gen/ and include that directory in package.yaml once the toolchain is pinned.