
Sorbet
Guides writing and fixing Sorbet types in Ruby and Rails using inline RBS comments
Sorbet is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.
- Scripts
- None
- Platforms
- Claude Code, Codex, Cursor
- GitHub stars
- 31
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Sorbet
This skill teaches an agent how to annotate Ruby code for Sorbet using inline #: signature comments, which Ruby ignores at runtime so sorbet-runtime is never loaded. It sets the target typing level to strict, explains how to declare methods, constants and instance variables, and covers handling of nil values and unions.
The guide steers away from unsafe shortcuts. It recommends restructuring code so nil never appears before reaching for a cast, offers raising readers and a Must helper module for values the checker cannot prove present, and favors RBI shim files over per-call-site casts when a gem hides methods from tapioca. It also covers concerns, Data.define classes, Rails specifics and spec files that can leak definitions across the project.
It expects a Ruby project that already uses Sorbet, with a sorbet/config file and bundle exec srb tc available. Where the project's own docs/type-checking.md conflicts with the guide, the project's conventions win. Libraries that use Steep are referred to a separate skill.
When your agent uses it
This skill should be used when writing, reviewing, or fixing types in a Ruby or Rails project typechecked by Sorbet with inline RBS comments, or when adding a Ruby file to such a project. Signs include a `sorbet/config` file, `# typed:` sigils, `#:` signature comments, or the user mentioning "Sorbet", "srb tc", "RBS comment", "typed: strict", "tapioca", "RBI shim", "T.must", "as !nil", "Must.because", or a Sorbet error code. Provides signature syntax, nil and union handling (Must, `_maybe` readers), concern and Data.define patterns, shim-versus-cast rules, and a catalogue of Sorbet gaps with workarounds. Project-specific conventions (docs/type-checking.md) always take priority.
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
From a static check of its 2 files (23 KB) on GitHub on 4 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the sorah-guides plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add sorah/config
/plugin install sorah-guides@sorah-marketplaceOr copy only this skill to ~/.claude/skills/sorbet:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/sorah/config.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/sorbet &&
cp -R "$tmp/claude/marketplace/plugins/sorah-guides/skills/sorbet" ~/.claude/skills/sorbet &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/sorbet inside it instead.
Copy the skill folder to ~/.agents/skills/sorbet to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/sorah/config.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/sorbet &&
cp -R "$tmp/claude/marketplace/plugins/sorah-guides/skills/sorbet" ~/.agents/skills/sorbet &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/sorbet inside it instead.
Copy the skill folder to ~/.cursor/skills/sorbet to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/sorah/config.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/sorbet &&
cp -R "$tmp/claude/marketplace/plugins/sorah-guides/skills/sorbet" ~/.cursor/skills/sorbet &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/sorbet inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/sorah/config.git --path claude/marketplace/plugins/sorah-guides/skills/sorbetOr copy the folder to ~/.gemini/skills/sorbet yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/sorbet:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/sorah/config.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/sorbet &&
cp -R "$tmp/claude/marketplace/plugins/sorah-guides/skills/sorbet" ~/.copilot/skills/sorbet &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/sorbet inside it instead.
Get the folder:
git clone --depth 1 https://github.com/sorah/config.gitThen copy config/claude/marketplace/plugins/sorah-guides/skills/sorbet into your agent's skills folder as sorbet. Agents that support SKILL.md read one folder per skill.
What it does
- Inline RBS signatures
- Covers #: signature syntax for methods, constants, instance variables and attributes.
- Nil handling rules
- Ordered strategies for removing nils instead of casting them away, including raising readers.
- Must helper module
- Provides a copyable runtime-free Must module with because, expect and be_a helpers plus a spec outline.
- Union narrowing
- Explains narrowing unions with Must.be_a and exhaustive case handling with absurd checks.
- Shims over casts
- Guides writing RBI shim files for gem methods that tapioca cannot see.
- Concerns and Data.define
- Patterns for typing mixins, self casts and Data.define classes in Sorbet.
Good for
- Add Sorbet signatures to a Ruby file that is new to the project
- Fix a Sorbet error about a nilable instance variable
- Replace an unsafe nil cast with a raising reader
- Write an RBI shim for a gem method tapioca cannot generate
- Type a Rails concern that calls methods of its host class
Sorbet FAQ
When does Sorbet trigger?
When writing, reviewing or fixing types in a Ruby or Rails project typechecked by Sorbet with inline RBS comments, or when adding a Ruby file to such a project.
Does it add sorbet-runtime to my project?
No. Signatures live in #: comments that Ruby ignores, so sorbet-runtime is not loaded and the types do not run in production.
Which project file takes priority over this guide?
The project's docs/type-checking.md always takes priority over the guide.
Is Sorbet for gems or libraries?
No. Libraries and gems typecheck with Steep instead, which the guide points to a separate steep skill for.
How do I install Sorbet in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/sorbet to use it in all your projects, or to .claude/skills/sorbet 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 Sorbet 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 Sorbet?
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 Sorbet?
The closest alternatives to Sorbet are Sorbet adoption, Steep, Steep adoption, Coding guidelines and Skmtc lang ruby.
Where this comes from
- Description: from the skill's own SKILL.md.
More from sorah/config

Guides an agent through maintaining sorah's aptly-managed APT repositories and their
- Open source
- 31 GitHub stars
- Cloud and infrastructure

Runs a chief-of-staff session that watches your coding agents and keeps work on track
- Open source
- 31 GitHub stars
- Developer tools

Applies language-agnostic coding conventions to code writing and review
- Open source
- 31 GitHub stars
- Developer tools

Guides the agent to write git commit messages and PR titles in a concise house style
- Open source
- 31 GitHub stars
- Developer tools

Guides an agent through building and testing Rails apps on Aurora DSQL
- Open source
- 31 GitHub stars
- Developer tools

Writes English text in the author's terse, direct technical voice for GitHub and email
- Open source
- 31 GitHub stars
- Developer tools


