Automatically enforces Rails naming conventions, MVC separation, and RESTful patterns
Automatically enforces Rails naming conventions, MVC separation, and RESTful patterns on every file save. Triggers on .rb, routes.rb, and view file changes to validate conventions and suggest architectural improvements.
/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.
Auto-validates and enforces Rails conventions across all code changes.
Automatic Enforcement:
When It Activates:
What It Checks:
Naming Conventions
MVC Separation
RESTful Patterns
Rails Idioms
Input:
# app/models/users.rb
class Users < ApplicationRecord
end
Skill Output:
❌ Convention Violation: Model class name should be singular
Expected: User
Found: Users
Fix:
- Rename class to "User"
- Rename file to "user.rb"
Input:
# app/controllers/user.rb
class User < ApplicationController
end
Skill Output:
❌ Convention Violation: Controller class name should be plural and end with 'Controller'
Expected: UsersController
Found: User
❌ File Naming: Controller file should match class name
Expected: users_controller.rb
Found: user.rb
Input:
# app/controllers/posts_controller.rb
def index
@posts = Post.where("created_at > ?", 1.week.ago)
.joins(:author)
.order(created_at: :desc)
end
Skill Output:
⚠️ MVC Separation: Complex query logic in controller
Recommendation: Extract to model scope
Suggested refactoring:
# app/models/post.rb
scope :recent, -> { where("created_at > ?", 1.week.ago) }
scope :with_author, -> { joins(:author) }
scope :newest_first, -> { order(created_at: :desc) }
# app/controllers/posts_controller.rb
def index
@posts = Post.recent.with_author.newest_first
end
Input:
# config/routes.rb
resources :posts do
get 'activate'
get 'deactivate'
get 'toggle_status'
get 'publish'
end
Skill Output:
⚠️ RESTful Pattern: Multiple custom actions detected
Current: 4 custom actions (activate, deactivate, toggle_status, publish)
Recommendation: Consider consolidating to single update action
Suggested refactoring:
resources :posts do
patch 'status', to: 'posts#update_status'
end
# Controller:
def update_status
action = params[:action_type] # 'activate', 'deactivate', 'publish'
@post.update!(status: action)
end
Skill can be configured via .rails-conventions.yml:
# .rails-conventions.yml
naming:
enforce_singular_models: true
enforce_plural_controllers: true
mvc_separation:
max_controller_lines: 100
warn_on_complex_queries: true
restful:
max_custom_actions: 2
max_nesting_depth: 2
This skill can automatically fix simple violations:
Auto-fixable:
Manual fix required:
This skill enhances all agents:
This skill runs automatically - no invocation needed. It keeps your Rails code conventional and maintainable.
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.