/ruby-rails:generating-rbs-inlinefrom ruby-rails
This skill should be used when the user asks to "add rbs-inline annotations", "annotate this file with @rbs comments", "use rbs-inline", "add inline RBS types", or "generate RBS from comments in the source". Writes RBS types as `# @rbs` comments directly inside .rb files. For standalone sig/**/*.rbs signature files instead, use generating-rbs; for Sorbet rather than RBS, use generating-sorbet or generating-sorbet-inline.
Ships in ruby-rails. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Assume mise-managed Ruby and Rails with bin/* binstubs — not rbenv, rvm, or
asdf. Read ${CLAUDE_PLUGIN_ROOT}/references/conventions.md for versions,
command forms, and type-system pairing before running project commands.
Generate or update RBS-inline type annotations as comments directly in Ruby source files. Supports both full generation from scratch and partial updates for individual changed files. Unlike pure RBS which uses separate .rbs files, rbs-inline embeds type information as structured comments within Ruby code.
When generating RBS-inline annotations, always follow these steps.
Copy this checklist and track your progress:
RBS-Inline Generation Progress:
- [ ] Step 1: Analyze the Ruby source
- [ ] Step 2: Add RBS-inline annotations
- [ ] Step 3: Eliminate `untyped` types in annotations
- [ ] Step 4: Review and refine annotations
- [ ] Step 5: Validate annotations
- [ ] Step 6: Ensure type safety (only if steep is configured)
untyped. Infer the proper type instead.mise exec -- bundle exec <command> when the project has a Gemfile (see conventions).# @rbs comment syntax for inline annotations..rbs files in the project.When processing multiple Ruby files, create a tracking file to ensure all files are covered:
.rbs-inline-generation-todo.tmp: [ ] app/models/user.rb
[ ] app/models/post.rb
[ ] app/services/auth_service.rb
Process files one by one:
[ ] entry[x]Cleanup: Remove the tracking file after all files are processed:
rm .rbs-inline-generation-todo.tmp
If interrupted, the tracking file allows resuming from where you left off.
Always perform this step.
Read and understand the Ruby source file:
public, private, protected.Always perform this step.
First, add the magic comment at the top of the Ruby file to enable rbs-inline processing:
# rbs_inline: enabled
Then add type annotations as comments directly in the Ruby source file using rbs-inline syntax:
Example - Before:
class User
attr_reader :name, :age
def initialize(name, age)
@name = name
@age = age
end
def greet(greeting)
"#{greeting}, #{@name}!"
end
end
Example - After:
# rbs_inline: enabled
class User
attr_reader :name #: String
attr_reader :age #: Integer
# @rbs name: String
# @rbs age: Integer
# @rbs return: void
def initialize(name, age)
@name = name
@age = age
end
#: (String) -> String
def greet(greeting)
"#{greeting}, #{@name}!"
end
end
Data and Struct types
untyped Types in AnnotationsAlways perform this step.
untyped with proper types.untyped only as a last resort when type cannot be determined.Always perform this step.
untyped types.Always perform this step.
rbs-inline is a transpiler - it generates RBS files from inline annotations. Validation happens on the generated RBS output.
Generate RBS files from annotations:
mise exec -- bundle exec rbs-inline --output lib
This generates .rbs files in sig/generated/ directory.
Validate the generated RBS files:
mise exec -- bundle exec rbs validate
This checks syntax, name resolution, inheritance, and type applications.
Fix any errors in your inline annotations and repeat until validation passes.
Perform this step ONLY if the project Gemfile includes steep gem AND the project has Steepfile.
Steep works on RBS files, not directly on inline annotations. The RBS files must be generated first (step 5).
Ensure RBS files are generated from annotations:
mise exec -- bundle exec rbs-inline --output lib
Run Steep type checker:
mise exec -- bundle exec steep check
Fix any errors reported by steep check.
sig/**/*.rbs filessig { } blocks instead of RBS commentsrbs-inline/steep and running them on the project Rubyreferences/data-struct-support.md (opens in a new tab)references/rbs_inline_examples/STRUCTURE.md (opens in a new tab)references/rbs_inline_examples/zeitwerk/MIT-LICENSE (opens in a new tab)references/rbs_inline_examples/zeitwerk/zeitwerk.rb (opens in a new tab)references/rbs_inline_examples/zeitwerk/zeitwerk/core_ext/kernel.rb (opens in a new tab)references/rbs_inline_examples/zeitwerk/zeitwerk/core_ext/module.rb (opens in a new tab)references/rbs_inline_examples/zeitwerk/zeitwerk/cref.rb (opens in a new tab)references/rbs_inline_examples/zeitwerk/zeitwerk/cref/map.rb (opens in a new tab)references/rbs_inline_examples/zeitwerk/zeitwerk/error.rb (opens in a new tab)references/rbs_inline_examples/zeitwerk/zeitwerk/gem_inflector.rb (opens in a new tab)references/rbs_inline_examples/zeitwerk/zeitwerk/gem_loader.rb (opens in a new tab)references/rbs_inline_examples/zeitwerk/zeitwerk/inflector.rb (opens in a new tab)references/rbs_inline_examples/zeitwerk/zeitwerk/internal.rb (opens in a new tab)references/rbs_inline_examples/zeitwerk/zeitwerk/loader.rb (opens in a new tab)references/rbs_inline_examples/zeitwerk/zeitwerk/loader/callbacks.rb (opens in a new tab)references/rbs_inline_examples/zeitwerk/zeitwerk/loader/config.rb (opens in a new tab)references/rbs_inline_examples/zeitwerk/zeitwerk/loader/eager_load.rb (opens in a new tab)references/rbs_inline_examples/zeitwerk/zeitwerk/loader/helpers.rb (opens in a new tab)references/rbs_inline_examples/zeitwerk/zeitwerk/null_inflector.rb (opens in a new tab)references/rbs_inline_examples/zeitwerk/zeitwerk/real_mod_name.rb (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub meaganewaller/marketplace --plugin ruby-rails28 skills in this plugin
/generating-rbsThis skill should be used when the user asks to "add RBS signatures", "generate RBS for this file", "write .rbs files", "set up Steep", "type-check this Ruby with RBS", or "update sig/ after these changes". Writes standalone RBS signatures under sig/**/*.rbs and never edits the Ruby source. For RBS written as inline `# @rbs` comments in the source instead, use generating-rbs-inline; for Sorbet rather than RBS, use generating-sorbet or generating-sorbet-inline./generating-sorbetThis skill should be used when the user asks to "generate RBI files", "add Sorbet types without touching the source", "write .rbi shims", "type a gem for Sorbet", or "add signatures for generated code". Writes standalone .rbi files and never edits the Ruby source — the right choice for gems, generated code, and legacy files. In a Rails app it sends ActiveRecord and other DSL methods to `tapioca dsl` and writes only the remaining shims, under sorbet/rbi/shims/. For `sig { }` blocks written in the source itself, use generating-sorbet-inline; for RBS rather than Sorbet, use generating-rbs or generating-rbs-inline./generating-sorbet-inlineThis skill should be used when the user asks to "add sig blocks", "add Sorbet signatures to this class", "make this file typed: strict", "add T.let annotations", or "type this Ruby with Sorbet inline". Writes `sig { }` blocks and `# typed:` sigils directly into .rb source. For standalone .rbi shim files that leave the source untouched, use generating-sorbet; for RBS rather than Sorbet, use generating-rbs or generating-rbs-inline./rails-action-cableThis skill should be used when the user asks to "add real-time updates", "set up Action Cable", "create a channel", "broadcast changes to the browser", "push updates without polling", or mentions WebSockets, Solid Cable, or broadcasting from a model. Covers channels, subscriptions, connection authentication, and Turbo Stream broadcasts./rails-activerecordThis skill should be used when the user asks to "add an association", "add a validation", "write a scope", "set up has_many :through", "add a counter cache", or "use an enum", or is working with models, callbacks, or query chains. For schema changes and migration files, use rails-database-migrations; for diagnosing slow or N+1 queries, use rails-performance./rails-active-storageThis skill should be used when the user asks to "add file uploads", "attach an image to a model", "set up direct uploads to S3", "generate image thumbnails", "add a rich text editor", or mentions Active Storage, Action Text, Action Mailbox, variants, vips, or mini_magick.Other plugins' skills for the same job