Generate and manage RBS type signatures for gems and Ruby standard library. Use when the user asks about gem types, stdlib signatures, rbs_collection setup, type collections, or third-party library types.
/plugin marketplace add DmitryPogrebnoy/ruby-agent-skills/plugin install dmitrypogrebnoy-ruby-type-signature-skills-plugins-ruby-type-signature-skills@DmitryPogrebnoy/ruby-agent-skillsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Generate and manage RBS type signatures for gems and Ruby standard library usage.
RBS uses collections to manage gem type signatures:
# rbs_collection.yaml
sources:
- type: git
name: ruby/gem_rbs_collection
remote: https://github.com/ruby/gem_rbs_collection.git
revision: main
repo_dir: gems
path: .gem_rbs_collection
gems:
- name: rails
- name: activerecord
- name: activesupport
- name: sidekiq
# Create rbs_collection.yaml
rbs collection init
# Install gem signatures
rbs collection install
# Update signatures
rbs collection update
Ruby stdlib types are included with RBS:
# List available stdlib signatures
rbs list
# Use stdlib in validation
rbs -r set -r json validate
# Check stdlib signature
rbs -r net-http methods Net::HTTP
gems:
# Core extensions
- name: set
- name: json
- name: yaml
- name: erb
# Networking
- name: net-http
- name: uri
- name: socket
# File operations
- name: fileutils
- name: pathname
- name: tempfile
# Data formats
- name: csv
- name: rexml
# Utilities
- name: logger
- name: optparse
- name: benchmark
When gem has no published types:
# Generate prototype from gem source
rbs prototype rb /path/to/gem/lib/**/*.rb > sig/gems/my_gem.rbs
# Generate from runtime
typeprof /path/to/gem/lib/my_gem.rb -o sig/gems/my_gem.rbs
# Steepfile
target :app do
signature "sig"
# Load gem signatures
library "set"
library "json"
library "pathname"
# Load from collection
collection_config "rbs_collection.yaml"
check "lib"
check "app"
end
Rails ActiveRecord:
class User < ApplicationRecord
def posts: () -> Post::ActiveRecord_Associations_CollectionProxy
def organization: () -> Organization?
end
Sidekiq Workers:
class MyWorker
include Sidekiq::Worker
def perform: (Integer user_id, String action) -> void
end
Faraday HTTP:
class ApiClient
@connection: Faraday::Connection
def get: (String path) -> Faraday::Response
end
When types aren't available:
Check gem_rbs_collection on GitHub
Create stub types:
# sig/gems/missing_gem.rbs
module MissingGem
def self.configure: () { (untyped) -> void } -> void
class Client
def initialize: (?String api_key) -> void
def request: (String endpoint) -> untyped
end
end
class MyService
@external_client: untyped # Third-party without types
def process: () -> String # Still type your code
end
# Update all collections
rbs collection update
# Reinstall after Gemfile changes
bundle install && rbs collection install
rbs collection init
rbs_collection.yaml:sources:
- type: git
name: ruby/gem_rbs_collection
remote: https://github.com/ruby/gem_rbs_collection.git
revision: main
repo_dir: gems
path: .gem_rbs_collection
gems:
- name: activesupport
version: "7.0"
rbs collection install
target :app do
signature "sig"
collection_config "rbs_collection.yaml"
check "lib", "app"
end
steep check