xiaohongshu
xiaohongshu
generating-sorbet-inline
Generates or updates Sorbet inline type signatures directly in Ruby source files using sig blocks. Triggers when creating, updating, or maintaining inline type signatures for Ruby source files.
Full skill instructions
Generate or update Sorbet type signatures using sig {} blocks directly in Ruby source files. Supports both full generation from scratch and partial updates for individual changed files. Sorbet signatures are valid Ruby code that enable both static and runtime type checking.
When generating Sorbet inline signatures, always follow these steps.
Copy this checklist and track your progress:
Sorbet Inline Generation Progress:
- [ ] Step 1: Analyze the Ruby source
- [ ] Step 2: Add Sorbet signatures
- [ ] 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 files. This skill is for inline signatures only.# typed: sigil level if one exists. Do not upgrade or change strictness without explicit user consent.When processing multiple Ruby files, create a tracking file to ensure all files are covered:
Create tracking file .sorbet-inline-generation-todo.tmp:
[ ] app/models/user.rb
[ ] app/models/post.rb
[ ] app/services/auth_service.rb
Process files one by one:
[ ] entry[x]Cleanup: Remove the tracking file after all files are processed:
rm .sorbet-inline-generation-todo.tmp
If interrupted, the tracking file allows resuming from where you left off.
Always perform this step.
Read and understand the Ruby source file:
public, private, protected.# typed: sigil level at the top of the file.Always perform this step.
First, check if the file already has a # typed: sigil at the top:
# typed: true as a sensible default (allows gradual typing).Sigil levels (least to most strict): ignore < false < true < strict < strong
Add extend T::Sig to the class/module:
class MyClass
extend T::Sig
end
Then add type signatures using sig {} blocks:
Example - Before:
class User
attr_reader :name, :age
def initialize(name, age)
@name = name
@age = age
end
def greet(greeting)
"#{greeting}, #{@name}!"
end
end
Example - After:
# typed: true
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)
@name = name
@age = age
end
sig { params(greeting: String).returns(String) }
def greet(greeting)
"#{greeting}, #{@name}!"
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.
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience