|
| 1 | +# RLM + Linear Task Workflow |
| 2 | + |
| 3 | +## Quick Start: Using RLM for Linear Tasks |
| 4 | + |
| 5 | +### Step 1: Sync Linear Tasks |
| 6 | +```bash |
| 7 | +# Pull latest tasks from Linear |
| 8 | +npm run linear:sync |
| 9 | + |
| 10 | +# View available tasks |
| 11 | +stackmemory tasks list --status todo --limit 10 |
| 12 | +``` |
| 13 | + |
| 14 | +### Step 2: Pick a Task and Use RLM |
| 15 | +```bash |
| 16 | +# Basic format |
| 17 | +stackmemory skills rlm "[TASK-ID] Task description from Linear" |
| 18 | + |
| 19 | +# Real example |
| 20 | +stackmemory skills rlm "[STA-102] Implement Two-Tier Storage System with Redis hot tier for recent traces and S3 cold tier for archival" |
| 21 | +``` |
| 22 | + |
| 23 | +### Step 3: RLM Will Automatically: |
| 24 | +1. **Decompose** the task into subtasks |
| 25 | +2. **Plan** the implementation approach |
| 26 | +3. **Execute** subtasks (currently mock mode) |
| 27 | +4. **Review** the implementation (3 stages) |
| 28 | +5. **Verify** quality threshold (85%+) |
| 29 | +6. **Save** context to database |
| 30 | + |
| 31 | +## Working Examples |
| 32 | + |
| 33 | +### Example 1: API Endpoint Implementation |
| 34 | +```bash |
| 35 | +stackmemory skills rlm "Create REST API endpoint for user profile management with CRUD operations, validation, and authentication" |
| 36 | +``` |
| 37 | + |
| 38 | +### Example 2: Bug Fix with Root Cause Analysis |
| 39 | +```bash |
| 40 | +stackmemory skills rlm "Debug and fix memory leak in frame manager during long sessions - investigate root cause and implement solution" |
| 41 | +``` |
| 42 | + |
| 43 | +### Example 3: Refactoring Task |
| 44 | +```bash |
| 45 | +stackmemory skills rlm "Refactor Linear sync service to use GraphQL instead of REST API while maintaining backward compatibility" |
| 46 | +``` |
| 47 | + |
| 48 | +### Example 4: Test Suite Creation |
| 49 | +```bash |
| 50 | +stackmemory skills rlm "Create comprehensive test suite for dual-stack manager including unit tests, integration tests, and performance benchmarks" |
| 51 | +``` |
| 52 | + |
| 53 | +## Current Capabilities (Mock Mode) |
| 54 | + |
| 55 | +The RLM currently operates in **mock mode** for testing, which means: |
| 56 | +- ✅ Task decomposition works |
| 57 | +- ✅ Planning phase executes |
| 58 | +- ✅ Review stages run |
| 59 | +- ✅ Quality metrics calculated |
| 60 | +- ✅ Context persisted to database |
| 61 | +- ⚠️ Actual code generation is simulated |
| 62 | +- ⚠️ Subagents return mock responses |
| 63 | + |
| 64 | +## Production Mode (Future) |
| 65 | + |
| 66 | +To enable real AI-powered execution: |
| 67 | + |
| 68 | +1. Set API credentials: |
| 69 | +```bash |
| 70 | +export ANTHROPIC_API_KEY="your-key" |
| 71 | +``` |
| 72 | + |
| 73 | +2. Disable mock mode in code: |
| 74 | +```typescript |
| 75 | +// In src/integrations/claude-code/subagent-client.ts |
| 76 | +const client = new ClaudeCodeSubagentClient(false); // false = real mode |
| 77 | +``` |
| 78 | + |
| 79 | +## Monitoring RLM Execution |
| 80 | + |
| 81 | +### Check Progress |
| 82 | +```bash |
| 83 | +# View execution status |
| 84 | +stackmemory status |
| 85 | + |
| 86 | +# List created frames |
| 87 | +stackmemory context list |
| 88 | + |
| 89 | +# View specific frame details |
| 90 | +stackmemory context get <frame-id> |
| 91 | +``` |
| 92 | + |
| 93 | +### Debug Mode |
| 94 | +```bash |
| 95 | +# Enable debug output |
| 96 | +export DEBUG_TRACE=true |
| 97 | +export STACKMEMORY_DEBUG=true |
| 98 | +stackmemory skills rlm "Your task" |
| 99 | +``` |
| 100 | + |
| 101 | +## Integration with Linear |
| 102 | + |
| 103 | +### Complete Workflow |
| 104 | +```bash |
| 105 | +# 1. Morning sync |
| 106 | +npm run linear:sync |
| 107 | + |
| 108 | +# 2. Pick highest priority task |
| 109 | +stackmemory tasks list --status todo --priority high |
| 110 | + |
| 111 | +# 3. Work on it with RLM |
| 112 | +stackmemory skills rlm "[STA-XXX] Full task description" |
| 113 | + |
| 114 | +# 4. Review results |
| 115 | +stackmemory status |
| 116 | +stackmemory context list |
| 117 | + |
| 118 | +# 5. Update Linear (when real mode enabled) |
| 119 | +# The system will automatically update Linear task status |
| 120 | +``` |
| 121 | + |
| 122 | +## Tips for Best Results |
| 123 | + |
| 124 | +1. **Include Task ID**: Always prefix with [STA-XXX] for tracking |
| 125 | +2. **Full Description**: Copy complete task description from Linear |
| 126 | +3. **Add Constraints**: Mention specific requirements or limitations |
| 127 | +4. **Specify Tech Stack**: Include libraries/frameworks to use |
| 128 | +5. **Define Success**: Clear acceptance criteria |
| 129 | + |
| 130 | +## Troubleshooting |
| 131 | + |
| 132 | +### Common Issues |
| 133 | + |
| 134 | +1. **"Cannot find module"**: Run `npm install` and `npm run build` |
| 135 | +2. **"Database error"**: Check `stackmemory status` |
| 136 | +3. **"No tasks found"**: Run `npm run linear:sync` |
| 137 | +4. **Quality threshold not met**: Task too vague, add more details |
| 138 | + |
| 139 | +### Test RLM System |
| 140 | +```bash |
| 141 | +# Run comprehensive tests |
| 142 | +./scripts/test-rlm-comprehensive.sh |
| 143 | + |
| 144 | +# Should see: ✨ All tests passed! (100% success rate) |
| 145 | +``` |
| 146 | + |
| 147 | +## Summary |
| 148 | + |
| 149 | +The RLM orchestrator transforms complex Linear tasks into manageable, quality-assured implementations through: |
| 150 | +- Intelligent task decomposition |
| 151 | +- Parallel execution where possible |
| 152 | +- Multi-stage quality reviews |
| 153 | +- Persistent context for collaboration |
| 154 | + |
| 155 | +Use it for any Linear task that would benefit from systematic breakdown and quality assurance! |
0 commit comments