harness/plugins/safe-edits/claude/skills/proto-change/SKILL.md
buf-validated Protocol Buffers authoring — write or modify .proto files with pre-edit analysis of wire-compat constraints, style conventions, and coordinated codegen + downstream consumer updates. Use for any non-trivial .proto edit (new message/field/rpc, type change, deprecation).
npx skillsauth add popoffvg/dotfiles proto-changeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Write and modify .proto files as a structured workflow — analogous to go-modify. Treat the .proto as the source of truth and generated Go/TS bindings as derived artifacts that must stay in lock-step.
Use when:
.proto file or package*.pb.go / *_grpc.pb.go / generated TS typesSkip when:
buf, protoc, or the project's codegen task available (check buf.gen.yaml, Makefile, mise.toml, package.json).gitignore if the repo commits generated codeRead the entire target .proto file (and its import chain one level deep) before any edit.
syntax — proto2 vs proto3 changes defaults (optional/required, zero values)package + option go_package / option java_package — generated path is derived from thesereserved)snake_case field names, PascalCase messages, SCREAMING_SNAKE_CASE enum values, enum zero value suffix (_UNSPECIFIED)reserved <num>; and reserved "name";google.api.http, validate.rules, buf.validate — follow the existing patternstream on either side; clients regenerate differentlygoogle.protobuf.Timestamp, Duration, Empty, Struct over reinventingIdentify every consumer before editing:
buf.gen.yaml plugins → output dirs)*.pb.go@<scope>/<api>-ts)_notes/ before editing (new field + dual-write + flip + remove).Never rm -rf a generated directory. Re-run codegen in place. If output looks stale, delete only files the generator owns and re-emit. Generated files belong in the same commit as the .proto change.
Never pause mid-task to ask "shall I proceed?" once intent is clear. Only stop on destructive ambiguity (e.g., the field number you want is in a reserved range).
.protoUse Edit tool. Match existing style. For removals, add reserved entries in the same edit.
buf lint # or: buf lint <module>
buf breaking --against '.git#branch=main' # if the project tracks wire compat
Fix all findings. buf breaking failures are not optional unless the migration plan from Phase 2 explicitly accepts the break.
Run the project's codegen task (look it up — do not guess):
buf generate # most projects
mise run gen # if a mise task exists
# or the Makefile target the repo defines
Verify the generator wrote new files. If output is empty, the plugin config is wrong — fix buf.gen.yaml, do not delete the output dir.
For each downstream Go/TS package identified in Phase 1:
Use mcp gopls go_symbol_references (Go) and ast-grep / ccc (TS, polyglot) to find call sites.
go build ./...
go test ./<affected>/...
pnpm -r build # or the project's TS build
One commit contains:
.proto changeNever split .proto from its generated artifacts across commits — intermediate states won't build.
buf (lint + breaking + generate) or project codegen task.protomcp gopls go_symbol_references for Go consumersast-grep / ccc for cross-language reference trackingbuf lint and buf breaking resultsEval checklist:
.proto and its imports before editing?buf lint (or equivalent) run and clean?buf breaking run for projects with wire-compat history?.proto?rm -rf operations performed on generated dirs?Test inputs:
repeated string tags = 4 field to Tree message"GetNode RPC to FetchNode across api.proto and TS client"legacy_id field and add id as bytes"Can change: pre-edit checklist, lint commands, consumer-discovery steps, generator invocation
Cannot change: no-rm -rf rule, same-commit rule for proto + generated, lint-before-generate order
Min sessions before eval: 5
Runs per experiment: 3
testing
Use when the user asks to create test sets, enumerate scenarios, generate edge cases, or draft a coverage matrix before implementation.
testing
Use when the user asks to review, audit, score, or validate test sets for missed cases before execution or merge.
tools
Test harness plugins in isolation using tmux panes. Runs MCP servers, unit tests, typecheck, and Claude plugin loading. Use when user says "test plugin", "check plugin", "run plugin tests", "validate plugin", or names a specific plugin to test.
development
Guide for designing integration and e2e tests using BDD (Behavior-Driven Development) methodology with Cucumber-style Given/When/Then scenarios. Use when writing or reviewing tests for any service, API, or component. Language-agnostic — covers scenario structure, step notation, assertion principles, async patterns, and common anti-patterns.