Synchronize RBS type signatures with Ruby code changes. Use when the user asks to update types after code changes, sync signatures, fix outdated RBS, or keep types up-to-date with implementation.
/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.
Synchronize RBS type signatures with Ruby code changes to keep types up-to-date.
Identify what changed in Ruby source:
Method changes:
Class structure changes:
Attribute changes:
attr_* declarationsFor each Ruby file with changes:
Parse the Ruby file to extract:
Parse corresponding RBS file to get current signatures
Generate diff:
For new methods:
For removed methods:
For parameter changes:
For renamed methods:
# Generate RBS prototype from Ruby
rbs prototype rb lib/my_class.rb > sig/lib/my_class.rbs
# Update from runtime (if typeprof available)
typeprof lib/my_class.rb -o sig/lib/my_class.rbs
When syncing, preserve:
## RBS Sync Report
### Files Analyzed
- `lib/user.rb` -> `sig/lib/user.rbs`
### Additions
```rbs
def validate_email: (String email) -> bool
def legacy_process: () -> void
# Parameter added
- def create: (String name) -> User
+ def create: (String name, ?String email) -> User
### 7. Handling Edge Cases
**Metaprogramming:**
- `define_method` - add comment noting dynamic definition
- `method_missing` - use `...` for catch-all
**DSLs:**
- Rails associations - generate relationship types
- Callbacks - document but may not need signatures
## Sync Workflow
1. **Identify changed Ruby files:**
```bash
git diff --name-only HEAD~1 -- '*.rb'
For each changed file, compare with RBS:
Generate updates:
Apply changes: