# Rails protobuf

> Rails protobuf is an open-source agent skill for developer tools. Guides building Rails APIs on Protocol Buffers with Connect RPC, protobufable. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/sorah/config/tree/master/claude/marketplace/plugins/sorah-guides/skills/rails-protobuf
- **Repository:** https://github.com/sorah/config
- **GitHub stars:** 31
- **License:** MIT
- **Skill name:** rails-protobuf
- **Collection:** https://github.com/sorah/config
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-03

## About

This skill gives an agent the conventions for Rails apps whose .proto files are the schema of record, with requests, responses, errors and structured database columns handled as generated protobuf messages rather than hash literals. It covers the code generation layout and regeneration workflow, Connect RPC controllers routed from service descriptors, and request validation written as buf.validate rules on the proto fields.

It also explains the error model, mapping a protobuf enum of problem types to published URIs and HTTP statuses, and how those map onto Connect error codes. Further guidance covers Input messages for create and update RPCs, Alba resources bound to messages with with_protobuf, plain JSON endpoints that decode a body message, storing messages in jsonb columns, and testing RPCs through a client-like helper with descriptor-walking invariant specs.

The examples draw on the sponsor-app project, and any project-specific conventions in its own docs take priority. The skill expects a Ruby on Rails codebase using the connect_rpc_rails and protobufable gems alongside buf tooling.

## When your agent uses it

> This skill should be used when building, extending, or reviewing a Rails app whose API schema is Protocol Buffers, served with connect_rpc_rails (Connect RPC as controller actions) and protobufable (protobuf request bodies, responses, columns, errors). Use it when adding an RPC, a `.proto` message, a `buf.validate` rule, a protobuf-bound Alba resource, a message stored in a `jsonb` column, or a problem type in a protobuf enum, even if the user only says "add an endpoint" in such an app. Signs include `ConnectRpcRails::Controller`, `connect_service`, `connect_request`, `protobuf_body`, `message`, `render proto_json:`, `with_protobuf`, `Protobufable::JsonType`, `Protobufable::Problem::Typeable`, `buf.gen.yaml`, `*_pb.rb`, or the user mentioning "Connect", "protobuf", "protovalidate", "buf". Project-specific conventions always take priority.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/sorah/config/tree/HEAD/claude/marketplace/plugins/sorah-guides/skills/rails-protobuf)
- [License: MIT](https://github.com/sorah/config/tree/HEAD/claude/marketplace/plugins/sorah-guides/skills/rails-protobuf)

## Features

- **Connect RPC controllers:** Routes each service's RPCs to thin controller actions that return generated response messages.
- **Protobuf request validation:** Places buf.validate rules on proto fields and wires them to invalid_argument responses.
- **Problem type error catalogue:** Defines RFC 9457 style errors as a protobuf enum with URIs and HTTP statuses.
- **Alba resources bound to messages:** Builds responses from Alba resources that check attributes against the message descriptor.
- **Messages stored in columns:** Keeps structured data in jsonb columns typed by protobuf messages with validation.
- **Generation and testing workflow:** Covers regenerating Ruby and TypeScript code from protos and testing RPCs with helper specs.

## Good for

- Add a new RPC endpoint to a Rails app that uses protobuf schemas
- Define validation rules for a protobuf message field
- Create a new problem type for API errors in the protobuf enum
- Expose a model through a protobuf-bound Alba resource
- Store a protobuf message in a jsonb column

## Install

### Claude Code

This skill ships in the `sorah-guides` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add sorah/config
/plugin install sorah-guides@sorah-marketplace
```

Or copy only this skill to `~/.claude/skills/rails-protobuf`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/sorah/config.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/rails-protobuf &&
cp -R "$tmp/claude/marketplace/plugins/sorah-guides/skills/rails-protobuf" ~/.claude/skills/rails-protobuf &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/rails-protobuf` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/rails-protobuf` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/sorah/config.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/rails-protobuf &&
cp -R "$tmp/claude/marketplace/plugins/sorah-guides/skills/rails-protobuf" ~/.agents/skills/rails-protobuf &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/rails-protobuf` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/rails-protobuf` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/sorah/config.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/rails-protobuf &&
cp -R "$tmp/claude/marketplace/plugins/sorah-guides/skills/rails-protobuf" ~/.cursor/skills/rails-protobuf &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/rails-protobuf` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/sorah/config.git --path claude/marketplace/plugins/sorah-guides/skills/rails-protobuf
```

Or copy the folder to `~/.gemini/skills/rails-protobuf` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/rails-protobuf`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/sorah/config.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/rails-protobuf &&
cp -R "$tmp/claude/marketplace/plugins/sorah-guides/skills/rails-protobuf" ~/.copilot/skills/rails-protobuf &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/rails-protobuf` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/sorah/config.git
```

Then copy `config/claude/marketplace/plugins/sorah-guides/skills/rails-protobuf` into your agent's skills folder as `rails-protobuf`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does Rails protobuf need to be useful?

It is written for Rails apps whose API schema is Protocol Buffers, using connect_rpc_rails and protobufable, with buf for generation.

### Does Rails protobuf change how requests are validated?

It advises writing buf.validate rules on proto fields and registering them at boot, with database-dependent checks kept as model validations.

### When does Rails protobuf apply?

It is meant for work such as adding an RPC, a .proto message, a validation rule, an Alba resource or a jsonb-stored message in such an app.

### How do I install Rails protobuf in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/rails-protobuf to use it in all your projects, or to .claude/skills/rails-protobuf in one project. Or install the sorah-guides plugin, which includes it: /plugin marketplace add sorah/config, then /plugin install sorah-guides@sorah-marketplace.

### Does Rails protobuf run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Rails protobuf?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Rails protobuf?

The closest alternatives to Rails protobuf are Protobuf GRPC API review, Go GRPC, API GraphQL GRPC, Rails problem and API design.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Protobuf GRPC API review](https://ai-powered.com/skills/protobuf-grpc-api-review): Protobuf GRPC API review is an open-source agent skill for developer tools.
- [Go GRPC](https://ai-powered.com/skills/go-grpc): Go GRPC is an open-source agent skill for developer tools.
- [API GraphQL GRPC](https://ai-powered.com/skills/api-graphql-grpc): API GraphQL GRPC is an open-source agent skill for developer tools.
- [Rails problem](https://ai-powered.com/skills/rails-problem): Rails problem is an open-source agent skill for developer tools.
- [API design](https://ai-powered.com/skills/api-design-majiayu000): API design is an open-source agent skill for developer tools.
- [Dsql on rails](https://ai-powered.com/skills/dsql-on-rails): Dsql on rails is an open-source agent skill for developer tools.
- [JSON rpc](https://ai-powered.com/skills/json-rpc): JSON rpc is an open-source agent skill for developer tools.
- [Python backend](https://ai-powered.com/skills/python-backend): Python backend is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/rails-protobuf
