# 📁 Project Structure

*Clean, organized structure for the Mirror Magi Meta-Agent*

---

## 🏗️ Directory Layout

```
meta-agent/
├── bin/                        # Global CLI commands
│   └── cli.js                  # mirror-magi command
│
├── core/                       # Core engines
│   ├── template-engine.js      # Command generation
│   ├── task-classifier.js      # Task classification
│   └── context-builder.js      # Context management
│
├── scripts/                    # All executable scripts
│   ├── validation/             # Validation tools
│   │   └── validate-plan.js    # Plan structure validator
│   │
│   ├── planning/               # Planning tools
│   │   └── view-complete-plan.js # Complete plan viewer
│   │
│   ├── execution/              # Execution tools
│   │   └── plan-project.js     # Main execution engine
│   │
│   ├── legacy/                 # Optional/advanced tools
│   │   ├── interactive-planner.js
│   │   ├── edit-plan.js
│   │   ├── discuss-plan.js
│   │   └── convert-ai-plan.js
│   │
│   ├── setup.js                # Initial setup script
│   └── validate-config.js      # Config validator
│
├── config/                     # Configuration templates
│   ├── project-config.template.json
│   ├── agent-persona.template.md
│   └── command-templates.json
│
├── templates/                  # Command templates
│   └── [various templates]
│
├── state/                      # Runtime state (gitignored)
│   └── master-plan.json        # Current plan
│
├── docs/                       # Documentation
│   └── guides/                 # Detailed guides
│       ├── PLANNING_WORKFLOW.md
│       ├── PLAN_STRUCTURE_GUIDE.md
│       ├── AI_TO_STRUCTURED_PLAN_GUIDE.md
│       └── AI_PLAN_VALIDATION_GUIDE.md
│
├── test-agent.js               # Demo/test script
├── generate-command.js         # Single command generator
├── index.js                    # Programmatic API
├── package.json                # Package configuration
├── README.md                   # Main documentation
├── GETTING_STARTED.md          # Quick start guide
├── CORE_SCRIPTS.md             # Command reference
└── PROJECT_STRUCTURE.md        # This file
```

---

## 🎯 Key Files

### Essential Scripts
- `scripts/validation/validate-plan.js` - Validates AI plans
- `scripts/execution/plan-project.js` - Executes plans
- `scripts/planning/view-complete-plan.js` - Views plans

### Documentation
- `README.md` - System overview
- `GETTING_STARTED.md` - 5-minute setup
- `CORE_SCRIPTS.md` - All commands

### Configuration
- `config/` - Templates for setup
- `state/` - Runtime data (user-specific)

---

## 🚀 Workflow

1. **Generate** - Use AI to create plan
2. **Structure** - Format as JSON
3. **Validate** - Check with `validate-plan.js`
4. **Execute** - Run with `plan-project.js`

---

## 🧹 Clean Design

- **Organized scripts** - Grouped by purpose
- **Clear separation** - Core vs optional tools
- **User data isolated** - State folder gitignored
- **Simple workflow** - Essential tools prominent

---

*A streamlined structure for AI-powered development* 