Task orchestrator that breaks work into parallel tasks, executes each in clean subagents, and uses memory for coordination
Orchestrates software development by breaking work into parallel tasks executed in clean subagents with memory coordination.
/plugin marketplace add usmanali4073/stylemate-plugins/plugin install stylemate-architecture@stylemate-pluginsOrchestrate software development by breaking work into small tasks and executing each in a CLEAN SUBAGENT with minimal context.
// Analyze user request
const userRequest = "Add inventory management feature"
// Think about requirements
// - What's needed? (CRUD for inventory)
// - Backend work? (Yes - API)
// - Frontend work? (Yes - UI)
// - Planning needed? (Yes)
// - Dependencies? (Planning → Dev → QA → Verify)
// Create task plan with dependencies
const tasks = [
{
id: 'task_001',
name: 'Plan inventory feature structure',
agent: 'work-planner-agent',
dependencies: [], // No deps, runs first
status: 'pending',
context_needed: {
feature: 'inventory_management',
requirements: 'CRUD for products with SKU tracking',
load_from_memory: ['existing_services', 'architectural_decisions']
}
},
{
id: 'task_002',
name: 'Implement inventory backend API',
agent: 'dotnet-engineer-agent',
dependencies: ['task_001'], // Needs planning complete
status: 'pending',
context_needed: {
service: 'inventory',
load_from_memory: ['feature_plan', 'similar_services', 'database_schemas']
}
},
{
id: 'task_003',
name: 'Implement inventory frontend UI',
agent: 'ui-engineer-agent',
dependencies: ['task_001'], // Needs planning, NOT backend (parallel!)
status: 'pending',
context_needed: {
service: 'inventory',
load_from_memory: ['feature_plan', 'component_patterns', 'docker_ips']
}
},
{
id: 'task_004',
name: 'QA inventory backend',
agent: 'qa-backend-engineer',
dependencies: ['task_002'], // Needs backend complete
status: 'pending',
context_needed: {
service: 'inventory',
load_from_memory: ['service_api_info', 'previous_qa_results']
}
},
{
id: 'task_005',
name: 'QA inventory frontend',
agent: 'qa-frontend-engineer',
dependencies: ['task_003'], // Needs frontend complete
status: 'pending',
context_needed: {
service: 'inventory',
load_from_memory: ['service_ui_info', 'docker_ips', 'previous_qa_results']
}
},
{
id: 'task_006',
name: 'Verify inventory feature complete',
agent: 'verification-agent',
dependencies: ['task_004', 'task_005'], // Needs both QA complete
status: 'pending',
context_needed: {
feature: 'inventory_management',
load_from_memory: ['qa_results_backend', 'qa_results_frontend']
}
}
]
// Save task list to memory
memory_save_task_list({
feature: 'inventory_management',
tasks: tasks,
created: new Date().toISOString(),
status: 'in_progress',
current_phase: 'planning'
})
console.log('Task plan created with 6 tasks')
console.log('Wave 1: Planning (1 task)')
console.log('Wave 2: Development (2 parallel tasks)')
console.log('Wave 3: QA (2 parallel tasks)')
console.log('Wave 4: Verification (1 task)')
// Get ready tasks (no dependencies)
const readyTasks = tasks.filter(t =>
t.status === 'pending' &&
t.dependencies.length === 0
)
console.log(`Wave 1: Launching ${readyTasks.length} task - Planning`)
// Mark as running
memory_update_task('task_001', { status: 'running', started: new Date().toISOString() })
// Launch via Task tool
Use Task tool:
Use the work-planner-agent to plan the inventory management feature.
Instructions for the agent:
1. Load from memory:
- Existing services: memory_get_services()
- Architectural decisions: memory_get_decisions()
- Previous features: memory_get_features()
2. Plan the inventory feature:
- Define entities and relationships
- Define API endpoints needed
- Define UI components needed
- Define security requirements
3. Save to memory:
- Feature plan: memory_save_feature({...})
- Any new decisions: memory_save_decision({...})
4. Mark task complete:
- memory_update_task('task_001', { status: 'completed', completed: new Date().toISOString() })
Context to work with:
- Feature: inventory_management
- Requirements: CRUD for products with SKU tracking
- Load ONLY from memory, keep context small
Subagent returns: "✅ Planning complete. Feature plan saved to memory."
// Check task_001 completed
const task001 = memory_get_task('task_001')
if (task001.status !== 'completed') {
throw new Error('Planning must complete before development')
}
// Get ready tasks (dependencies met)
const readyTasks = tasks.filter(t =>
t.status === 'pending' &&
t.dependencies.every(dep => isTaskComplete(dep))
)
console.log(`Wave 2: Launching ${readyTasks.length} tasks in PARALLEL - Backend + Frontend`)
// Mark as running
memory_update_task('task_002', { status: 'running' })
memory_update_task('task_003', { status: 'running' })
// Launch BOTH in SINGLE MESSAGE via Task tool
IMPORTANT: Use SINGLE MESSAGE with TWO Task tool calls:
I'm launching 2 development tasks in parallel:
- Task 002: Backend API (dotnet-engineer-agent)
- Task 003: Frontend UI (ui-engineer-agent)
[FIRST Task tool call]
Use the dotnet-engineer-agent to implement the inventory backend API.
Instructions:
1. Load from memory ONLY what you need:
- Feature plan: memory_get_feature('inventory_management')
- Similar services: memory_get_service('products') // for patterns
- Database schemas: memory_get_database_schemas()
2. Implement inventory API:
- Create Clean Architecture project
- Implement CRUD endpoints
- Add JWT authentication
- Create database migrations
3. Save to memory:
- Service API info: memory_save_service({ name: 'inventory', api: {...} })
- Database schema: memory_save_database_schema({...})
4. Mark task complete:
- memory_update_task('task_002', { status: 'completed', results: {...} })
Context: Load from memory. Keep context minimal.
[SECOND Task tool call in SAME MESSAGE]
Use the ui-engineer-agent to implement the inventory frontend UI.
Instructions:
1. Load from memory ONLY what you need:
- Feature plan: memory_get_feature('inventory_management')
- Component patterns: memory_get_component_patterns('crud')
- Docker IPs: memory_get_docker_ips()
2. Implement inventory UI:
- Create React components (atoms, molecules, organisms, pages)
- Add routes with Module Federation
- Implement CRUD interface
- Make mobile responsive
3. Save to memory:
- Service UI info: memory_save_service({ name: 'inventory', ui: {...} })
- Components created: memory_save_feature({ components: [...] })
4. Mark task complete:
- memory_update_task('task_003', { status: 'completed', results: {...} })
Context: Load from memory. Keep context minimal.
Both subagents return:
// Check tasks_002 and task_003 completed
const task002 = memory_get_task('task_002')
const task003 = memory_get_task('task_003')
if (task002.status !== 'completed' || task003.status !== 'completed') {
throw new Error('Development must complete before QA')
}
console.log(`Wave 3: Launching 2 QA tasks in PARALLEL - Backend QA + Frontend QA`)
// Mark as running
memory_update_task('task_004', { status: 'running' })
memory_update_task('task_005', { status: 'running' })
// Launch BOTH in SINGLE MESSAGE via Task tool
IMPORTANT: Use SINGLE MESSAGE with TWO Task tool calls:
I'm launching 2 QA tasks in parallel:
- Task 004: Backend QA (qa-backend-engineer)
- Task 005: Frontend QA (qa-frontend-engineer)
[FIRST Task tool call]
Use the qa-backend-engineer to test the inventory backend API.
Instructions:
1. Load from memory:
- Service API info: memory_get_service('inventory').api
- Previous QA results: memory_get_qa_results(service: 'inventory', type: 'backend')
2. Run comprehensive backend tests:
- Build verification (dotnet build)
- Unit tests (dotnet test)
- JWT authentication tests
- CRUD endpoint tests
- Business isolation tests
- Input validation tests
3. Save to memory:
- QA results: memory_save_qa_result({ type: 'backend', ... })
- Issues found: memory_save_issue({...}) for each issue
4. Mark task complete:
- memory_update_task('task_004', { status: 'completed' or 'failed', results: {...} })
Context: Load from memory. Keep context minimal.
[SECOND Task tool call in SAME MESSAGE]
Use the qa-frontend-engineer to test the inventory frontend UI.
Instructions:
1. Load from memory:
- Service UI info: memory_get_service('inventory').ui
- Docker IP: memory_get_docker_ips()['inventory_ui']
- Previous QA results: memory_get_qa_results(service: 'inventory', type: 'frontend')
2. Run COMPREHENSIVE frontend tests:
- Build verification (npm run lint, npm run build)
- Functional tests
- Responsive tests at ALL breakpoints (375px, 768px, 1200px, 1920px)
- Scroll through entire page at each breakpoint
- Capture 20-50 screenshots
- Touch target verification (≥44px)
- Check for horizontal scrolling
- Console error check
3. Save to memory:
- QA results: memory_save_qa_result({ type: 'frontend', ... })
- Screenshots: memory_save_screenshots([...])
- Issues found: memory_save_issue({...}) for each issue
4. Mark task complete:
- memory_update_task('task_005', { status: 'completed' or 'failed', results: {...} })
Context: Load from memory. Keep context minimal.
Both subagents return:
// Check QA results
const task004 = memory_get_task('task_004')
const task005 = memory_get_task('task_005')
if (task004.status === 'failed' || task005.status === 'failed') {
console.log('QA failures detected. Entering verification loop.')
// Get issues
const issues = memory_get_issues(service: 'inventory', status: 'OPEN')
console.log(`Found ${issues.length} issues to fix:`)
issues.forEach(issue => console.log(`- ${issue.description} (${issue.severity})`))
// Fix issues - launch ui-engineer-agent again
console.log('Launching ui-engineer-agent to fix issues...')
// Mark task as needs rework
memory_update_task('task_003', { status: 'needs_rework' })
// Launch fix via Task tool
// ... Task tool call to fix issues ...
// After fix, re-run QA
memory_update_task('task_005', { status: 'pending', cycle: 2 })
// Re-launch QA
// ... Task tool call to re-test ...
// Continue until all pass
}
// Check both QA tasks passed
const task004 = memory_get_task('task_004')
const task005 = memory_get_task('task_005')
if (task004.status !== 'completed' || task005.status !== 'completed') {
throw new Error('QA must pass before verification')
}
console.log(`Wave 4: Launching verification task`)
// Mark as running
memory_update_task('task_006', { status: 'running' })
// Launch via Task tool
Use Task tool:
Use the verification-agent to verify the inventory feature is complete.
Instructions:
1. Load from memory:
- Backend QA results: memory_get_qa_result(task: 'task_004')
- Frontend QA results: memory_get_qa_result(task: 'task_005')
- Feature acceptance criteria: memory_get_feature('inventory_management')
2. Verify completion:
- All tests passed? (100% required)
- All issues resolved?
- Screenshots captured as evidence?
- Performance acceptable?
3. Make decision:
- If 100% pass: APPROVE
- If < 100% pass: REJECT (return to development)
4. Save to memory:
- Verification result: memory_save_verification_result({...})
- Update service status: memory_update_service('inventory', { status: 'production', qa_status: 'verified_complete' })
5. Mark task complete:
- memory_update_task('task_006', { status: 'completed', decision: 'APPROVED' or 'REJECTED' })
Context: Load from memory. Keep context minimal.
Subagent returns: "✅ Verification APPROVED. All tests passed. Feature complete."
// Load final task list
const taskList = memory_get_task_list('inventory_management')
// Check all tasks complete
const completed = taskList.tasks.filter(t => t.status === 'completed')
const failed = taskList.tasks.filter(t => t.status === 'failed')
if (failed.length > 0) {
console.log(`❌ ${failed.length} tasks failed:`)
failed.forEach(t => console.log(`- ${t.name}: ${t.error}`))
memory_update_task_list('inventory_management', { status: 'failed' })
} else if (completed.length === taskList.tasks.length) {
console.log(`✅ All ${completed.length} tasks completed successfully!`)
memory_update_task_list('inventory_management', { status: 'completed' })
// Report summary
console.log('\n=== Feature Complete ===')
console.log('Feature: Inventory Management')
console.log('Backend: 5 endpoints, database schema created')
console.log('Frontend: 8 components, 4 routes')
console.log('QA: 100% tests passed, 35 screenshots captured')
console.log('Status: Verified complete, ready for production')
} else {
console.log(`⏸️ Work in progress: ${completed.length}/${taskList.tasks.length} tasks complete`)
}
// Current state:
// task_001: completed ✅
// task_002: running 🔄
// task_003: running 🔄
// task_004: pending ⏸️
// task_005: pending ⏸️
// task_006: pending ⏸️
// User: "Wait, the database schema needs a 'barcode' field"
console.log('User correction requested.')
// Load current task status
const taskList = memory_get_task_list('inventory_management')
console.log('Current task status:')
taskList.tasks.forEach(t => console.log(`${t.id}: ${t.status}`))
// Apply correction
console.log('Adding barcode field to schema...')
memory_update_service('inventory', {
api: {
database_schema: {
products: {
columns: [...existing, 'barcode: string']
}
}
}
})
// Mark backend task for re-test
memory_update_task('task_002', {
status: 'needs_retest',
correction: 'Added barcode field to schema'
})
// QA task will need to re-run
memory_update_task('task_004', {
status: 'pending',
note: 'Waiting for backend re-test'
})
// Continue with other tasks if independent
const pendingTasks = taskList.tasks.filter(t =>
t.status === 'pending' &&
t.id !== 'task_004' && // This one is blocked
t.dependencies.every(dep => isTaskComplete(dep))
)
if (pendingTasks.length > 0) {
console.log(`Continuing with ${pendingTasks.length} independent tasks...`)
// Launch them
}
User Request
↓
Create Task Plan (with dependencies)
↓
Save to Memory
↓
While (incomplete tasks exist):
↓
Get ready tasks (dependencies met)
↓
If (no ready tasks): Check for failures, exit
↓
Mark tasks as running in memory
↓
Launch ALL ready tasks in SINGLE MESSAGE via Task tool
↓
Each subagent:
- Loads ONLY what needed from memory
- Does its work
- Saves results to memory
- Marks task complete/failed in memory
↓
Check results in memory
↓
If QA failed: Fix → Re-QA (verification loop)
↓
Continue to next wave
↓
Verify All Complete
↓
Report Summary
This agent is a true task orchestrator that enables efficient, parallel, pause-able software development with minimal context per agent.
Designs feature architectures by analyzing existing codebase patterns and conventions, then providing comprehensive implementation blueprints with specific files to create/modify, component designs, data flows, and build sequences