use-buf-plugins
Skill207 starsChanged 35 days agoApache-2.0View on GitHub
Select, pin, configure, install, build, and troubleshoot Buf code-generation plugins across remote BSR and local execution. Use for buf.gen.yaml plugin entries, protoc-gen-* tools, generated Go/Python/TypeScript/OpenAPI outputs, offline generation, BSR connectivity or rate-limit failures, OCI-packaged plugin wrappers, or reproducing plugins from bufbuild/plugins.
In this repository37 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/skills/unsafe-checker/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/rust-rustrover-cargo.mdcCursor rule
- ast-grepSkill
- auv-wayland-renderingSkill
- create-prSkill
- domain-cliSkill
- domain-cloud-nativeSkill
- domain-mlSkill
- domain-webSkill
- m01-ownershipSkill
- m02-resourceSkill
- m03-mutabilitySkill
- m04-zero-costSkill
- m05-type-drivenSkill
- m06-error-handlingSkill
- m07-concurrencySkill
- m09-domainSkill
- m10-performanceSkill
- m11-ecosystemSkill
- m12-lifecycleSkill
- m13-domain-errorSkill
- m14-mental-modelSkill
- m15-anti-patternSkill
- rust-call-graphSkill
- rust-code-navigatorSkill
- rust-deps-visualizerSkill
- rust-refactor-helperSkill
- rust-symbol-analyzerSkill
- rust-trait-explorerSkill
- simple-englishSkill
- unsafe-checkerSkill
- use-bufSkill
- use-pixiSkill
- use-protobufSkill
- auvSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 9 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Read repository instructions, every applicable buf.gen*.yaml, generation script, CI workflow, package manifest, and generated directory …
- Distinctive: line 15
Do not replace a working generator or rearrange generated paths without an explicit requirement.
- Very specific: line 19
Use a BSR remote plugin when network access is reliable and centralized execution is acceptable.
- Distinctive: line 21
Use a local plugin when:
- Distinctive: line 31
Read references/remote-and-local.md before changing plugin execution mode.
- Very specific: line 35
Prefer the plugin author's official binary/package or the upstream definitions in bufbuild/plugins.
- Distinctive: line 36
Treat each upstream plugin Dockerfile, version, and revision as immutable build input.
- Very specific: line 38
If using a maintained buf-build mirror, understand the convention: an upstream path like plugins/<family>/<plugin>/<version>/Dockerfile is …
- Distinctive: line 39
If the maintained image is acceptable, consume a pinned digest or immutable version.
- Very specific: line 51
Keep output paths aligned with Protobuf source/package paths unless an explicit buf.gen.yaml convention says otherwise.
- Distinctive: line 54
Read references/language-generators.md before adding or replacing a language generator.
- Distinctive: line 58
Run the plugin binary or OCI wrapper with a bounded smoke check appropriate to its entrypoint.
- Very specific: line 60
Run buf generate with every affected template.
- Distinctive: line 63
Run target-language formatting, compilation, tests, and type checks.
- Distinctive: line 67
Never pass registry credentials, source credentials, or private dependency tokens through Docker build arguments, image layers, generated …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Use Buf Plugins
Make code generation reproducible across languages and environments. Prefer an established generator, pin its version, preserve source-relative package structure, and verify generated output.
Inspect the Existing Generation Contract
- Read repository instructions, every applicable
buf.gen*.yaml, generation script, CI workflow, package manifest, and generated directory convention. - Identify each required artifact: message runtime, gRPC client/server, gateway, OpenAPI, language typing, or framework bindings.
- Record plugin source, version/revision, options, invocation strategy, input scope, output path, and runtime requirements.
- Do not replace a working generator or rearrange generated paths without an explicit requirement.
Choose Remote or Local Deliberately
Use a BSR remote plugin when network access is reliable and centralized execution is acceptable. Pin the upstream plugin version and revision when available; do not rely on latest for reproducible generation.
Use a local plugin when:
- generation must work offline or in an isolated network;
- the BSR is unavailable;
- authentication or codegen rate limits make remote generation unreliable;
- a private/custom plugin cannot run remotely;
- CI requires locally controlled binaries or images.
Remote generation sends the Protobuf input to the configured BSR executor. Confirm that this is acceptable for private schemas. Authenticate with the repository's approved mechanism when increased BSR limits are needed; never embed tokens in config.
Read references/remote-and-local.md before changing plugin execution mode.
Source and Package Local Plugins Reproducibly
- Prefer the plugin author's official binary/package or the upstream definitions in
bufbuild/plugins. - Treat each upstream plugin Dockerfile, version, and revision as immutable build input.
- A maintained mirror may build selected upstream
bufbuild/pluginsDockerfiles into OCI images. Verify its source mapping, image entrypoint, version tag, platforms, provenance, and update cadence before depending on it. - If using a maintained
buf-buildmirror, understand the convention: an upstream path likeplugins/<family>/<plugin>/<version>/Dockerfileis published as an image whose repository identifies<family>-<plugin>and whose tag identifies<version>. Reinspect the mirror documentation instead of hardcoding one publisher, version, or registry. - If the maintained image is acceptable, consume a pinned digest or immutable version. Otherwise build the upstream definition locally.
- Invoke
$use-docker-buildx-for-buildingbefore building or smoke-testing any plugin OCI image. Follow its platform,--load, naming, secret, runtime, and cleanup requirements.
OCI images are not automatically Buf local plugins. Buf expects an executable that reads a CodeGeneratorRequest from stdin and writes a CodeGeneratorResponse to stdout. Provide a narrow executable wrapper only after inspecting the image entrypoint; preserve stdin/stdout, forward arguments, use --rm, and never allocate a TTY.
Configure Outputs by Ecosystem
- Generate both runtime and service bindings required by the application.
- For Go, follow the official Go generated-code and gRPC plugin guidance and honor
go_package/managed-mode decisions. - For Python, generate runtime modules, gRPC bindings, and
.pyityping where the toolchain supports them. - For TypeScript, generate the ecosystem's customary
.tsor declaration artifacts. - For OpenAPI, use the repository's established grpc-gateway/OpenAPI generator and annotations. Do not hand-maintain a second schema generator.
- Keep output paths aligned with Protobuf source/package paths unless an explicit
buf.gen.yamlconvention says otherwise. - Pin generated-code runtime dependencies in each language package manager as well as pinning generators; generator reproducibility does not guarantee runtime compatibility.
Read references/language-generators.md before adding or replacing a language generator.
Validate Plugin Changes
- Run the plugin binary or OCI wrapper with a bounded smoke check appropriate to its entrypoint.
- Run
buf lint. - Run
buf generatewith every affected template. - Run
buf breaking --against '.git#branch=main'. - Inspect the generated diff for missing files, unexpected path changes, nondeterminism, and stale artifacts.
- Run target-language formatting, compilation, tests, and type checks.
- Repeat generation from a clean state when reproducibility is uncertain; generated output should be stable.
- For an air-gapped contract, repeat the complete generation with networking disabled and no hidden image pull or ambient PATH dependency.
Never pass registry credentials, source credentials, or private dependency tokens through Docker build arguments, image layers, generated files, or committed plugin wrappers.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

