| name | workflow-orchestrator |
| description | Intelligent workflow delegation system that automatically analyzes every prompt and routes to appropriate specialized workflows with architecture-first development principles. This skill runs on every prompt with highest priority to ensure intelligent task delegation before any other skill execution. |
Workflow Orchestrator
Intelligent task analysis and automatic workflow delegation system that combines architecture-first development with smart workflow routing.
Core Philosophy
You are the central intelligence that routes complex development tasks to specialized workflows while ensuring architectural integrity and production-ready code generation.
Task Analysis Engine
Semantic Analysis
Before delegating to any workflow, perform comprehensive task analysis:
interface TaskAnalysis {
taskType: 'setup' | 'development' | 'deployment' | 'maintenance' | 'design' | 'testing';
complexity: 'simple' | 'moderate' | 'complex';
estimatedTime: number;
requiredSkills: string[];
suggestedWorkflow: string;
confidence: number;
architecturalImpact: 'low' | 'medium' | 'high';
dependencies: string[];
}
Workflow Routing Matrix
/setup-project → setup-project workflow
/add-entity → add-entity workflow
/create-component → create-component workflow
/create-ui → frontend-design workflow
/setup-auth → setup-auth-flow workflow
/deploy-app → deploy-production workflow
/optimize-performance → performance-optimization workflow
/scrape-data → scraper workflow
/test-standards → testing-standards workflow
Architecture-First Delegation
Pre-Delegation Analysis
- Read Architecture Documents — Understand system structure
- Identify Integration Points — Where does this fit?
- Assess Impact — What changes are required?
- Validate Dependencies — Are required tools available?
Delegation Protocol
interface DelegationRequest {
task: string;
analysis: TaskAnalysis;
context: ProjectContext;
architecturalConstraints: ArchitecturalConstraints;
}
class WorkflowOrchestrator {
async delegateToWorkflow(request: DelegationRequest): Promise<DelegationResult> {
const workflow = this.selectWorkflow(request.analysis.suggestedWorkflow);
const enhancedContext = {
...request.context,
architecturalConstraints: request.architecturalConstraints,
delegationSource: 'orchestrator'
};
return await workflow.execute(request.task, enhancedContext);
}
}
Multi-Workflow Coordination
Parallel Execution
interface WorkflowExecution {
id: string;
workflow: string;
status: 'pending' | 'running' | 'completed' | 'failed';
dependencies: string[];
result?: any;
}
class WorkflowCoordinator {
async executeParallelWorkflows(tasks: TaskAnalysis[]): Promise<WorkflowExecution[]> {
const executionPlan = this.createExecutionPlan(tasks);
return await this.executeWithDependencies(executionPlan);
}
}
Context Management
interface ProjectContext {
projectType: 'hustlestack' | 'custom';
currentPhase: 'setup' | 'development' | 'deployment' | 'maintenance';
environment: 'development' | 'staging' | 'production';
architecture: ArchitectureDocument;
userPreferences: Record<string, any>;
activeWorkflows: WorkflowExecution[];
}
Learning and Adaptation
Confidence Scoring
class SkillMatcher {
calculateConfidence(skill: WorkflowSkill, analysis: TaskAnalysis): number {
let confidence = 0.5;
const keywordMatches = skill.keywords.filter(keyword =>
analysis.task.toLowerCase().includes(keyword.toLowerCase())
).length;
confidence += (keywordMatches / skill.keywords.length) * 0.3;
const semanticSimilarity = this.calculateSemanticSimilarity(skill, analysis);
confidence += semanticSimilarity * 0.2;
const historicalSuccess = this.getHistoricalSuccessRate(skill);
confidence += historicalSuccess * 0.3;
const complexityMatch = this.complexityMatches(skill, analysis);
confidence += complexityMatch * 0.2;
return Math.min(confidence, 1.0);
}
}
Learning System
interface ExecutionHistory {
workflow: string;
task: string;
success: boolean;
executionTime: number;
userFeedback?: number;
timestamp: Date;
}
class AdaptiveLearning {
updateConfidence(execution: ExecutionHistory): void {
const skill = this.findSkill(execution.workflow);
const adjustment = this.calculateAdjustment(execution);
skill.confidence += adjustment;
}
generateInsights(): WorkflowInsights {
return {
mostUsedWorkflows: this.getMostUsedWorkflows(),
averageExecutionTime: this.getAverageExecutionTime(),
successPatterns: this.getSuccessPatterns(),
recommendations: this.generateRecommendations()
};
}
}
Integration with Delegation Principles
Architecture Compliance
All delegated workflows must follow delegation skill principles:
- Read architecture document before writing code
- Declare target filepath explicitly
- List dependencies and consumers
- Check for conflicts with existing functionality
- Implement fully typed production-ready code
- Follow naming conventions strictly
- Write comprehensive tests for all implementations
Quality Gates
interface QualityGate {
validateArchitecture(code: string, context: ProjectContext): boolean;
validateDependencies(code: string): boolean;
validateTesting(code: string): boolean;
validateDocumentation(code: string): boolean;
}
class DelegationQualityGate {
async validateDelegation(result: DelegationResult): Promise<ValidationReport> {
return {
architectureCompliant: await this.validateArchitecture(result.code),
dependenciesResolved: this.validateDependencies(result.code),
testsIncluded: this.validateTesting(result.code),
documented: this.validateDocumentation(result.code),
overallScore: this.calculateQualityScore(result)
};
}
}
Error Handling and Recovery
Graceful Degradation
class ErrorRecovery {
async handleWorkflowFailure(execution: WorkflowExecution): Promise<RecoveryResult> {
const failureAnalysis = this.analyzeFailure(execution);
if (failureAnalysis.canRetry) {
return await this.retryWithAlternative(execution);
}
return await this.degradeToSimplerWorkflow(execution);
}
}
Configuration
Orchestrator Settings
{
"orchestrator": {
"confidence_threshold": 0.7,
"max_parallel_workflows": 3,
"learning_rate": 0.1,
"context_retention": "24h",
"auto_delegation": true,
"architecture_first": true,
"quality_gates": true
},
"workflows": {
"timeout_duration": "30m",
"retry_attempts": 3,
"progress_tracking": true,
"error_handling": "graceful_degradation",
"require_architecture_compliance"
Usage Examples
Basic Delegation
User: "Add user authentication to my app"
→ Analyze task → Match to setup-auth-flow → Delegate with architecture context
Complex Multi-Workflow Coordination
User: "Build a complete e-commerce site with auth, payment, and deployment"
→ Analyze components → Route to multiple workflows → Coordinate parallel execution → Integrate results
Learning Adaptation
User provides feedback on workflow quality
→ Update confidence scores → Improve future routing → Generate insights
Benefits
- Intelligent Routing - Automatically selects optimal workflows
- Architecture Protection - Ensures all code follows system design
- Quality Assurance - Built-in quality gates and validation
- Learning System - Improves accuracy through usage patterns
- Multi-Workflow Support - Coordinates complex, multi-step projects
- Error Recovery - Graceful handling of workflow failures
- Context Awareness - Maintains project state across delegations
Related Skills
- Use
/frontend-design for UI implementation workflows
- Use
/senior-dev for PR and code review workflows
- Use
/web-architecture for system architecture design
- Use individual workflow skills for specific domain tasks
This orchestrator combines intelligent delegation with the rigorous architecture-first approach of the delegation skill, providing a comprehensive system for managing complex development projects while maintaining code quality and architectural integrity.