# Rails problem

> Rails problem is an open-source agent skill for developer tools. Guides a Rails API to answer errors as RFC 9457 problem details via the problem gem. 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-problem
- **Repository:** https://github.com/sorah/config
- **GitHub stars:** 31
- **License:** MIT
- **Skill name:** rails-problem
- **Collection:** https://github.com/sorah/config
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-03

## About

This skill sets out conventions for handling errors in a Rails API that responds with RFC 9457 problem documents using the problem gem. Each error is modelled as a class whose type, status and title are declared once, while only the detail and machine-readable extension members vary per occurrence. It covers where errors should be raised, how a base controller renders them with Problem::Rescuable, and how hooks handle reporting and request-derived members.

The guide also covers configuring the type prefix and an exceptions app so that routing and middleware failures produce the same response shape, plus localized titles keyed by problem type. It describes an optional path where error types come from a protobuf enum via protobufable, and points to related skills for that setup.

It expects a Ruby on Rails API and the problem gem, and gives examples for request spec assertions on status, content type and type identifiers.

## When your agent uses it

> This skill should be used when designing, writing, or reviewing error handling in a Rails API that answers RFC 9457 / RFC 7807 problem details through the `problem` gem, or when adding an error class, a `rescue_from`, an exceptions app, or an error response shape to a Rails API. Signs include `Problem::Detailable`, `Problem::Rescuable`, `Problem::I18nable`, `Problem::ExceptionsApp`, `config.problem.type_prefix`, `application/problem+json`, an `Errors::ApiError` base class, or the user mentioning "problem details", "problem+json", "error catalogue", or "error response format". Provides the error class layout, rescuing, exceptions app, i18n titles, reporting, and machine-readable detail. 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-problem)
- [License: MIT](https://github.com/sorah/config/tree/HEAD/claude/marketplace/plugins/sorah-guides/skills/rails-problem)

## Features

- **Error class layout:** Shows how to model each error as a subclass that declares its type, status and title once.
- **Controller rendering:** Explains rescuing every detailable error in a base controller and the hooks available for reporting and rendering.
- **Exceptions app setup:** Covers configuring a type prefix and an exceptions app so escaped errors also return problem documents.
- **Localized titles:** Describes keying problem titles by type in locale files and rendering them in the request locale.
- **Machine-readable extensions:** Shows adding extension members for field errors and retry hints without parsing detail text.
- **Testing guidance:** Recommends asserting status, problem content type and type identifiers in request specs.

## Good for

- Add a new domain error class for a failed order cancellation
- Set up a Rails API to return application/problem+json for all errors
- Localize problem titles for a multilingual API
- Return field-level validation errors in a problem response
- Review an API controller for error handling that bypasses the problem format

## 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-problem`:

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

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

### Codex

Copy the skill folder to `~/.agents/skills/rails-problem` 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-problem &&
cp -R "$tmp/claude/marketplace/plugins/sorah-guides/skills/rails-problem" ~/.agents/skills/rails-problem &&
rm -rf "$tmp"
```

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

### Cursor

Copy the skill folder to `~/.cursor/skills/rails-problem` 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-problem &&
cp -R "$tmp/claude/marketplace/plugins/sorah-guides/skills/rails-problem" ~/.cursor/skills/rails-problem &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/rails-problem` 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-problem
```

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

### VS Code

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

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

For one project only, put the folder in `.github/skills/rails-problem` 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-problem` into your agent's skills folder as `rails-problem`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does Rails problem need to work?

It is written for a Rails API that uses the problem gem, and it can optionally use protobufable for types taken from a protobuf enum.

### Does Rails problem change how errors are raised?

It recommends raising domain-specific problem classes directly from the code that detects a failure, rather than rescuing and re-raising generic status errors in controllers.

### Which parts of the response format does Rails problem define?

It defines the type, status, title and detail members, and extension members for machine-readable data, and it keeps type identifiers stable across environments.

### Does Rails problem cover reporting errors?

Yes, it describes hooks for deciding which problems are reportable and where reports go, with an example that sends them to Sentry.

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

Copy the skill folder from GitHub to ~/.claude/skills/rails-problem to use it in all your projects, or to .claude/skills/rails-problem 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 problem 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 problem?

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 problem?

The closest alternatives to Rails problem are Rails protobuf, API design, Rails, API design and API design.

## Where this comes from

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

## Alternatives

- [Rails protobuf](https://ai-powered.com/skills/rails-protobuf): Rails protobuf is an open-source agent skill for developer tools.
- [API design](https://ai-powered.com/skills/api-design-abdullayevtemurmalik): API design is an open-source agent skill for developer tools.
- [Rails](https://ai-powered.com/skills/rails-sorah): Rails 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.
- [API design](https://ai-powered.com/skills/api-design-nabwinsaud): API design is an open-source agent skill for developer tools.
- [API design](https://ai-powered.com/skills/api-design-fmarzochi): API design is an open-source agent skill for developer tools.
- [Error handling](https://ai-powered.com/skills/error-handling): Error handling is an open-source agent skill for developer tools.
- [Steep](https://ai-powered.com/skills/steep-sorah): Steep is an open-source agent skill for developer tools.

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