Validate RBS type signatures against Ruby source code. Use when the user asks to check types, validate .rbs files, find type errors, verify type correctness, or check RBS syntax.
/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.
Validate RBS type signatures against Ruby source code for correctness and completeness.
First, validate RBS syntax using the rbs CLI:
# Validate all RBS files
rbs -I sig validate
# Parse and check specific file
rbs parse sig/lib/my_class.rbs
# Check with stdlib
rbs -I sig -r set -r json validate
Compare RBS definitions against Ruby source:
For each Ruby class/module, verify:
attr_* declarations are typedReport missing:
Check that types make sense:
Method return types:
nil when applicableParameter types:
Instance variable types:
# Missing nil handling
def find: (Integer id) -> User # Should be User?
# Wrong parameter optionality
def create: (String name, String email) # email might be optional
# Missing block signature
def each: () -> self # Missing block parameter
# Incorrect generic types
def transform: (Array items) -> Array # Should specify element types
Generate a report like:
## RBS Validation Report
### Syntax Errors
- `sig/lib/user.rbs:15`: Unexpected token 'end'
### Missing Definitions
- `lib/user.rb:User#validate` - No RBS signature found
- `lib/user.rb:User::ROLES` - Constant not typed
### Type Mismatches
- `User#find`: Returns `nil` but typed as `User`
- `User#initialize`: Parameter `age` is optional in code but required in RBS
### Warnings
- `User#process`: Consider using more specific type than `untyped`
### Summary
- Files checked: 5
- Errors: 2
- Warnings: 4
- Coverage: 85%
If steep is available, use it for deeper validation:
# Run steep check
steep check
# Generate Steepfile if missing
steep init
find sig -name "*.rbs"
rbs -I sig validate
Compare with Ruby source:
.rb fileGenerate report: