Agent skill
Ruby Information
When you need check documentation about Ruby classes, modules, and methods use this skill to get full details. Avoid check source code or use `ruby -e` for documentation unless absolutely necessary.
Install this agent skill to your Project
npx add-skill https://github.com/elct9620/claude-ruby-plugin/tree/main/skills/ri
SKILL.md
Ruby Information
Use the ri command to access Ruby documentation which is installed locally on your system.
Instructions
Use ri [options] <whatever> to look up information about Ruby classes, modules, and methods.
- Combine with
headto fast check documentation before displaying full content. - Combine with
wcto count relevant items when searching for multiple entries. - Combine with
grepto filter results based on keywords.
Consider to add quote to queries with special characters to avoid shell interpretation issues. e.g. ri 'String#blank?'
Scenarios
Direct Lookup
Check specific Ruby classes or methods accurately.
ri Array#push
Search method
Check for methods is implemetned in a class or module and get a count of results.
ri '.find' | wc -l
Use grep to filter results.
ri '.find' | grep 'Enumerable'
Note: Use
wcandgrepto ensure the output is concise and relevant.
List Names
Get a list of all classes and modules under a specific namespace.
ri --list 'MyModule::Application'
Preview Documentation
Preview the first few lines of documentation for a method or class.
ri 'String#upcase' | head -n 10
Explore Options
Explore various options available with the ri command.
ri --help
Documentation
You can get README and other documentation if bundled with gems.
ri rspec:README.md
To list all available documentation files for a gem:
ri rspec:
Append the : after the gem name to see all documentation files associated with that gem.
Building Documentation
You can use rdoc to generate and view documentation for your own Ruby projects.
rdoc --format=ri --output=ri_doc .
View the generated documentation using ri:
ri -d ./ri_doc 'MyClass'
References
For more information, refer to the official Ruby documentation: https://ruby.github.io/rdoc/index.html
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
git-guardrails-claude-code
Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute. Use when user wants to prevent destructive git operations, add git safety hooks, or block git push/reset in Claude Code.
scaffold-exercises
Create exercise directory structures with sections, problems, solutions, and explainers that pass linting. Use when user wants to scaffold exercises, create exercise stubs, or set up a new course section.
setup-pre-commit
Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.
migrate-to-shoehorn
Migrate test files from `as` type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace `as` in tests, or needs partial test data.
edit-article
Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.
obsidian-vault
Search, create, and manage notes in the Obsidian vault with wikilinks and index notes. Use when user wants to find, create, or organize notes in Obsidian.
Didn't find tool you were looking for?