skills/ti-add-comments/SKILL.md
Add ti-doc and ti-for-llm comments to mruby code for ti type checker integration
npx skillsauth add engneer-hamachan/ruby-ti ti-add-commentsInstall 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.
You add special comments to mruby code that are consumed by the ti type checker's --llm-nav output.
The user will specify a file: ti-add-comments {file name}.rb
ti filename.rb --llm-nav - List classes and top-level methods that have callers or callees in the codeti filename.rb --llm-nav --target=Name - Display detailed signatures, callers/callees for a specific class or method in the codeIMPORTANT: Always run these commands as-is. Never pipe through head, tail, or any other truncation tool. The full output is required — partial output leads to missing call points and incomplete understanding.
There are two distinct comment types, each serving a different purpose in ti --llm-nav output:
# ti-doc: — Function documentationti --llm-nav --target=Name: [Method Signatures] section as the document: fielddef keyworddef)Example:
# ti-doc: calculate left space for line number
def calculate_line_number_space(line_number)
In ti --llm-nav --target=calculate_line_number_space output, this appears as:
## calculate_line_number_space(Union<untyped Integer>) -> Integer
- file: theme/editor_app.rb:109
- document: calculate left space for line number
- call points:
- theme/editor_app.rb:955
# ti-for-llm: — Important code explanationti --llm-nav: [Special Code Comments] section as the comment: fieldExample:
# ti-for-llm: stores the currently selected completion candidate
$completion_chars = nil
In ti --llm-nav output, this appears as:
[Special Code Comments]
## theme/editor_app.rb:90
- comment: stores the currently selected completion candidate
$completion_chars = nil
Run ti {file}.rb --llm-nav first. It lists classes and top-level methods. Identify which ones are missing document: fields or have vague ones.
For each class or method that needs comments, run:
ti {file}.rb --llm-nav --target=Name
This shows you the method signatures, existing document: fields, and call points. Use this to understand what each method does before writing its comment.
Do not fetch all details upfront — use --llm-nav to identify what needs work, then --target to drill in.
If the --target output doesn't give you enough context to write a good comment, use call points to find the exact line range and read only that range.
Rules:
# ti-doc: to every function that is missing one
def# ti-for-llm: to important non-function code such as:
Run ti {file}.rb --llm-nav and drill into updated targets with --target=Name to confirm all comments appear correctly.
# ti-doc: calculate indent decrease for tokens (just a rephrasing of the name)# ti-doc: returns indent_ct-1 if first token is 'end'/'else'/'elsif'/'when', otherwise returns indent_ct unchangedThe document: field in ti --llm-nav --target=Name output is the primary way an LLM understands your code without reading the source. Write ti-doc: comments rich enough that another LLM can make correct implementation decisions from the output alone.
ti-doc: when relevant-1 (e.g. "direction: 'left' or 'right'")Too vague (LLM still needs to read source):
# ti-doc: handle backspace
def handle_backspace(state)
Rich enough to act on:
# ti-doc: handle backspace key — deletes char at cursor position, or moves to previous line if code is empty; returns true if cursor moved to a different line
def handle_backspace(state)
Too vague:
# ti-for-llm: cursor column index
@cursor_col_index = -1
Rich enough:
# ti-for-llm: cursor column position within current code line — -1 means end of line (default), 0..n means specific position
@cursor_col_index = -1
development
Understand and work with mruby code using ti type checker
testing
Load project-specific mruby class and method signatures into context using the ti type checker
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.