|
| 1 | +# Architecture |
| 2 | + |
| 3 | +## How It Works |
| 4 | + |
| 5 | +1. **Setup Phase**: Use the universal installer to configure your project. The setup script detects your project type and configures roles. |
| 6 | +2. **Task Creation**: Create tasks via GitHub Issues with the `conductor:task` label |
| 7 | +3. **Agent Initialization**: Agents use the universal bootstrap to claim work |
| 8 | +4. **Isolated Development**: Each agent works in a git worktree to prevent conflicts |
| 9 | +5. **Automated Coordination**: GitHub Actions manage health, cleanup, and task flow |
| 10 | + |
| 11 | +## Hybrid Role Model |
| 12 | + |
| 13 | +The system uses a hybrid approach optimized for efficiency: |
| 14 | + |
| 15 | +- **Default Role**: `dev` - A generalist that can handle any task without specific requirements |
| 16 | +- **Specialized Roles**: Optional roles like `devops`, `security` for complex domains |
| 17 | + |
| 18 | +This reduces the complexity of managing many agent types while maintaining quality for specialized work. |
| 19 | + |
| 20 | +## File Structure |
| 21 | + |
| 22 | +``` |
| 23 | +.conductor/ |
| 24 | +├── config.yaml # Project configuration with auto-detected stack |
| 25 | +├── roles/ # Role definitions |
| 26 | +│ ├── dev.md # Default generalist |
| 27 | +│ ├── code-reviewer.md # AI-powered PR reviewer |
| 28 | +│ ├── frontend.md # UI/UX specialist |
| 29 | +│ ├── mobile.md # Mobile app developer |
| 30 | +│ ├── devops.md # CI/CD specialist |
| 31 | +│ ├── security.md # Security specialist |
| 32 | +│ ├── ml-engineer.md # ML/AI specialist |
| 33 | +│ └── data.md # Data engineer |
| 34 | +├── scripts/ # Automation scripts |
| 35 | +│ ├── conductor # Universal AI agent command |
| 36 | +│ ├── task-claim.py # Atomic task assignment |
| 37 | +│ ├── create-review-task.py # Creates review tasks from PRs |
| 38 | +│ └── health-check.py # System monitoring |
| 39 | +└── examples/ # Stack-specific task templates |
| 40 | + ├── nextjs-webapp/ |
| 41 | + ├── python-webapp/ |
| 42 | + ├── mobile-app/ |
| 43 | + └── ... |
| 44 | +``` |
| 45 | + |
| 46 | +## Core Components |
| 47 | + |
| 48 | +1. **Setup System** (`setup.py`) |
| 49 | + - Interactive/auto configuration wizard |
| 50 | + - Detects technology stack automatically |
| 51 | + - Configures agent roles based on project type |
| 52 | + - Creates GitHub workflows for automation |
| 53 | + |
| 54 | +2. **Task Management** (GitHub Issues) |
| 55 | + - GitHub Issues with `conductor:task` label serve as tasks |
| 56 | + - Issues have unique numbers, descriptions, success criteria |
| 57 | + - GitHub's atomic operations prevent race conditions |
| 58 | + - Native integration with GitHub Projects and Actions |
| 59 | + |
| 60 | +3. **Agent Roles** (`.conductor/roles/`) |
| 61 | + - `dev.md` - Default generalist role for most tasks |
| 62 | + - Specialized roles: `devops`, `security`, `frontend`, `mobile`, `ml-engineer`, `data` |
| 63 | + - `code-reviewer` - AI-powered PR reviews (always included) |
| 64 | + - Hybrid model: prefer `dev` role unless task requires specialization |
| 65 | + |
| 66 | +4. **Agent Coordination** (`.conductor/scripts/`) |
| 67 | + - `conductor` - Universal agent command (primary interface) |
| 68 | + - `task-claim.py` - Task assignment via GitHub Issue assignment |
| 69 | + - `health-check.py` - Monitor agent heartbeats |
| 70 | + - `cleanup-stale.py` - Remove abandoned work |
| 71 | + - Git worktrees provide isolation between agents |
| 72 | + |
| 73 | +5. **GitHub Integration** |
| 74 | + - Issues become tasks via `conductor:task` label |
| 75 | + - Actions run health checks every 15 minutes |
| 76 | + - AI code reviews on all PRs |
| 77 | + - Status dashboard via `conductor:status` issue |
| 78 | + |
| 79 | +## Key Design Patterns |
| 80 | + |
| 81 | +1. **Atomic Operations**: GitHub's issue assignment API ensures atomic task claiming |
| 82 | +2. **Worktree Isolation**: Each agent works in separate git worktree (`worktrees/agent-{role}-{task_id}`) |
| 83 | +3. **Heartbeat System**: Agents update timestamps; stale work auto-cleaned after timeout |
| 84 | +4. **File Conflict Prevention**: Worktree isolation ensures agents work on separate branches |
| 85 | +5. **Self-Healing**: GitHub Actions monitor health, clean stale work, process issues |
0 commit comments