@cloudkinetix/bmad-enhanced
Version:
Cloud-Kinetix enhanced fork of BMAD-METHOD - Breakthrough Method of Agile AI-driven Development with robust versioning and unified validation.
393 lines (307 loc) • 9.46 kB
Markdown
---
name: LLM-Native Execution Orchestrator
version: 1.0.0
role: Orchestrate parallel execution across LLM platforms
description: Provides platform-agnostic orchestration patterns for parallel development with intelligent coordination and dynamic adaptation
capabilities:
- Multi-platform execution patterns
- Wave management and coordination
- Dynamic plan adaptation
- Quality gate integration
- Real-time progress tracking
---
Provides platform-agnostic orchestration patterns for parallel development execution across different LLM engines. Enables intelligent coordination, progress tracking, and dynamic adaptation without relying on specific tool implementations.
- **Claude**: Concurrent Task tool deployment
- **GPT**: Parallel function calling with threads
- **Gemini**: Batch processing with correlation
- **Open Source**: Prompt-based coordination
- **Generic**: Numbered agent instructions
- **Wave Management**: Sequential wave execution
- **Progress Tracking**: Real-time status monitoring
- **Dynamic Adaptation**: Plan adjustments during execution
- **Quality Gates**: Automated validation checkpoints
- **Status Updates**: Standardized progress reporting
- **Error Handling**: Graceful failure management
- **Result Aggregation**: Unified output collection
- **Conflict Resolution**: Real-time intervention
```json
{
"orchestrationId": "sprint-2024-03-parallel",
"platform": "auto-detect|claude|gpt|gemini|generic",
"executionMode": "waves|continuous|adaptive",
"waves": [
{
"waveId": "wave-1",
"parallel": true,
"agents": [
{
"agentId": "AUTH_IMPL",
"workDescription": "Implement OAuth2 authentication",
"scope": "auth-service",
"estimatedDuration": "2h",
"dependencies": [],
"qualityGates": ["unit-tests", "security-scan"]
}
]
}
],
"coordinationRules": {
"conflictHandling": "pause-and-resolve",
"progressReporting": "every-30-min",
"failureStrategy": "continue-others"
}
}
```
```markdown
Deploy the following agents concurrently using Task tool:
**WAVE 1 - Launch Simultaneously**
Task 1: AUTH_AGENT - Implement OAuth2 in auth-service
Task 2: LOG_AGENT - Add structured logging
Task 3: CACHE_AGENT - Implement Redis caching
**Coordination Protocol**
- Each agent reports status every 30 minutes
- On completion, update status file
- On failure, alert orchestrator
```
```python
async def execute_wave_1():
threads = []
auth_thread = create_thread("AUTH: Implement OAuth2")
log_thread = create_thread("LOG: Add structured logging")
cache_thread = create_thread("CACHE: Implement Redis")
results = await asyncio.gather(
run_thread(auth_thread),
run_thread(log_thread),
run_thread(cache_thread)
)
return aggregate_results(results)
```
```markdown
You are orchestrating 3 development agents working in parallel.
**[AGENT-1: AUTHENTICATION]**
- Task: Implement OAuth2 authentication
- Working Directory: ./auth-service
- Branch: feature/oauth2
- Report Status: Every 30 minutes to orchestrator
**[AGENT-2: LOGGING]**
- Task: Add structured logging system
- Working Directory: ./logging-service
- Branch: feature/structured-logs
- Report Status: Every 30 minutes to orchestrator
**[AGENT-3: CACHING]**
- Task: Implement Redis caching layer
- Working Directory: ./cache-service
- Branch: feature/redis-cache
- Report Status: Every 30 minutes to orchestrator
1. All agents start simultaneously
2. No shared file modifications
3. Report progress using STATUS markers
4. On completion, mark as [COMPLETE]
5. On failure, mark as [FAILED] with reason
```
```javascript
class LLMOrchestrator {
async executeAdaptive(plan) {
let currentPlan = plan;
while (!this.isComplete(currentPlan)) {
// Execute current wave
const results = await this.executeWave(currentPlan.currentWave);
// Analyze results
const analysis = await this.llmAnalyzer.analyzeProgress(results);
// Adapt plan if needed
if (analysis.requiresAdaptation) {
currentPlan = await this.llmPlanner.adaptPlan(
currentPlan,
analysis.recommendations,
);
}
// Move to next wave
currentPlan.currentWave++;
}
return this.aggregateResults(currentPlan);
}
}
```
```yaml
Status Markers:
- "[STATUS: STARTED] Agent beginning work"
- "[STATUS: PROGRESS-25%] Initial implementation"
- "[STATUS: PROGRESS-50%] Core features complete"
- "[STATUS: PROGRESS-75%] Testing in progress"
- "[STATUS: COMPLETE] All tasks finished"
- "[STATUS: FAILED] Error encountered"
- "[STATUS: BLOCKED] Waiting for dependency"
Progress Report Format:
agentId: AUTH_IMPL
status: PROGRESS-50%
completedTasks:
- OAuth2 provider implementation
- JWT token generation
remainingTasks:
- Integration tests
- Documentation
blockers: none
estimatedCompletion: 1 hour
```
```json
{
"qualityGates": {
"wave1": {
"gates": ["unit-tests", "linting", "security-scan"],
"failureAction": "pause-wave",
"successAction": "proceed-to-wave2"
},
"wave2": {
"gates": ["integration-tests", "performance-tests"],
"failureAction": "rollback-and-retry",
"successAction": "proceed"
},
"final": {
"gates": ["e2e-tests", "security-audit", "documentation"],
"failureAction": "manual-review",
"successAction": "merge-all"
}
}
}
```
```markdown
Run unit tests for completed work in Wave 1:
1. Execute test suite for AUTH service
2. Execute test suite for LOG service
3. Execute test suite for CACHE service
Report results in format:
[] Service: AUTH - PASSED (45/45 tests)
[] Service: LOG - FAILED (2/30 tests failed)
If any failures, provide:
- Failed test names
- Error messages
- Suggested fixes
```
```javascript
// Collect status from all agents
function aggregateStatus(agents) {
return {
timestamp: new Date().toISOString(),
overallProgress: calculateAverage(agents.map((a) => a.progress)),
agentStatus: agents.map((a) => ({
id: a.id,
status: a.status,
progress: a.progress,
blockers: a.blockers,
})),
risks: identifyRisks(agents),
recommendations: generateRecommendations(agents),
};
}
```
```markdown
When an agent fails:
1. **Immediate Actions**
- Pause affected wave
- Notify orchestrator
- Preserve work state
2. **Analysis**
- Determine failure cause
- Assess impact on other agents
- Identify recovery options
3. **Recovery Options**
- Retry with fixes
- Skip and continue
- Rollback and replan
- Manual intervention
4. **Communication**
[]
Cause: Database connection timeout
Impact: Blocks PROFILE_IMPL in wave 2
Recommendation: Fix connection and retry
```
```yaml
Predictive Capabilities:
- Estimate completion times using historical data
- Predict bottlenecks before they occur
- Suggest optimal agent allocation
- Identify risk patterns early
```
```yaml
Resource Management:
- Dynamic agent allocation based on workload
- Automatic work rebalancing
- Idle resource detection
- Optimal wave composition
```
```yaml
Monitoring Features:
- Anomaly detection in progress patterns
- Quality trend analysis
- Performance optimization suggestions
- Automated alert generation
```
```bash
llm-orchestrate \
--plan "parallel-plan.json" \
--mode "waves" \
--platform "auto"
```
```bash
llm-orchestrate \
--plan "parallel-plan.json" \
--mode "adaptive" \
--risk-tolerance "medium" \
--quality-gates "strict"
```
```bash
llm-orchestrate \
--plan "parallel-plan.json" \
--platform "gemini" \
--batch-size 5 \
--correlation-mode "enabled"
```
1. **Platform Agnostic**: Works with any LLM engine
2. **Intelligent Coordination**: Smart wave management
3. **Dynamic Adaptation**: Responds to execution reality
4. **Quality Assured**: Integrated validation gates
5. **Observable**: Complete execution transparency
6. **Resilient**: Graceful error handling
This orchestrator enables sophisticated parallel development coordination across any LLM platform while maintaining quality and efficiency.