重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
protobuf by bufbuild/claude-plugins
npx skills add https://github.com/bufbuild/claude-plugins --skill protobuf.proto 文件时buf.yaml 或 buf.gen.yaml 时在编写 proto 代码之前,请先审阅项目中现有的 .proto 文件。遵循其在命名、字段顺序、结构模式、验证和文档风格方面的约定。如果项目中没有现有文件,请询问用户应使用何种风格或模仿哪个现有库。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
进行更改后务必运行:
buf format -w && buf lint
首先检查是否存在 Makefile——许多项目使用 make lint 或 make format。
在认为更改完成之前,请修复所有错误。
| 任务 | 参考链接 |
|---|---|
| 字段类型、枚举、oneof、映射 | quick_reference.md |
| 模式演进、破坏性变更 | best_practices.md |
| 验证约束 | protovalidate.md |
| 完整服务示例 | examples.md, assets/ |
| buf CLI、buf.yaml、buf.gen.yaml | buf_toolchain.md |
| 从 protoc 迁移 | migration.md |
| Lint 错误、常见问题 | troubleshooting.md |
| Proto API 审查清单 | review_checklist.md |
创建目录结构:
proto/
├── buf.yaml
├── buf.gen.yaml
└── company/
└── domain/
└── v1/
└── service.proto
使用 assets/buf.yaml 作为起点
在 buf.yaml 中添加 buf.build/bufbuild/protovalidate 作为依赖项,并运行 buf dep update
使用 assets/buf.gen.*.yaml 作为代码生成配置
| 模板 | 用途 |
|---|---|
buf.gen.go.yaml | Go with gRPC |
buf.gen.go-connect.yaml | Go with Connect |
buf.gen.ts.yaml | TypeScript with Connect |
buf.gen.python.yaml | Python with gRPC |
buf.gen.java.yaml | Java with gRPC |
位于 assets/proto/example/v1/:
| 模板 | 描述 |
|---|---|
book.proto | 实体消息、BookRef oneof、枚举 |
book_service.proto | 包含批量操作、分页、排序的完整 CRUD |
buf format -w && buf lint保留字段编号 和 名称:
reserved 4;
reserved "old_field_name";
运行 buf breaking --against '.git#branch=main' 进行验证
生产环境 API 中的每个字段都应具有适当的验证。完整参考请见 protovalidate.md。
常见约束:
.string.uuid、.string.email、.string.uri、.string.pattern.string.min_len、.string.max_len.int32.gte、.uint32.lte.enum.defined_only、.enum.not_in = 0.repeated.min_items、.repeated.max_items(buf.validate.field).required = true(buf.validate.oneof).required = true进行更改后:
buf format -w(应用格式化)buf lint(检查样式规则)buf breaking --against '.git#branch=main'(如果修改现有模式)每周安装次数
44
代码仓库
GitHub 星标数
12
首次出现
2026年1月30日
安全审计
安装于
opencode39
gemini-cli38
codex37
github-copilot36
cursor35
amp35
.proto filesbuf.yaml or buf.gen.yamlBefore writing proto code, review existing .proto files in the project. Match conventions for naming, field ordering, structural patterns, validation, and documentation style. If none exists, ask the user what style should be used or an existing library to emulate.
Always run after making changes:
buf format -w && buf lint
Check for a Makefile first—many projects use make lint or make format.
Fix all errors before considering the change complete.
| Task | Reference |
|---|---|
| Field types, enums, oneofs, maps | quick_reference.md |
| Schema evolution, breaking changes | best_practices.md |
| Validation constraints | protovalidate.md |
| Complete service examples | examples.md, assets/ |
| buf CLI, buf.yaml, buf.gen.yaml | buf_toolchain.md |
| Migrating from protoc | migration.md |
| Lint errors, common issues |
Create directory structure:
proto/
├── buf.yaml
├── buf.gen.yaml
└── company/
└── domain/
└── v1/
└── service.proto
Use assets/buf.yaml as starting point
Add buf.build/bufbuild/protovalidate as a dependency in buf.yaml and run buf dep update
Use assets/buf.gen.*.yaml for code generation config
| Template | Use For |
|---|---|
buf.gen.go.yaml | Go with gRPC |
buf.gen.go-connect.yaml | Go with Connect |
buf.gen.ts.yaml | TypeScript with Connect |
buf.gen.python.yaml | Python with gRPC |
buf.gen.java.yaml | Java with gRPC |
Located in assets/proto/example/v1/:
| Template | Description |
|---|---|
book.proto | Entity message, BookRef oneof, enum |
book_service.proto | Full CRUD with batch ops, pagination, ordering |
buf format -w && buf lintReserve the field number AND name:
reserved 4;
reserved "old_field_name";
Run buf breaking --against '.git#branch=main' to verify
Every field in a production API should have appropriate validation. See protovalidate.md for the full reference.
Common constraints:
.string.uuid, .string.email, .string.uri, .string.pattern.string.min_len, .string.max_len.int32.gte, .uint32.lte.enum.defined_only, .enum.not_in = 0.repeated.min_items, After making changes:
buf format -w (apply formatting)buf lint (check style rules)buf breaking --against '.git#branch=main' (if modifying existing schemas)Weekly Installs
44
Repository
GitHub Stars
12
First Seen
Jan 30, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode39
gemini-cli38
codex37
github-copilot36
cursor35
amp35
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
169,700 周安装
前端XSS漏洞扫描器 - React/Vue/Angular/JavaScript代码安全检测工具
245 周安装
ln-782测试运行器:自动化多框架测试执行与覆盖率报告工具
248 周安装
高级提示工程模式指南:优化大语言模型性能与可控性
247 周安装
法人成りシミュレーションと手続きガイド - 個人事業主から法人設立の税額比較
244 周安装
Telegram Bot 开发指南:Node.js/Python 构建机器人教程(含Webhook、支付、部署)
247 周安装
React/React Native 组件脚手架生成器 - 自动化创建生产级组件
248 周安装
| troubleshooting.md |
| Proto API review checklist | review_checklist.md |
.repeated.max_items(buf.validate.field).required = true(buf.validate.oneof).required = true