Comprehensive skill for Ruby RBS type signatures. Use for writing inline type annotations in Ruby files, creating standalone .rbs signature files, scaffolding types, or setting up Steep type checking. Covers both inline syntax (rbs-inline) and standalone RBS file format.
Generates Ruby RBS type signatures for inline annotations or standalone files.
/plugin marketplace add stevegeek/claude-ruby-plugins/plugin install ruby-rbs@stevegeek-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
references/comparing-signatures.mdreferences/patterns.mdreferences/rbs-test-instrumentation.mdreferences/scaffolding.mdreferences/steep-integration.mdreferences/troubleshooting.mdreferences/type-syntax.mdreferences/type-tracer.mdreferences/validating-signatures.mdRBS is Ruby's official type signature language for describing the structure of Ruby programs - classes, modules, methods, and types. This skill covers both approaches to adding types:
# rbs_inline: enabled) - Type annotations embedded in Ruby source files as comments.rbs) - Separate signature files that describe Ruby code| Aspect | Inline RBS | Standalone .rbs Files |
|---|---|---|
| Co-location | Types live with code | Types in separate sig/ directory |
| Ruby files | Modified with comments | Unchanged |
| Tooling | Requires rbs-inline gem | Native RBS support |
| Use case | New code, gradual adoption | Libraries, gems, existing codebases |
Use inline RBS when: Starting fresh, want types near code, prefer gradual typing Use standalone .rbs when: Publishing gems, typing third-party code, complete API documentation
For detailed guidance on each approach:
subskills/inline/SKILL.md - Writing inline RBS annotations in Ruby filessubskills/rbs-files/SKILL.md - Writing standalone .rbs signature filesString # String instance
Integer # Integer instance
Float # Float instance
bool # true | false
boolish # Any truthy/falsy value (for predicates)
nil # nil value
void # Return value not used
untyped # Skip type checking (gradual typing)
top # Supertype of all types
bot # Subtype of all types (never returns)
self # Type of receiver
instance # Instance of the class
class # Singleton class
String? # Optional: String | nil
String | Integer # Union type
_Reader & _Writer # Intersection type
Array[String] # Generic class
Hash[Symbol, Integer] # Hash with typed keys/values
[String, Integer] # Tuple (fixed-size array)
{ name: String, age: Integer } # Record (typed hash)
{ name: String, age?: Integer } # Record with optional key
^(Integer) -> String # Proc/lambda type
:ready # Symbol literal
"https" # String literal
123 # Integer literal
true # Boolean literal
Steep is the primary type checker for RBS.
# Add dependencies
bundle add rbs-inline --require=false # Only for inline RBS
bundle add steep --group=development
# Initialize
bundle exec steep init
bundle exec rbs collection init
bundle exec rbs collection install
D = Steep::Diagnostic
target :app do
check "lib"
check "app"
signature "sig" # Standalone RBS files
signature "sig/generated" # Generated from inline RBS
library "pathname", "json" # Standard libraries
collection_config "rbs_collection.yaml"
configure_code_diagnostics(D::Ruby.strict)
end
# Generate RBS from inline annotations
bundle exec rbs-inline --output lib
# Type check
bundle exec steep check
# Watch mode
bundle exec steep watch
# Language server for editor integration
bundle exec steep langserver
Steep's flow analysis doesn't narrow instance variable types after nil checks. Even when you've checked if @user, Steep still considers @user potentially nil inside the block. Assign to a local variable to narrow the type:
# WRONG - @user stays User? in the if body
if @user
@user.name # ERROR: @user is still User?
end
# RIGHT - Assignment narrows the type
if user = @user
user.name # OK: user is User
end
untyped where possible - Prefer concrete types, unions, interfaces, or generics. Reserve untyped only for truly dynamic code (metaprogramming, eval, external data with unknown shape). When you must use untyped, treat it as technical debt to revisit.Verify RBS signatures are correct by writing Ruby test files that exercise the typed APIs:
my_gem/
├── sig/
│ └── my_gem.rbs # Your RBS signatures
└── test/
└── rbs/ # Type checking test directory
├── Steepfile # Points to ../../sig
└── lib/
└── usage.rb # Ruby code exercising the API
Write test files that use your gem's public API:
# test/rbs/lib/usage.rb
require "my_gem"
# Test instantiation and methods
user = MyGem::User.new("Alice", "alice@example.com")
name = user.name # Verifies return type
user.update(name: "Bob") # Verifies argument types
# Test from documentation examples
client = MyGem::Client.new(api_key: "xxx")
response = client.get("/users")
Run bundle exec steep check in the test directory. Errors reveal signature problems:
See references/validating-signatures.md for full setup and patterns.
references/type-syntax.md - Complete type syntax referencereferences/steep-integration.md - Steep setup, configuration, and commandsreferences/validating-signatures.md - Write test code to validate signatures with Steepreferences/comparing-signatures.md - Compare standalone and generated RBS filesreferences/rbs-test-instrumentation.md - Runtime type checking with rbs/testreferences/type-tracer.md - Discover types from runtime executionreferences/scaffolding.md - Generate initial RBS from existing codereferences/patterns.md - Common patterns and best practicesreferences/troubleshooting.md - Gotchas and troubleshooting guideThis skill should be used when the user asks to "create a hookify rule", "write a hook rule", "configure hookify", "add a hookify rule", or needs guidance on hookify rule syntax and patterns.
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.