원클릭으로
inline-rbs
Write RBS type annotations directly in Ruby source files using comment syntax. Use when adding types to Ruby code with rbs-inline.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Write RBS type annotations directly in Ruby source files using comment syntax. Use when adding types to Ruby code with rbs-inline.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Comprehensive skill for the Literal Ruby gem (https://literal.fun) by Joel Drapper. Use when writing or reviewing Ruby code that uses Literal - typed properties via `prop`/`prop?`, runtime type matchers `_Array`/`_Union`/`_Map`/etc., structured objects (`Literal::Struct`, `Literal::Data`), value objects (`Literal::Value`, `Literal::Delegator`), enums (`Literal::Enum`), bitfield flags (`Literal::Flags`), generic collections (`Literal::Array(...)`, `Set`, `Hash`, `Tuple`), result monads (`Literal::Result`, `Success`, `Failure`), or JSON-style serialization. Also use when designing typed APIs in plain Ruby without external type checkers.
Comprehensive skill for Ruby RBS type signatures. Use for writing inline type annotations in Ruby files, creating standalone .rbs signature files, scaffolding types, or setting up Steep type checking. Covers both inline syntax (rbs-inline) and standalone RBS file format.
Write standalone .rbs signature files to describe Ruby code. Use when creating type definitions for gems, libraries, or existing codebases without modifying Ruby source.
| name | inline-rbs |
| description | Write RBS type annotations directly in Ruby source files using comment syntax. Use when adding types to Ruby code with rbs-inline. |
Write type signatures directly in Ruby source files using special comments. Requires the rbs-inline gem.
Every file needs the magic comment:
# rbs_inline: enabled
class Person
attr_reader :name #: String
attr_reader :age #: Integer?
#: (String, ?Integer?) -> void
def initialize(name, age = nil)
@name = name
@age = age
end
end
#: (Most Concise)# Before method
#: (String) -> Integer
def count(text)
text.length
end
# Inline return type
def name #: String
@name
end
# Multiple overloads
#: () -> String?
#: (Integer) -> Array[String]
def fetch(n = nil)
n ? @items.take(n) : @items.first
end
# @rbs (Structured)# @rbs (String, Integer) -> String
def format(text, width)
text.ljust(width)
end
# Overloading with pipe
# @rbs (String) -> Integer
# | (Integer) -> Integer
def double(value)
value * 2
end
# @rbs text: String -- Input text
# @rbs width: Integer -- Max width
# @rbs strict: bool -- Strict mode
# @rbs return: Array[String]
def wrap(text, width: 80, strict: false)
# Implementation
end
attr_reader :name #: String
attr_accessor :count #: Integer
# @rbs @items: Array[String] # Instance variable
# @rbs self.@cache: Hash[Symbol, T] # Class instance variable
VERSION = "1.0" #: String # Constant
# Required block
# @rbs () { (String) -> void } -> void
def each(&block)
@items.each(&block)
end
# Optional block (? before type)
# @rbs () { (Integer) -> void }? -> Integer?
def process(&block)
yield(42) if block
end
# Using boolish for filters
#: () { (String) -> boolish } -> Array[String]
def select(&block)
@items.select(&block)
end
# @rbs generic T
class Container
# @rbs (T) -> void
def initialize(value)
@value = value
end
#: () -> T
def get
@value
end
end
Specify type parameters for generic modules using #[Type]:
include Enumerable #[String]
include Comparable #[self]
include MyGeneric #[Integer | nil]
# @rbs!)Use for DSL-generated methods or interface declarations:
# For DSL-generated methods
# @rbs!
# attr_accessor name: String
# attr_accessor email: String?
# For interface methods (expected from mixins)
# @rbs!
# def current_user: () -> User?
# def authorized?: (Symbol) -> bool
# Skip RBS generation
# @rbs skip
def internal_method; end
# Override inherited method
# @rbs override
def process(data)
super
end
# Generate to stdout
bundle exec rbs-inline lib
# Save to sig/generated
bundle exec rbs-inline --output lib
# Watch for changes
bundle exec rbs-inline --watch lib
# rbs_inline: enabled? goes before type: { (T) -> U }?