---
Fetches precise Rails API documentation for specific classes and methods from official docs. Automatically invoked when agents need method signatures, parameters, or usage examples. Supports version detection and multiple lookup tools (Context7, Ref, Tavily, WebFetch) with graceful fallbacks.
/plugin marketplace add nbarthel/claudy/plugin install rails-workflow@claudyThis skill inherits all available tools. When active, it can use any tool Claude has access to.
reference.mdFetches precise API documentation from official Rails API docs for specific classes, modules, and methods. Returns signatures, parameters, return values, and usage examples.
Replaces: mcp__rails__search_docs MCP tool (API-specific queries)
Auto-invoked when agents need API details:
Agent: "What parameters does validates :email accept?"
*invokes rails-api-lookup class="ActiveModel::Validations" method="validates"*
Manual invocation:
@rails-api-lookup class="ActiveRecord::Base" method="where"
@rails-api-lookup class="ActionController::Base"
@rails-api-lookup module="ActiveSupport::Concern"
See reference.md for complete class/module list. Common APIs:
ActiveRecord::Base - Model base classActiveRecord::Relation - Query interface (where, joins, etc.)ActiveRecord::Associations - Association methodsActiveRecord::Validations - Validation methodsActiveRecord::Callbacks - Callback methodsActionController::Base - Controller base classActionController::Metal - Minimal controllerActionController::API - API controllerActionView::Base - View renderingActionView::Helpers - View helpersActionView::Template - Template handlingActiveSupport::Concern - Module mixinsActiveSupport::Callbacks - Callback frameworkActiveSupport::TimeWithZone - Time handlingInvokes: @rails-version-detector
Result: Rails 7.1.3
Maps to: https://api.rubyonrails.org/v7.1/
Input: class="ActiveRecord::Base" method="where"
Lookup: reference.md → "ActiveRecord/QueryMethods.html#method-i-where"
URL: https://api.rubyonrails.org/v7.1/ActiveRecord/QueryMethods.html#method-i-where
Method 1: Context7 (Fastest):
Tool: context7_fetch
Query: "Rails [version] [class] [method] API"
Method 2: Ref (Token-Efficient):
Tool: ref_search_documentation
Query: "Rails [version] [class] [method] API documentation"
Then: ref_read_url
Method 3: Tavily (Search):
Tool: tavily_search
Query: "Rails [version] [class] [method] API documentation"
Method 4: WebFetch (Fallback):
Tool: WebFetch
URL: [constructed URL from reference.md]
Prompt: "Extract method signature, parameters, and examples for [method]"
## ActiveRecord::QueryMethods#where (v7.1)
**Signature**: `where(**opts)`
**Parameters**:
- `opts` (Hash) - Conditions as key-value pairs
- `opts` (String) - Raw SQL conditions
- `opts` (Array) - SQL with placeholders
**Returns**: `ActiveRecord::Relation`
**Examples**:
User.where(name: 'Alice')
User.where("age > ?", 18)
User.where(age: 18..65)
**Source**: https://api.rubyonrails.org/v7.1/ActiveRecord/QueryMethods.html#method-i-where
Class/Method → API URL mapping in reference.md:
ActiveRecord::Base:
url_path: "ActiveRecord/Base.html"
common_methods:
- save: "method-i-save"
- update: "method-i-update"
- destroy: "method-i-destroy"
ActiveRecord::QueryMethods:
url_path: "ActiveRecord/QueryMethods.html"
common_methods:
- where: "method-i-where"
- joins: "method-i-joins"
- includes: "method-i-includes"
## ActiveRecord::Base (v7.1)
Active Record base class for all models.
**Inherits from**: Object
**Includes**: ActiveModel::Validations, ActiveRecord::Persistence
**Common Methods**:
- `.create` - Creates and saves record
- `#save` - Saves record to database
- `#update` - Updates attributes and saves
- `#destroy` - Deletes record from database
**Source**: https://api.rubyonrails.org/v7.1/ActiveRecord/Base.html
## ActiveRecord::Base#save (v7.1)
**Signature**: `save(options = {})`
**Parameters**:
- `validate` (Boolean, default: true) - Run validations before saving
- `context` (Symbol) - Validation context
- `touch` (Boolean, default: true) - Update timestamps
**Returns**:
- `true` if saved successfully
- `false` if validation failed
**Raises**:
- `ActiveRecord::RecordInvalid` if `save!` and validation fails
**Examples**:
```ruby
user.save # => true/false
user.save(validate: false) # skip validations
user.save! # raises on failure
Source: [full URL]
### Not Found Response
```markdown
## Class/Method Not Found: [class]#[method]
Searched in: Rails [version] API docs
Suggestions:
- Check spelling: "ActiveRecord::Base" (not "ActiveRecords::Base")
- Try class overview: @rails-api-lookup class="ActiveRecord::Base"
- Search guides instead: @rails-docs-search topic="active_record_basics"
Common classes:
- ActiveRecord::Base
- ActionController::Base
- ActiveSupport::Concern
Tools used (in order of preference):
reference.md API mappingsOptional dependencies:
URL construction:
Base: https://api.rubyonrails.org/
Versioned: https://api.rubyonrails.org/v7.1/
Class: https://api.rubyonrails.org/v7.1/ActiveRecord/Base.html
Method: https://api.rubyonrails.org/v7.1/ActiveRecord/Base.html#method-i-save
Version handling:
/v8.0//v7.1//v7.0//v6.1/Caching strategy:
{class}:{method}:{version}Prompt Caching (Opus 4.5 Optimized):
Network failure:
⚠️ Failed to fetch API docs from api.rubyonrails.org
Fallback: Use Claude's knowledge (may be less accurate)
URL attempted: [URL]
Invalid class name:
❌ Unknown class: "[class]"
Did you mean: [closest match from reference.md]?
Tip: Use full module path (e.g., "ActiveRecord::Base", not "Base")
Method not found:
⚠️ Method "[method]" not found in [class]
Class exists, but method not documented or name incorrect.
Available methods in [class]:
- [method1]
- [method2]
[...from reference.md...]
Auto-invoked by:
Complements:
@rails-api-lookup class="ActiveRecord::Base" method="save,update,destroy"
→ Returns all three method signatures
@rails-api-lookup class="User" inherit=true
→ Shows methods from User, ApplicationRecord, ActiveRecord::Base
@rails-api-lookup class="ActiveRecord::Base" method="save" compare="7.0,7.1"
→ Shows differences between versions
Test cases:
reference.md#method-i-name (instance), #method-c-name (class)This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.