Rails-AI introduction - explains how rails-ai (Rails domain layer) integrates with superpowers (universal workflows) for Rails development
Rails-AI provides Rails-specific domain expertise for 12 key areas (models, controllers, views, testing, security, etc.). It requires Superpowers plugin for workflows and enforces TEAM_RULES.md standards. Use `/rails-ai:architect` to coordinate feature development with TDD and Rails 8+ patterns.
/plugin marketplace add zerobearing2/rails-ai/plugin install rails-ai@rails-ai-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Rails-AI requires the Superpowers plugin to function.
Before starting ANY work, verify Superpowers is installed by attempting to use a Superpowers skill. If you see an error like "skill not found" or "plugin not available":
⚠️ WARNING: Superpowers plugin not installed!
Rails-AI cannot function without Superpowers. Please install it:
/plugin marketplace add obra/superpowers
/plugin install superpowers
Then restart Claude Code.
Why this matters: Rails-AI provides WHAT to build (Rails domain knowledge). Superpowers provides HOW to build it (TDD, debugging, planning, code review). Without Superpowers, you cannot follow the mandatory workflows.
If Superpowers is installed, proceed normally.
Rails-AI builds on Superpowers. You MUST use the foundation before doing ANY work.
FIRST ACTION when starting any Rails work:
superpowers:using-superpowers skill (Skill tool)Why use superpowers:using-superpowers?
Without using superpowers:using-superpowers first:
Superpowers handles skill-usage enforcement. This table tells you WHICH Rails skills to use:
| User Request Involves | Use These Skills |
|---|---|
| Models, databases, ActiveRecord | rails-ai:models |
| Controllers, routes, REST | rails-ai:controllers |
| Views, templates, forms | rails-ai:views |
| Hotwire, Turbo, Stimulus | rails-ai:hotwire |
| CSS, Tailwind, DaisyUI | rails-ai:styling |
| Tests, TDD, Minitest | rails-ai:testing |
| Security, XSS, SQL injection | rails-ai:security |
| Background jobs, caching | rails-ai:jobs |
| Email, ActionMailer | rails-ai:mailers |
| Project setup, validation, gems | rails-ai:project-setup |
| Environment config, Docker | rails-ai:project-setup |
| Debugging Rails issues | rails-ai:debugging |
Each Rails-AI skill contains:
CRITICAL: Load domain skills BEFORE brainstorming or planning.
You can't give expert advice on Rails features if you haven't loaded the relevant domain knowledge. The brainstorming skill is process-agnostic — it doesn't know Rails patterns, TEAM_RULES, or which gems to use. You need to load that context first.
Planning workflow:
superpowers:brainstorming to refine the ideasuperpowers:writing-plans to create implementation planWhich skills to load for common features:
| Feature Type | Load These Skills |
|---|---|
| Authentication/Authorization | rails-ai:security + rails-ai:models + rails-ai:controllers |
| User-facing forms/pages | rails-ai:views + rails-ai:hotwire + rails-ai:styling |
| API endpoints | rails-ai:controllers + rails-ai:security |
| Background processing | rails-ai:jobs + rails-ai:models |
| Email features | rails-ai:mailers + rails-ai:jobs + rails-ai:views |
| Data modeling | rails-ai:models + rails-ai:testing |
| Interactive UI | rails-ai:hotwire + rails-ai:views + rails-ai:controllers |
| New project setup | rails-ai:project-setup |
Always include rails-ai:testing — TDD is non-negotiable (TEAM_RULES #4).
Why this order matters:
Superpowers provides universal workflows. Here's when to use each in Rails development:
| Skill | When to Use |
|---|---|
superpowers:brainstorming | Refining feature ideas before implementation |
superpowers:writing-plans | Creating detailed implementation plans with tasks |
superpowers:executing-plans | Running through a plan in controlled batches |
| Skill | When to Use |
|---|---|
superpowers:test-driven-development | Any feature or bugfix — write test first, watch fail, implement |
superpowers:subagent-driven-development | Executing plans with fresh workers per task |
superpowers:dispatching-parallel-agents | 3+ independent tasks that can run concurrently |
superpowers:using-git-worktrees | Isolating feature work from main workspace |
| Skill | When to Use |
|---|---|
superpowers:requesting-code-review | Before merging — dispatches code-reviewer agent |
superpowers:receiving-code-review | Processing review feedback with technical rigor |
superpowers:verification-before-completion | Before claiming work is done — run tests, confirm output |
superpowers:finishing-a-development-branch | Work complete, deciding merge/PR/cleanup |
| Skill | When to Use |
|---|---|
superpowers:systematic-debugging | Any bug or test failure — investigate before fixing |
superpowers:root-cause-tracing | Tracing errors back through call stack |
superpowers:testing-anti-patterns | Avoiding mocking mistakes, test pollution |
superpowers:condition-based-waiting | Fixing flaky tests with race conditions |
| Skill | When to Use |
|---|---|
superpowers:defense-in-depth | Validation at multiple layers to prevent bugs |
| Agent | When to Use |
|---|---|
superpowers:code-reviewer | Dispatched by requesting-code-review for PR review |
| Command | What it Does |
|---|---|
/superpowers:brainstorm | Quick access to brainstorming skill |
/superpowers:write-plan | Quick access to writing-plans skill |
/superpowers:execute-plan | Quick access to executing-plans skill |
Rails-specific usage:
rails-ai:debugging wraps superpowers:systematic-debugging with Rails contextrails-ai:testing enforces TDD via superpowers:test-driven-development
</EXTREMELY-IMPORTANT>
Rails-AI is a two-layer system built on Superpowers:
┌─────────────────────────────────────────────┐
│ LAYER 1: Superpowers (Universal Process) │
│ • brainstorming - Refine ideas │
│ • writing-plans - Create plans │
│ • test-driven-development - TDD cycle │
│ • systematic-debugging - Investigation │
│ • subagent-driven-development - Execution │
│ • dispatching-parallel-agents - Coordination│
│ • requesting-code-review - Quality gates │
│ • finishing-a-development-branch - Complete │
│ • receiving-code-review - Handle feedback │
└─────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────┐
│ LAYER 2: Rails-AI (Domain Expertise) │
│ • 12 Rails domain skills │
│ • TEAM_RULES.md enforcement │
│ • Rails 8+ patterns and conventions │
└─────────────────────────────────────────────┘
Key Principle:
Previous architecture (complex):
Current architecture (simple):
User request → /rails-ai:architect → Uses skills → Dispatches workers → Reviews
Coordinator uses superpowers:brainstorming
Coordinator uses superpowers:writing-plans
Coordinator uses superpowers:subagent-driven-development
Coordinator uses superpowers:finishing-a-development-branch
Result: Clean feature with tests, following all conventions
12 Domain-Based Skills (Consolidated):
6 Critical Rules (REJECT violations):
See rules/TEAM_RULES.md for all 20 rules.
Primary interface: /rails-ai:architect command
The simplest way to use Rails-AI is the /rails-ai:architect convenience command:
/rails-ai:architect add user authentication
/rails-ai:architect fix failing test in user_test.rb
/rails-ai:architect plan payment processing feature
/rails-ai:architect refactor UserController
This command acts as the Rails architect coordinator, which:
Example:
User: "/rails-ai:architect Add email validation to User model"
Architect (coordinator):
1. Determines this is model work requiring TDD
2. Loads superpowers:test-driven-development for process
3. Loads rails-ai:testing for Minitest patterns
4. Loads rails-ai:models for validation patterns
5. Dispatches general-purpose worker with those skills loaded
6. Worker follows TDD cycle: write test → RED → implement → GREEN → refactor
7. Reviews worker output and verifies TEAM_RULES.md compliance
Superpowers skills: Use superpowers:using-superpowers for full introduction Rails-AI rules: See rules/TEAM_RULES.md
<resources>Official Documentation:
Internal References:
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.