generating-grpc-services

Generate gRPC service definitions, stubs, and implementations from Protocol Buffers. Use when creating high-performance gRPC services. Trigger with phrases like "generate gRPC service", "create gRPC API", or "build gRPC server".

1,868 stars

Best use case

generating-grpc-services is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Generate gRPC service definitions, stubs, and implementations from Protocol Buffers. Use when creating high-performance gRPC services. Trigger with phrases like "generate gRPC service", "create gRPC API", or "build gRPC server".

Teams using generating-grpc-services should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/generating-grpc-services/SKILL.md --create-dirs "https://raw.githubusercontent.com/jeremylongshore/claude-code-plugins-plus-skills/main/plugins/api-development/grpc-service-generator/skills/generating-grpc-services/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/generating-grpc-services/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How generating-grpc-services Compares

Feature / Agentgenerating-grpc-servicesStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Generate gRPC service definitions, stubs, and implementations from Protocol Buffers. Use when creating high-performance gRPC services. Trigger with phrases like "generate gRPC service", "create gRPC API", or "build gRPC server".

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Generating gRPC Services

## Overview

Generate gRPC service definitions, client/server stubs, and implementations from Protocol Buffer (protobuf) `.proto` files. Scaffold unary, server-streaming, client-streaming, and bidirectional-streaming RPC methods with proper error status codes, interceptors for auth/logging, and health check service registration.

## Prerequisites

- Protocol Buffers compiler (`protoc`) v3.21+ installed
- Language-specific gRPC plugin: `grpc_tools_node_protoc_plugin` (Node.js), `grpcio-tools` (Python), or Go gRPC plugin
- `buf` CLI for proto linting and breaking change detection (recommended)
- gRPC testing tool: `grpcurl`, `evans`, or BloomRPC
- TLS certificates for production transport security (mTLS recommended for service-to-service)

## Instructions

1. Read existing `.proto` files using Glob and Read, or design new service definitions with message types, RPC methods, and streaming patterns per service requirements.
2. Define proto3 message types with appropriate field types, using `google.protobuf.Timestamp` for dates, `google.protobuf.Struct` for dynamic fields, and `oneof` for polymorphic messages.
3. Compile `.proto` files with `protoc` to generate language-specific stubs, server interfaces, and client libraries using the appropriate gRPC plugin.
4. Implement server-side RPC handlers for each method, returning proper gRPC status codes (`OK`, `NOT_FOUND`, `INVALID_ARGUMENT`, `PERMISSION_DENIED`) instead of generic errors.
5. Add server interceptors for authentication (extracting JWT from metadata), request logging with correlation IDs, and deadline propagation across service calls.
6. Implement health check service (`grpc.health.v1.Health`) and reflection service for runtime introspection by tools like `grpcurl`.
7. Configure TLS transport security, preferring mutual TLS (mTLS) for service-to-service communication with certificate rotation support.
8. Write integration tests using an in-process test server, validating all RPC methods including streaming scenarios with multiple messages and error conditions.
9. Generate a REST-to-gRPC gateway using `grpc-gateway` annotations for HTTP/JSON clients that need to access gRPC services.

See `${CLAUDE_SKILL_DIR}/references/implementation.md` for the full implementation guide.

## Output

- `${CLAUDE_SKILL_DIR}/proto/` - Protocol Buffer service and message definitions
- `${CLAUDE_SKILL_DIR}/generated/` - Auto-generated stubs and client/server code
- `${CLAUDE_SKILL_DIR}/src/services/` - RPC method handler implementations
- `${CLAUDE_SKILL_DIR}/src/interceptors/` - Auth, logging, and metrics interceptors
- `${CLAUDE_SKILL_DIR}/src/health/` - Health check service implementation
- `${CLAUDE_SKILL_DIR}/gateway/` - REST-to-gRPC gateway configuration (optional)
- `${CLAUDE_SKILL_DIR}/tests/` - Integration tests with in-process test server

## Error Handling

| Error | Cause | Solution |
|-------|-------|----------|
| INVALID_ARGUMENT (3) | Request message fails field validation constraints | Return detailed `BadRequest` error details with field-level violation descriptions |
| NOT_FOUND (5) | Requested resource does not exist | Include resource type and ID in error message metadata for client debugging |
| PERMISSION_DENIED (7) | Caller lacks required role or scope in JWT metadata | Return required permission in error details; log denied access attempt |
| DEADLINE_EXCEEDED (4) | RPC took longer than client-specified deadline | Propagate deadlines to downstream calls; implement cascading timeout budgets |
| UNAVAILABLE (14) | Server overloaded or downstream dependency unreachable | Client should retry with exponential backoff; server should implement backpressure |

Refer to `${CLAUDE_SKILL_DIR}/references/errors.md` for comprehensive error patterns.

## Examples

**User management service**: Define `UserService` with `CreateUser`, `GetUser`, `ListUsers` (server-streaming for large result sets), and `UpdateUser` RPCs with field mask support for partial updates.

**Real-time event stream**: Bidirectional streaming RPC where clients subscribe to event topics and the server pushes filtered events, with flow control via client-side backpressure signals.

**gRPC-Web frontend**: Generate gRPC-Web compatible stubs for browser clients using Envoy proxy for HTTP/2 to gRPC translation, enabling direct proto-based communication from React/Vue applications.

See `${CLAUDE_SKILL_DIR}/references/examples.md` for additional examples.

## Resources

- gRPC documentation: https://grpc.io/docs/
- Protocol Buffers Language Guide: https://protobuf.dev/programming-guides/proto3/
- Buf CLI for proto management: https://buf.build/
- gRPC-Gateway: https://grpc-ecosystem.github.io/grpc-gateway/

Related Skills

generating-unit-tests

1868
from jeremylongshore/claude-code-plugins-plus-skills

Test automatically generate comprehensive unit tests from source code covering happy paths, edge cases, and error conditions. Use when creating test coverage for functions, classes, or modules. Trigger with phrases like "generate unit tests", "create tests for", or "add test coverage".

generating-test-reports

1868
from jeremylongshore/claude-code-plugins-plus-skills

Generate comprehensive test reports with metrics, coverage, and visualizations. Use when performing specialized testing. Trigger with phrases like "generate test report", "create test documentation", or "show test metrics".

generating-test-doubles

1868
from jeremylongshore/claude-code-plugins-plus-skills

Generate mocks, stubs, spies, and fakes for dependency isolation. Use when creating mocks, stubs, or test isolation fixtures. Trigger with phrases like "generate mocks", "create test doubles", or "setup stubs".

generating-test-data

1868
from jeremylongshore/claude-code-plugins-plus-skills

Generate realistic test data including edge cases and boundary conditions. Use when creating realistic fixtures or edge case test data. Trigger with phrases like "generate test data", "create fixtures", or "setup test database".

generating-security-audit-reports

1868
from jeremylongshore/claude-code-plugins-plus-skills

Generate comprehensive security audit reports for applications and systems. Use when you need to assess security posture, identify vulnerabilities, evaluate compliance status, or create formal security documentation. Trigger with phrases like "create security audit report", "generate security assessment", "audit security posture", or "PCI-DSS compliance report".

generating-compliance-reports

1868
from jeremylongshore/claude-code-plugins-plus-skills

Generate comprehensive compliance reports for security standards. Use when creating compliance documentation. Trigger with 'generate compliance report', 'compliance status', or 'audit compliance'.

generating-conventional-commits

1868
from jeremylongshore/claude-code-plugins-plus-skills

Execute generates conventional commit messages using AI. It analyzes code changes and suggests a commit message adhering to the conventional commits specification. Use this skill when you need help writing clear, standardized commit messages, especially a... Use when managing version control. Trigger with phrases like 'commit', 'branch', or 'git'.

generating-infrastructure-as-code

1868
from jeremylongshore/claude-code-plugins-plus-skills

Execute use when generating infrastructure as code configurations. Trigger with phrases like "create Terraform config", "generate CloudFormation template", "write Pulumi code", or "IaC for AWS/GCP/Azure". Produces production-ready code for Terraform, CloudFormation, Pulumi, ARM templates, and CDK across multiple cloud providers.

generating-helm-charts

1868
from jeremylongshore/claude-code-plugins-plus-skills

Execute use when generating Helm charts for Kubernetes applications. Trigger with phrases like "create Helm chart", "generate chart for app", "package Kubernetes deployment", or "helm template". Produces production-ready charts with Chart.yaml, values.yaml, templates, and best practices for multi-environment deployments.

generating-smart-commits

1868
from jeremylongshore/claude-code-plugins-plus-skills

Execute use when generating conventional commit messages from staged git changes. Trigger with phrases like "create commit message", "generate smart commit", "/commit-smart", or "/gc". Automatically analyzes changes to determine commit type (feat, fix, docs), identifies breaking changes, and formats according to conventional commit standards.

generating-docker-compose-files

1868
from jeremylongshore/claude-code-plugins-plus-skills

Execute use when you need to work with Docker Compose. This skill provides Docker Compose file generation with comprehensive guidance and automation. Trigger with phrases like "generate docker-compose", "create compose file", or "configure multi-container app".

generating-stored-procedures

1868
from jeremylongshore/claude-code-plugins-plus-skills

Use when you need to generate, validate, or deploy stored procedures for PostgreSQL, MySQL, or SQL Server. Creates database functions, triggers, and procedures with proper error handling and transaction management. Trigger with phrases like "generate stored procedure", "create database function", "write SQL procedure", "add trigger to table", or "create CRUD procedures".