skills/dmitrypogrebnoy/generating-sorbet/SKILL.md
Generates Sorbet type signatures in separate RBI files from Ruby source files. Triggers when creating type definitions, adding types to Ruby code, or generating .rbi files for classes/modules without existing Sorbet signatures.
npx skillsauth add aiskillstore/marketplace generating-sorbetInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate Sorbet type signatures in separate .rbi files. RBI files are used when you cannot or should not modify the original Ruby source - such as for gems, generated code, or legacy codebases.
When generating Sorbet RBI signatures, always follow these steps.
Copy this checklist and track your progress:
Sorbet RBI Generation Progress:
- [ ] Step 1: Analyze the Ruby source
- [ ] Step 2: Generate RBI files
- [ ] Step 3: Eliminate `T.untyped` in signatures
- [ ] Step 4: Review and refine signatures
- [ ] Step 5: Validate signatures with Sorbet
T.untyped. Infer the proper type instead.T.unsafe - it bypasses type checking entirely.T.cast - it forces types without verification.bundle exec if the project has Gemfile.sig { } block syntax for method signatures.extend T::Sig to classes/modules before using sig../rbi directory.Always perform this step.
Read and understand the Ruby source file:
public, private, protected.Always perform this step.
Determine the correct RBI directory:
Place RBI files in ./rbi directory. Sorbet reads all .rbi files from this location.
RBI files are needed to describe code Sorbet cannot understand statically:
define_method or method_missingconst_get/const_setextendCreate the RBI file with typed sigil:
# typed: strict
Add extend T::Sig to each class/module:
class MyClass
extend T::Sig
end
Add method stubs with signatures (no method bodies):
Example - Ruby Source:
class User
attr_reader :name, :age
def initialize(name, age)
@name = name
@age = age
end
def greet(greeting)
"#{greeting}, #{@name}!"
end
end
Example - RBI File (rbi/user.rbi):
# typed: strict
class User
extend T::Sig
sig { returns(String) }
attr_reader :name
sig { returns(Integer) }
attr_reader :age
sig { params(name: String, age: Integer).void }
def initialize(name, age); end
sig { params(greeting: String).returns(String) }
def greet(greeting); end
end
T.untyped in SignaturesAlways perform this step.
T.untyped with proper types.T.untyped only as a last resort when type cannot be determined.Always perform this step.
T.untyped types.Always perform this step.
Run Sorbet type checker to validate signatures:
srb tc
Or with bundle:
bundle exec srb tc
This checks:
Fix any errors reported and repeat until validation passes.
development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.