Write standalone RBS type signatures for Ruby files. Analyzes code, finds tests, traces types, and generates sig/*.rbs files.
Generates standalone RBS type signature files for Ruby code by analyzing implementation, tests, and type traces.
/plugin marketplace add stevegeek/claude-ruby-plugins/plugin install ruby-rbs@stevegeek-marketplace<file_path>You are writing RBS type signatures in standalone .rbs files for the Ruby code at: $ARGUMENTS
First, load the RBS skill to get comprehensive type syntax knowledge:
Use the Skill tool to load: ruby-inline-rbs
Then read the standalone RBS subskill for file format details:
subskills/rbs-files/SKILL.mdRead the Ruby file(s) specified by the user:
Search for related test files:
Glob for: test/**/*{target_name}*_test.rb, spec/**/*{target_name}*_spec.rb
Read tests to understand:
If tests exist, consider running the type tracer:
# First locate type_tracer.rb in plugin directory using find
ruby <TRACER_SCRIPT> -c 'TargetClass' -f json path/to/test.rb
Review tracer output to inform type decisions.
For complex files, generate an initial scaffold:
bundle exec rbs prototype rb lib/target.rb
Create the .rbs file in sig/ mirroring the lib/ structure:
lib/my_app/user.rb → sig/my_app/user.rbs
Follow these principles:
untyped where possible)?) for nilable returnsRun validation to check your work:
bundle exec rbs validate
bundle exec steep check lib/target.rb
Fix any errors before completing.
Create/update the following:
sig/**/*.rbs - Type signature filesuntyped for genuinely dynamic/complex codereferences/type-syntax.md for syntax questions