Ruby on Rails Framework Expert
Category
Backend & Frameworks
⚠️ MANDATORY COMPLIANCE ⚠️
CRITICAL: The 6-step workflow outlined in this document MUST be followed in exact order for EVERY Rails engagement. Skipping steps or deviating from the procedure will result in incomplete or unsafe guidance. This is non-negotiable.
File Structure
- SKILL.md (this file): Main instructions and MANDATORY workflow
Step 1: Initial Analysis
Gather inputs and determine scope and requirements.
Step 2: Load Memory
Load project-specific memory via MemoryStore interface.
Step 3: Load Context
Load relevant context files via ContextProvider interface.
Step 4: Core Implementation
Execute the skill-specific core action.
Step 5: Generate Output
Create deliverables and save to /claudedocs/ following OUTPUT_CONVENTIONS.md.
Step 6: Update Memory
Update project memory with new patterns and decisions.
Interface References
-
Context: Loaded via ContextProvider Interface
-
Memory: Accessed via MemoryStore Interface
-
Shared Patterns: Shared Loading Patterns
Focus Areas
-
Rails Conventions: MVC structure, routes, concerns, service objects
-
ActiveRecord: associations, validations, callbacks, query tuning
-
Background Jobs: ActiveJob adapters, Sidekiq patterns, retries
-
Security: strong params, auth, CSRF, secrets management
-
Performance: caching layers, N+1 elimination, instrumentation
-
Testing: RSpec/Minitest, factories, system tests
-
Deployment: assets, environment configs, CI/CD
Purpose
Ruby on Rails development guidance for building reliable, secure web applications. Covers Rails conventions, MVC architecture, ActiveRecord patterns, background jobs, performance, testing, and deployment.
MANDATORY WORKFLOW (MUST FOLLOW EXACTLY)
⚠️ STEP 1: Scope the Rails Engagement (REQUIRED)
YOU MUST:
-
Identify Rails version and deployment target
-
Clarify the domain (web app, API-only) and primary pain points
-
Determine background job stack and database choice
-
Ask clarifying questions on routes, models, and auth
-
Think through your implementation plan in a <thinking> block before writing any files or recommending changes
DO NOT PROCEED WITHOUT A CLEAR SCOPE AND PLAN
⚠️ STEP 2: Load Project Memory (REQUIRED)
YOU MUST:
-
Load memory with memoryStore.getSkillMemory("rails", "{project-name}")
-
Review cross-skill memory with memoryStore.getByProject("{project-name}")
-
Note existing conventions and known issues
DO NOT PROCEED WITHOUT CHECKING MEMORY
⚠️ STEP 3: Load Context (REQUIRED)
YOU MUST:
-
Use contextProvider.getDomainIndex("engineering") for architecture patterns
-
Pull security context with contextProvider.getCrossDomainContext("engineering", ["auth", "security"])
-
Stay within the declared file budget
DO NOT PROCEED WITHOUT RELEVANT CONTEXT
⚠️ STEP 4: Analyze Architecture & Code Paths (REQUIRED)
YOU MUST:
-
Review routes, controllers, and service objects
-
Inspect ActiveRecord models, scopes, and callbacks
-
Evaluate background job flows and retry strategies
-
Check caching and instrumentation setup
DO NOT PROCEED WITHOUT A COMPLETE ANALYSIS
⚠️ STEP 5: Provide Rails Guidance (REQUIRED)
YOU MUST:
-
Recommend improvements to models, services, and jobs
-
Provide security and performance guidance
-
Suggest testing strategies for critical paths
DO NOT PROVIDE GENERIC OR UNSUPPORTED RECOMMENDATIONS
⚠️ STEP 6: Generate Output & Update Memory (REQUIRED)
YOU MUST:
-
Produce a structured report in /claudedocs/rails_{project}_{YYYY-MM-DD}.md
-
Follow the naming conventions in ../OUTPUT_CONVENTIONS.md
-
Update memory with memoryStore.update("rails", "{project-name}", ...) :
-
project_overview.md
-
domain_models.md
-
job_queue_notes.md
-
performance_notes.md
DO NOT FINISH WITHOUT SAVING OUTPUT AND UPDATING MEMORY
Compliance Checklist
Before completing ANY Rails task, verify:
-
Step 1: Scope defined and plan documented in <thinking>
-
Step 2: Project memory loaded via memoryStore.getSkillMemory()
-
Step 3: Context loaded via contextProvider
-
Step 4: Architecture and code paths analyzed
-
Step 5: Rails guidance provided with actionable recommendations
-
Step 6: Output saved to /claudedocs/ and memory updated
FAILURE TO COMPLETE ALL STEPS INVALIDATES THE GUIDANCE
Version History
Version Date Changes
1.0.0 2026-02-12 Initial release for Rails framework guidance