Grape patterns for params, validators, declared(params), rescue_from and error!, versioning, mounting, and 4.x changes. Load before any edit in a Grape API, however small, and for Grape questions.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Grape Patterns?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ku5ic-grape-patterns)
---
name: grape-patterns
description: Grape patterns for params, validators, declared(params), rescue_from and error!, versioning, mounting, and 4.x changes. Load before any edit in a Grape API, however small, and for Grape questions.
---
# Grape patterns
Default assumption: Grape 4.1, on Ruby 3.3.1 or later and ActiveSupport 7.2 or later, per the Grape CHANGELOG. 4.2 is unreleased, and the master README describes its behavior, not 4.1's.
A row applies when the `grape` version in `Gemfile.lock` is at least the row's version. A Grape API mounted in Rails also follows rails-patterns.
## Reference files
Loading this skill isn't enough. Before your next edit, read the file of every row that matches it. The rules live in those files, and this one only points at them.
| Before | Read |
| ------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| Writing Grape code, or raising the Grape version | [reference/upgrades.md](reference/upgrades.md) |
| Writing, changing, or reviewing Grape code | [reference/anti-patterns.md](reference/anti-patterns.md) |
| Declaring params, a coercion, a helper, a route param, a callback or a mount, an error handler, a version, a format, a status, an entity, or auth | [reference/practices.md](reference/practices.md) |
| Configuring RuboCop or a scanner for a Grape API | [reference/tooling.md](reference/tooling.md) |