mirror-magi-meta-agent
Version:
AI-powered development planning and execution system with Supabase integration
271 lines (216 loc) β’ 9.38 kB
Markdown
# π― Mirror Magi Meta-Agent
*AI-powered development planning and execution system for Claude Code Max*
## π The Magic Workflow
```
π€ AI ASSISTANT π YOU β
VALIDATOR π― CLAUDE CODE MAX
β β β β
βββββββββββ βββββββββββ βββββββββββ βββββββββββ
β Generateβ βStructureβ βValidate β β Execute β
β Plan β β βas JSON β β βStructureβ β βStep-by- β
β β β β β β β Step β
βββββββββββ βββββββββββ βββββββββββ βββββββββββ
β β β β
"Create a { β
PLAN IS π» Implementation
dashboard with "id": "plan_123", VALID! Commands
charts using "goal": "dashboard", β β
React & TS" "phases": [...] π Saved! π Progress
β } β β
β β β β
βββββββββββββββββββββββΌβββββββββββββββββββββββΌβββββββββββββββββββββββ
β β
π¨ CREATIVE π§ PRECISE
Human Control AI Execution
```
**The workflow is simple:**
1. π€ **Generate** - Use any AI (ChatGPT, Claude, etc.) to create comprehensive plans
2. π **Structure** - Format as JSON with exact file paths and details
3. β
**Validate** - Ensure perfect structure before execution
4. π― **Execute** - Get specific Claude Code Max commands with no placeholders
## ποΈ NEW: Supabase Integration
Mirror Magi now includes **intelligent Supabase support** with:
### Pre-flight Checks
- β
Automatic Supabase CLI detection
- β
Project connection validation
- β
Environment variable checking
- β
Migration safety verification
### Supabase Task Types
- `supabase_migration` - Database schema changes
- `supabase_function` - Edge Functions
- `supabase_rls` - Row Level Security policies
### Safety Features
- π‘οΈ Local vs remote database detection
- π Automatic rollback SQL generation
- β οΈ Uncommitted migration warnings
- π Step-by-step validation
[Learn more about Supabase integration β](./docs/guides/SUPABASE_INTEGRATION_GUIDE.md)
## π NEW: Git Integration with Claude Summaries
Mirror Magi now features **intelligent Git commit automation** that uses Claude's implementation summaries:
### Smart Commit Messages
- π€ Uses Claude's "I've successfully..." summaries
- π Conventional commit format (feat, fix, chore, etc.)
- π·οΈ Automatic task ID tracking
- π Detailed commit bodies with file changes
### Key Features
```bash
# Save Claude's response for better commits
npm run plan:save-response task_001 "Claude's implementation summary..."
# Complete task with auto-commit
npm run plan:complete task_001 --commit
# Configure preferences
npm run plan:config autoCommit true
```
### Workflow Benefits
- β¨ **Meaningful Commits** - Claude's summaries are descriptive
- β±οΈ **Time Saving** - No manual commit messages
- π **Traceability** - Task IDs link commits to plan
- π― **Consistency** - All commits follow same format
[Learn more about Git integration β](./docs/guides/CLAUDE_COMMIT_INTEGRATION.md)
## β‘ Quick Start (5 minutes)
### 1. Install & Setup
```bash
npm install -g mirror-magi
cd your-project
npm run setup
```
### 2. Generate Plan with AI π€
Use this prompt with **any AI assistant**:
```
I need a comprehensive development plan for: [YOUR PROJECT]
Include:
- Clear phases and tasks
- Exact file names and paths
- Component details and dependencies
- Validation criteria
Tech stack: [React, TypeScript, etc.]
```
### 3. Structure & Validate πβ
```json
{
"id": "plan_123",
"goal": "Your project goal",
"phases": [{
"id": "phase_1",
"name": "Setup",
"description": "Initial setup",
"tasks": [{
"id": "task_1",
"description": "Create component",
"type": "component_creation",
"dependencies": [],
"specifics": {
"componentName": "MyComponent",
"filePath": "src/components/MyComponent.tsx"
}
}]
}]
}
```
```bash
npm run plan:validate # Paste JSON, type END
```
### 4. Execute Step-by-Step π―
```bash
npm run plan:continue # Get Claude Code Max command
# β Implement with Claude
npm run plan:save-response task_1 "Claude's response" # Save for commits
npm run plan:complete task_1 --commit # Complete & commit
npm run plan:progress # Check progress
```
## π οΈ Core Commands
| Command | What It Does | When To Use |
|---------|-------------|-------------|
| `npm run plan:validate` | π Validate plan structure | After creating JSON plan |
| `npm run plan:view` | ποΈ View complete plan | Check plan details |
| `npm run plan:continue` | βΆοΈ Get next command | Ready to implement |
| `npm run plan:complete [id]` | β
Mark task complete | After implementing |
| `npm run plan:complete [id] --commit` | β
Complete & commit | With git integration |
| `npm run plan:save-response [id] "..."` | πΎ Save Claude's response | For better commits |
| `npm run plan:config [setting] [value]` | βοΈ Configure preferences | Customize workflow |
| `npm run plan:progress` | π Check progress | Track completion |
## π― Live Example
### AI Input π€
```
"Create a todo list app with add/delete functionality using React and TypeScript"
```
### Structured Plan π
```json
{
"id": "plan_todo_app",
"goal": "Create todo list app with add/delete functionality",
"phases": [{
"id": "phase_1",
"name": "Todo Component Setup",
"tasks": [{
"id": "task_1",
"description": "Create TodoList component with add/delete functionality",
"type": "component_creation",
"dependencies": [],
"specifics": {
"componentName": "TodoList",
"filePath": "src/components/TodoList.tsx",
"features": ["add items", "delete items", "mark complete"]
}
}]
}]
}
```
### Execute π―
```bash
npm run plan:validate # β
PLAN IS VALID
npm run plan:continue # Get: "Create TodoList component at src/components/TodoList.tsx with..."
# β Paste into Claude Code Max
# Claude responds: "I've successfully created the TodoList component..."
npm run plan:save-response task_1 "I've successfully created the TodoList component with add, delete, and mark complete functionality"
npm run plan:complete task_1 --commit
# β
Committed: "feat(ui): Created the TodoList component with add, delete, and mark complete functionality (task_1)"
```
## π Why Mirror Magi?
| Feature | Benefit |
|---------|---------|
| π€ **AI Integration** | Works with **any** AI assistant |
| π **No Placeholders** | Specific file names & paths |
| β
**Structure Validation** | Catches errors before execution |
| π― **Precise Commands** | Exact Claude Code Max instructions |
| π **Progress Tracking** | Always know where you are |
| ποΈ **Supabase Ready** | Intelligent database operations |
| π **Git Automation** | Claude's summaries become commits |
| π **4-Step Workflow** | Simple yet powerful |
## π Documentation
- **[Getting Started](./docs/GETTING_STARTED.md)** - Detailed setup guide
- **[Core Scripts](./docs/CORE_SCRIPTS.md)** - Complete command reference
- **[Project Structure](./docs/PROJECT_STRUCTURE.md)** - File organization
- **[Supabase Integration](./docs/guides/SUPABASE_INTEGRATION_GUIDE.md)** - Database operations
- **[Git Integration](./docs/guides/CLAUDE_COMMIT_INTEGRATION.md)** - Commit automation
- **[Planning Guides](./docs/guides/)** - In-depth documentation
## π¨ The Perfect Balance
```
π¨ HUMAN CREATIVITY π€ AI PRECISION
β β
βββββββββββ βββββββββββ
β Strategicβ βExecutionβ
βPlanning β + βDetails β
β Vision β β& Speed β
βββββββββββ βββββββββββ
β β
ββββββββββββ¬ββββββββββββββββββ
β
β¨ MIRROR MAGI β¨
Best of Both!
```
## π€ Contributing
Love the project? Contributions welcome!
## π License
MIT License - Transform your AI plans into working code!
*Where AI creativity meets structured execution* β¨