$120 tested Claude codes · real before/after data · Full tier $15 one-timebuy --sheet=15 →
$Free 40-page Claude guide — setup, 120 prompt codes, MCP servers, AI agents. download --free →
clskills.sh — terminal v2.4 — 2,347 skills indexed● online
[CL]Skills_
gRPCintermediateNew

Protobuf Generator

Share

Generate code from protobuf definitions for multiple languages

Works with OpenClaude

You are a protobuf code generation expert. The user wants to generate code from .proto files for multiple target languages (Java, Python, Go, TypeScript, C++) using the protobuf compiler.

What to check first

  • Run protoc --version to verify the protocol buffer compiler is installed (minimum v3.12.0 recommended)
  • Check that your .proto files are in a known directory and use valid syntax (syntax = "proto3" or "proto2")
  • Confirm output directories exist or can be created for each language target

Steps

  1. Install protoc from https://github.com/protocolbuffers/protobuf/releases or via brew install protobuf (macOS), apt-get install protobuf-compiler (Linux), or choco install protoc (Windows)
  2. Create a .proto file with valid message and service definitions using proto3 syntax
  3. Install language-specific plugins: go install google.golang.org/protobuf/cmd/protoc-gen-go@latest for Go, pip install grpcio-tools for Python, npm install -g @grpc/grpc-tools for TypeScript
  4. Run protoc with --go_out, --python_out, --java_out, --cpp_out, or --typescript_out flags pointing to output directories
  5. For gRPC services, add --go-grpc_out, --grpc-python_out, --grpc-java_out, --grpc-cpp_out, or --grpc-typescript_out flags
  6. Use --proto_path or -I to specify directories where protoc searches for imported .proto files
  7. Verify generated files are created in output directories and check for any compiler warnings or errors
  8. Import the generated code into your project and use the generated service stubs and message classes

Code

#!/bin/bash
# Comprehensive protobuf code generator for multiple languages

PROTO_DIR="./proto"
OUT_BASE="./generated"

# Create output directories
mkdir -p "$OUT_BASE"/{go,python,java,typescript,cpp}

# Generate Go code (with gRPC support)
protoc \
  -I"$PROTO_DIR" \
  --go_out="$OUT_BASE/go" \
  --go-grpc_out="$OUT_BASE/go" \
  --go_opt=module=example.com/api \
  "$PROTO_DIR"/*.proto

# Generate Python code (with gRPC support)
python -m grpc_tools.protoc \
  -I"$PROTO_DIR" \
  --python_out="$OUT_BASE/python" \
  --grpc_python_out="$OUT_BASE/python" \
  "$PROTO_DIR"/*.proto

# Generate Java code (with gRPC support)
protoc \
  -I"$PROTO_DIR" \

Note: this example was truncated in the source. See the GitHub repo for the latest full version.

Common Pitfalls

  • Treating this skill as a one-shot solution — most workflows need iteration and verification
  • Skipping the verification steps — you don't know it worked until you measure
  • Applying this skill without understanding the underlying problem — read the related docs first

When NOT to Use This Skill

  • When a simpler manual approach would take less than 10 minutes
  • On critical production systems without testing in staging first
  • When you don't have permission or authorization to make these changes

How to Verify It Worked

  • Run the verification steps documented above
  • Compare the output against your expected baseline
  • Check logs for any warnings or errors — silent failures are the worst kind

Production Considerations

  • Test in staging before deploying to production
  • Have a rollback plan — every change should be reversible
  • Monitor the affected systems for at least 24 hours after the change

Quick Info

CategorygRPC
Difficultyintermediate
Version1.0.0
AuthorClaude Skills Hub
grpcprotobufcodegen

Install command:

curl -o ~/.claude/skills/protobuf-generator.md https://claude-skills-hub.vercel.app/skills/grpc/protobuf-generator.md

Related gRPC Skills

Other Claude Code skills in the same category — free to download.

Want a gRPC skill personalized to YOUR project?

This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.