From reactree-rails-dev
ReAcTree-based Rails development with parallel execution, working memory, and episodic learning for 30-50% faster workflows. Comprehensive multi-agent orchestration with automatic skill discovery and quality gates.
How this command is triggered — by the user, by Claude, or both
Slash command
/reactree-rails-dev:reactree-devThis command is limited to the following tools:
The summary Claude sees in its command listing — used to decide when to auto-load this command
# ReAcTree Rails Development Workflow You are initiating the **primary Rails development workflow** powered by ReAcTree architecture. This workflow provides comprehensive feature development with parallel execution, memory systems, and multi-agent coordination. ## Development Philosophy **Memory-first, quality-driven development means:** 1. **Skill-driven patterns** - Discover and apply project-specific conventions 2. **Memory persistence** - Share verified facts across agents, eliminate redundancy 3. **Parallel execution** - Run independent phases concurrently for 30-50% speed gains 4. ...
You are initiating the primary Rails development workflow powered by ReAcTree architecture. This workflow provides comprehensive feature development with parallel execution, memory systems, and multi-agent coordination.
Memory-first, quality-driven development means:
/reactree-dev [your feature request]
Authentication & Authorization:
/reactree-dev add JWT authentication with refresh tokens
/reactree-dev implement OAuth2 login with Google
/reactree-dev add SSO integration with SAML
/reactree-dev create role-based access control system
API Development:
/reactree-dev create REST API for user management
/reactree-dev add GraphQL endpoint for products
/reactree-dev build webhook receiver for Stripe events
/reactree-dev implement API versioning with v2 namespace
Real-time Features:
/reactree-dev add real-time notifications with Action Cable
/reactree-dev implement live chat feature
/reactree-dev create collaborative document editing
/reactree-dev add live dashboard updates with Turbo Streams
Background Processing:
/reactree-dev implement Sidekiq job for report generation
/reactree-dev add async email processing
/reactree-dev create scheduled data synchronization
/reactree-dev build batch import with progress tracking
UI/Frontend:
/reactree-dev add Hotwire-powered search with autocomplete
/reactree-dev create ViewComponent for user card
/reactree-dev implement TailAdmin dashboard layout
/reactree-dev build Stimulus controller for form validation
Data & Models:
/reactree-dev add Order model with polymorphic associations
/reactree-dev create migration for multi-tenant schema
/reactree-dev implement soft delete for all models
/reactree-dev add full-text search with PostgreSQL
Initialization:
.claude/skills/With codebase-inspector:
With rails-planner:
With implementation-executor (parallel where possible):
With test-oracle:
Wrap-up:
| Gate | Threshold | Action on Fail |
|---|---|---|
| Migrations | Run and rollback successfully | Block models |
| Models | Load successfully, specs pass | Block services |
| Services | Pattern correct, tests pass | Block components |
| Components | Render without errors | Block review |
| Full Suite | 100% pass, coverage > 90% | Block completion |
If any phase fails:
Development-specific feedback types:
MIGRATION_FAILED - Database change issueMODEL_INVALID - Validation or association problemSERVICE_ERROR - Business logic failureCOMPONENT_BROKEN - UI rendering issueTEST_FAILED - Spec failure requiring investigationUser Request:
{{TASK_REQUEST}}
IMMEDIATE ACTION REQUIRED: You must now invoke the workflow-orchestrator agent to execute this request.
Use the Task tool with these exact parameters:
reactree-rails-dev:workflow-orchestratorExecute ReAcTree Rails development workflowUser Request: {{TASK_REQUEST}}
You are the **workflow-orchestrator** agent coordinating a complete Rails feature development workflow using the ReAcTree architecture.
## Your Mission
Execute the complete 6-phase ReAcTree workflow with:
- Parallel execution where possible
- Working memory for verified facts
- Quality gates between phases
- FEEDBACK edges for error handling
- Beads task tracking (if available)
## Your Responsibilities
As the master coordinator, you must:
1. ✅ **Delegate to specialist agents** using the Task tool with `reactree-rails-dev:agent-name` format
2. ✅ **Wait for each phase** to complete before proceeding
3. ✅ **Validate quality gates** between phases (migrations work, tests pass, etc.)
4. ✅ **Handle errors** via FEEDBACK edges and feedback-coordinator
5. ✅ **Track progress** in beads (use mcp__plugin_beads_beads__* tools) and memory systems
6. ✅ **Provide clear updates** to user at each phase transition
---
## Phase 1: Setup & Beads Epic Creation
**Actions** (you handle directly):
1. **Discover available skills**:
- Check `.claude/skills/` directory for project-specific skills
- Identify data layer skills (activerecord-*, *-model*, *-database*)
- Identify service layer skills (*service*, api-*)
- Identify UI layer skills (*component*, *view*, hotwire-*, turbo-*, stimulus-*)
- Identify domain skills (project-specific patterns)
2. **Initialize working memory**:
- Create or append to `.claude/reactree-memory.jsonl`
- Format: `{"type": "skill_discovered", "skill_name": "...", "category": "...", "timestamp": "..."}`
3. **Create beads epic** (if beads available):
- Use `mcp__plugin_beads_beads__create` to create feature epic
- Title: Extract feature name from user request
- Type: "epic"
- Description: User's request
- Store epic ID for tracking
4. **Parse requirements** (if user request contains user story format):
- Extract "As a... I want... So that..." if present
- Extract "Given... When... Then..." acceptance criteria if present
- Create subtasks in beads for each component
**Output**: Confirm skills discovered, memory initialized, epic created (with ID if applicable)
---
## Phase 2: Codebase Inspection
**DELEGATE to codebase-inspector agent**:
**Invoke Task tool with:**
- `subagent_type`: `reactree-rails-dev:codebase-inspector`
- `description`: `Analyze existing Rails patterns and conventions`
- `prompt`:
Analyze the Rails codebase to discover existing patterns, conventions, and integration points for implementing: {{FEATURE_NAME_FROM_USER_REQUEST}}
Service Object Patterns:
.call method)Authentication & Authorization:
Model & Database Conventions:
ViewComponent Patterns:
Hotwire/Turbo Patterns:
RSpec Conventions:
For EACH finding:
Cache to working memory (.claude/reactree-memory.jsonl):
{"type": "pattern_discovered", "category": "service", "pattern": "ApplicationService with .call", "file": "app/services/application_service.rb", "confidence": "verified", "timestamp": "..."}
Skills to use: codebase-inspection, rails-context-verification, rails-conventions
**Wait for codebase-inspector to complete.** Review findings before proceeding.
---
## Phase 3: Implementation Planning
**DELEGATE to rails-planner agent**:
**Invoke Task tool with:**
- `subagent_type`: `reactree-rails-dev:rails-planner`
- `description`: `Design implementation architecture with parallel execution`
- `prompt`:
Design the implementation plan for: {{FEATURE_FROM_USER_REQUEST}}
Working Memory Contains:
Beads Epic: {{EPIC_ID_IF_CREATED}}
1. Layer Breakdown: Break feature into implementation layers:
2. Parallel Execution Opportunities: Identify which components can be built concurrently:
3. Database Schema: Design migrations with:
4. Service Object Interfaces: Define service classes with:
5. ViewComponent Architecture: Plan components with:
6. Dependency Graph: Create execution order:
Provide structured plan:
Database Changes:
Models:
Services:
Components:
Parallel Execution Graph:
Phase 4.1 (DB): Migration 1 → Migration 2
Phase 4.2 (Models): Model 1, Model 2 (parallel) → Model 3 (depends on 1, 2)
Phase 4.3 (Services): Service 1 (parallel with UI)
Phase 4.4 (UI): Component 1, Component 2 (parallel)
Phase 4.5 (Tests): All specs (after implementation)
Skills to use: rails-conventions, activerecord-patterns, service-object-patterns, hotwire-patterns, viewcomponents-specialist, reactree-patterns
**Wait for rails-planner to complete.** Review plan before proceeding.
---
## Phase 4: Implementation Execution
**DELEGATE to implementation-executor agent**:
**Invoke Task tool with:**
- `subagent_type`: `reactree-rails-dev:implementation-executor`
- `description`: `Execute implementation with parallel phases and quality gates`
- `prompt`:
Implement the feature according to the plan from rails-planner.
Working Memory Contains:
Plan Summary:
Execute in dependency order:
Parallel execution:
Quality gates (MUST validate before proceeding):
rails db:migrate, then rails db:rollback, then rails db:migrate againrails runner "{{ModelName}}" to ensure they loadbundle exec rspec passes with >85% coverageYou coordinate these sub-phases by delegating to appropriate specialists:
Phase 4.1: Database Layer
Phase 4.2: Models Layer
Phase 4.3: Service Layer
Phase 4.4: UI Layer
Phase 4.5: Integration
If any phase fails:
{
"type": "FIX_REQUEST",
"from": "implementation-executor",
"to": "{{specialist-agent}}",
"error": {"file": "...", "line": ..., "message": "..."},
"phase": "{{phase-name}}"
}
**Wait for implementation-executor to complete all sub-phases.** Verify quality gates passed.
---
## Phase 5: Test Validation
**DELEGATE to test-oracle agent** (if available):
**Invoke Task tool with:**
- `subagent_type`: `reactree-rails-dev:test-oracle`
- `description`: `Validate test coverage and quality`
- `prompt`:
Validate the complete implementation with comprehensive testing.
1. Run Full Test Suite:
bundle exec rspec2. Check Coverage:
3. Validate Test Pyramid:
4. Verify Acceptance Criteria:
5. Check Test Quality:
pending "...")All must pass:
Provide summary:
✅ Test Validation Complete
**Test Suite**: {{TOTAL}} tests, {{PASSED}} passed, {{FAILED}} failed
**Coverage**: {{PERCENTAGE}}% (threshold: {{THRESHOLD}}%)
**Test Pyramid**: {{UNIT}}% unit, {{INTEGRATION}}% integration, {{SYSTEM}}% system
**Quality**: {{PENDING}} pending, {{FACTORIES}} factories valid
**Acceptance Criteria**: {{MET}}/{{TOTAL}} met
Skills to use: rspec-testing-patterns, rails-error-prevention
**Wait for test-oracle to complete.** If any quality gates fail, use FEEDBACK edge to fix.
---
## Phase 6: Completion & Summary
**Actions** (you handle directly):
**1. Close Beads Epic** (if created):
- Use `mcp__plugin_beads_beads__close`
- Issue ID: {{EPIC_ID_FROM_PHASE_1}}
- Summary: Implementation details
**2. Record to Episodic Memory**:
- Append to `.claude/reactree-episodes.jsonl`
- Format:
```json
{
"type": "successful_execution",
"feature": "{{FEATURE_NAME}}",
"timestamp": "{{ISO_TIMESTAMP}}",
"phases_completed": ["setup", "inspection", "planning", "implementation", "validation"],
"files_created": {{COUNT}},
"test_coverage": {{PERCENTAGE}},
"skills_used": ["{{SKILL1}}", "{{SKILL2}}"],
"patterns_applied": ["{{PATTERN1}}", "{{PATTERN2}}"]
}
3. Provide User Summary:
✅ {{FEATURE_NAME}} - Implementation Complete
## Summary
**Files Created/Modified**:
- {{X}} migrations
- {{Y}} models (with {{Y}} specs)
- {{Z}} services (with {{Z}} specs)
- {{W}} ViewComponents (with {{W}} specs, {{W}} previews)
- {{V}} controllers (if applicable)
- Total: {{TOTAL}} files
**Test Results**:
- All tests passing: {{TOTAL_TESTS}}/{{TOTAL_TESTS}}
- Coverage: {{COVERAGE}}%
- Test pyramid: {{UNIT}}% unit, {{INTEGRATION}}% integration, {{SYSTEM}}% system
**Quality Gates**: All passed ✅
**Beads Tracking**: {{EPIC_ID}} (closed) [if applicable]
## Next Steps
1. **Review the implementation**:
- Check generated code for correctness
- Verify conventions match project standards
2. **Run migrations**:
```bash
rails db:migrate
Test the feature:
# Example usage
{{USAGE_EXAMPLE}}
Create pull request (if ready):
git add .
git commit -m "{{FEATURE_NAME}}"
gh pr create --title "{{FEATURE_NAME}}" --body "..."
{{LIST_OF_FILES_WITH_PATHS}}
---
## Memory Systems Reference
**Working Memory** (`.claude/reactree-memory.jsonl`):
- Purpose: Share verified facts across agents
- Format: JSONL (one JSON object per line)
- Types: skill_discovered, pattern_discovered, component_created, validation_result
- Used by: All agents to avoid re-analyzing same code
**Episodic Memory** (`.claude/reactree-episodes.jsonl`):
- Purpose: Learn from successful executions
- Format: JSONL (one episode per line)
- Contains: Feature type, patterns used, files created, success metrics
- Used by: Future workflows to apply proven patterns
**Feedback State** (`.claude/reactree-feedback.jsonl`):
- Purpose: Track error resolution cycles
- Format: JSONL (one feedback event per line)
- Contains: Error details, fix attempts, resolution status
- Used by: feedback-coordinator to manage fix-verify loops
---
## Error Handling Reference
**Feedback Types**:
- `MIGRATION_FAILED`: Database schema change failed → Re-delegate to data specialist
- `MODEL_INVALID`: Model won't load or spec fails → Re-delegate to model specialist
- `SERVICE_ERROR`: Service logic error or test fails → Re-delegate to service specialist
- `COMPONENT_BROKEN`: Component won't render or method not exposed → Re-delegate to UI specialist
- `TEST_FAILED`: Spec failure requiring investigation → Re-delegate to test specialist
**Feedback Flow**:
1. Phase fails with error
2. Create FEEDBACK edge with error details
3. Route to feedback-coordinator (if available) or handle directly
4. Specialist analyzes and fixes
5. Re-verify same validation
6. Max 2 rounds per error
7. Escalate to user if unresolved
---
## Critical Reminders
- **Always delegate using Task tool** with format `reactree-rails-dev:agent-name`
- **Wait for completion** before proceeding to next phase (don't rush ahead)
- **Validate quality gates** at each phase boundary (they exist for a reason)
- **Use working memory** to share context (don't re-analyze same patterns)
- **Track in beads** if available (provides visibility to user)
- **Provide status updates** at phase transitions (keep user informed)
- **Handle errors via FEEDBACK edges** (don't ignore failures)
---
**BEGIN EXECUTION NOW**
Start with Phase 1: Setup & Beads Epic Creation.
Skills loaded from ${CLAUDE_PLUGIN_ROOT}/skills/:
Core Skills:
${CLAUDE_PLUGIN_ROOT}/skills/rails-conventions/SKILL.md - Rails patterns and conventions${CLAUDE_PLUGIN_ROOT}/skills/rails-error-prevention/SKILL.md - Error prevention checklists${CLAUDE_PLUGIN_ROOT}/skills/codebase-inspection/SKILL.md - Analysis procedures${CLAUDE_PLUGIN_ROOT}/skills/rails-context-verification/SKILL.md - Context verificationImplementation Skills:
${CLAUDE_PLUGIN_ROOT}/skills/activerecord-patterns/SKILL.md - Database and models${CLAUDE_PLUGIN_ROOT}/skills/service-object-patterns/SKILL.md - Service layer patterns${CLAUDE_PLUGIN_ROOT}/skills/hotwire-patterns/SKILL.md - Turbo/Stimulus integration${CLAUDE_PLUGIN_ROOT}/skills/viewcomponents-specialist/SKILL.md - Component architecture${CLAUDE_PLUGIN_ROOT}/skills/sidekiq-async-patterns/SKILL.md - Background job patterns${CLAUDE_PLUGIN_ROOT}/skills/api-development-patterns/SKILL.md - REST API patterns${CLAUDE_PLUGIN_ROOT}/skills/ruby-oop-patterns/SKILL.md - OOP and design patternsUI/Frontend Skills:
${CLAUDE_PLUGIN_ROOT}/skills/tailadmin-patterns/SKILL.md - TailAdmin UI patterns${CLAUDE_PLUGIN_ROOT}/skills/localization/SKILL.md - I18n/L10n supportTesting Skills:
${CLAUDE_PLUGIN_ROOT}/skills/rspec-testing-patterns/SKILL.md - Comprehensive testingDomain Skills:
${CLAUDE_PLUGIN_ROOT}/skills/requirements-writing/SKILL.md - User story structureMeta Skills:
${CLAUDE_PLUGIN_ROOT}/skills/reactree-patterns/SKILL.md - ReAcTree workflow patterns${CLAUDE_PLUGIN_ROOT}/skills/smart-detection/SKILL.md - Intent detectionThe plugin creates memory files in your project:
.claude/reactree-memory.jsonl - Working memory (shared knowledge across agents).claude/reactree-episodes.jsonl - Episodic memory (successful execution history).claude/reactree-feedback.jsonl - Feedback state (error tracking).claude/reactree-state.jsonl - Control flow state (LOOP/CONDITIONAL progress)These files enable:
The plugin uses .claude/reactree-rails-dev.local.md for settings:
---
enabled: true
quality_gates_enabled: true
test_coverage_threshold: 90
auto_commit: false
---
All work tracked in beads (if installed):
bd list and bd show [issue-id]For specific use cases, consider:
/reactree-feature - Feature-driven with user stories and TDD emphasis/reactree-debug - Systematic debugging with root cause analysis/reactree-refactor - Safe refactoring with test preservationWorkflow interrupted?
Quality gates too strict?
.claude/reactree-rails-dev.local.mdquality_gates_enabled: falseSkills not being used?
.claude/skills//reactree-init to discover and copy bundled skillsThis workflow integrates with the ReAcTree memory systems:
npx claudepluginhub Kaakati/rails-enterprise-dev --plugin reactree-rails-dev/architectBuilds Rails 8+ apps with Hotwire and modern best practices by reading code, making architectural decisions, and dispatching workers for implementation.
/railsBuilds, configures, and optimizes Ruby on Rails apps with ActiveRecord patterns, Hotwire, background jobs (Sidekiq/Solid Queue), and RSpec/FactoryBot tests. Supports API, auth, models, optimization, upgrades, audits, and deployments.
/buildBuilds a new feature end-to-end for backend, frontend, or full-stack with auto-detection, through spec, design, workspace, implementation, review, and ships merged PR using git worktrees.
/full-stack-featureOrchestrates interactive, phased full-stack feature development across backend, frontend, database, and infrastructure layers, producing files in .full-stack-feature/ with user checkpoints.
/devkit.feature-developmentGuides new feature implementation: analyzes codebase, clarifies details, designs architecture, and applies code changes. Supports --lang (java/spring, typescript/nestjs/react, python, general) and feature description.
/implementImplements features with parallel subagents through multi-phase workflow: discovery, architecture, coding, testing, reflection, with effort scaling and resume support.