/moe-workflow - Complete Mixture of Experts Workflow
Orchestrates the complete MoE lifecycle: assembles experts to create deliverables, then judges to evaluate and iterate until quality standards are met.
System Prompt
⚠️ EXECUTION DIRECTIVE: When the user invokes this command, you MUST:
- IMMEDIATELY execute - no questions, no explanations first
- ALWAYS show full output from script/tool execution
- ALWAYS provide summary after execution completes
DO NOT:
- Say "I don't need to take action" - you ALWAYS execute when invoked
- Ask for confirmation unless
requires_confirmation: truein frontmatter - Skip execution even if it seems redundant - run it anyway
The user invoking the command IS the confirmation.
Usage
/moe-workflow <task-description>
Workflow Phases
┌──────────────────────────────────────────────────────────────┐
│ MoE WORKFLOW │
├──────────────────────────────────────────────────────────────┤
│ │
│ Phase 1: ANALYZE │
│ ├─ Understand requirements │
│ ├─ Identify required expertise │
│ └─ Define success criteria │
│ │ │
│ ▼ │
│ Phase 2: ASSEMBLE EXPERTS │
│ ├─ Select 3-7 domain experts │
│ ├─ Assign roles and responsibilities │
│ └─ Create coordination plan │
│ │ │
│ ▼ │
│ Phase 3: EXECUTE │
│ ├─ Experts collaborate on deliverable │
│ ├─ Orchestrator coordinates handoffs │
│ └─ Produce initial output │
│ │ │
│ ▼ │
│ Phase 4: ASSEMBLE JUDGES │
│ ├─ Select 3-5 evaluation experts │
│ ├─ Define evaluation criteria │
│ └─ Weight by importance │
│ │ │
│ ▼ │
│ Phase 5: EVALUATE │
│ ├─ Each judge reviews independently │
│ ├─ Score across criteria │
│ └─ Synthesize verdict │
│ │ │
│ ▼ │
│ Phase 6: ITERATE (if needed) │
│ ├─ Address judge feedback │
│ ├─ Re-execute with targeted experts │
│ └─ Re-evaluate until passing │
│ │ │
│ ▼ │
│ Phase 7: DELIVER │
│ ├─ Final quality-assured output │
│ ├─ Judge panel sign-off │
│ └─ Documentation and handoff │
│ │
└──────────────────────────────────────────────────────────────┘
Examples
Example 1: Build Production API
/moe-workflow build production-ready REST API for user management
Phase 2 - Expert Team:
| Expert | Role |
|---|---|
senior-architect | API design, system architecture |
backend-architect | Implementation patterns |
database-architect | Data model, queries |
security-specialist | Auth, security |
codi-documentation-writer | API documentation |
Phase 4 - Judge Panel:
| Judge | Criteria |
|---|---|
architect-review | Design quality |
backend-api-security | Security posture |
code-reviewer | Code quality |
codi-qa-specialist | Test coverage |
Execution:
/agent orchestrator "Execute MoE workflow for production REST API:
PHASE 1 - Expert Execution:
1. senior-architect designs API architecture and endpoints
2. database-architect creates data model and schema
3. backend-architect implements API endpoints
4. security-specialist adds authentication/authorization
5. codi-documentation-writer creates OpenAPI spec
PHASE 2 - Judge Evaluation:
1. architect-review scores design (target: 8+/10)
2. backend-api-security scores security (target: 8+/10)
3. code-reviewer scores code quality (target: 8+/10)
4. codi-qa-specialist scores test coverage (target: 80%+)
PHASE 3 - Iterate until all scores meet targets
Deliver: Production-ready API with judge sign-off"
Example 2: Business Strategy Document
/moe-workflow create investor-ready business strategy for AI startup
Expert Team:
| Expert | Deliverable |
|---|---|
business-intelligence-analyst | Financial model, unit economics |
competitive-market-analyst | Competitive landscape |
market-researcher | Market sizing, trends |
venture-capital-business-analyst | Investment narrative |
content-marketing | Executive summary, pitch |
Judge Panel:
| Judge | Evaluation |
|---|---|
venture-capital-business-analyst | Investment readiness |
business-intelligence-analyst | Financial rigor |
competitive-market-analyst | Market positioning |
Success Criteria:
- Investment readiness score: 8+/10
- Financial model completeness: 9+/10
- Market opportunity clarity: 8+/10
Example 3: Security Hardening
/moe-workflow complete security hardening for production deployment
Expert Team:
| Expert | Focus |
|---|---|
security-specialist | Security architecture |
penetration-testing-agent | Vulnerability discovery |
backend-api-security | API hardening |
devops-engineer | Infrastructure security |
compliance-checker-agent | Compliance requirements |
Judge Panel:
| Judge | Standard |
|---|---|
security-auditor | OWASP Top 10 |
penetration-testing-agent | No critical vulnerabilities |
compliance-checker-agent | SOC2/GDPR compliance |
Quality Gate:
- Zero critical vulnerabilities
- Zero high vulnerabilities
- Compliance checklist 100%
Example 4: Full-Stack Feature
/moe-workflow implement user authentication with OAuth2 and MFA
Expert Team:
| Expert | Component |
|---|---|
senior-architect | Auth architecture |
backend-architect | Auth service |
frontend-react-typescript-expert | Login UI, MFA flow |
database-architect | User/session storage |
security-specialist | Security review |
codi-test-engineer | Test suite |
Judge Panel:
| Judge | Review |
|---|---|
security-specialist | Auth security |
architect-review | Design quality |
code-reviewer | Code quality |
codi-qa-specialist | Test coverage |
Quality Gates
| Gate Level | Requirements | Action on Fail |
|---|---|---|
| Gold | All scores 9+/10 | Ship immediately |
| Silver | All scores 8+/10 | Ship with monitoring |
| Bronze | All scores 7+/10 | Ship with caveats |
| Fail | Any score <7/10 | Iterate until passing |
Iteration Strategy
When judges identify issues:
- Minor Issues (7-8 score): Single expert revision
- Moderate Issues (5-6 score): Expert pair collaboration
- Major Issues (<5 score): Full expert team re-engagement
# Iteration example
/agent orchestrator "Iteration 2 for API security:
Judge feedback: Rate limiting missing (scored 6/10)
Action:
1. backend-architect implements rate limiting middleware
2. security-specialist verifies implementation
3. Re-evaluate with backend-api-security judge
Target: 8+/10 security score"
Output Format
╔══════════════════════════════════════════════════════════════╗
║ MoE WORKFLOW COMPLETE ║
╠══════════════════════════════════════════════════════════════╣
║ Task: Build production REST API ║
║ Iterations: 2 ║
║ Status: ✅ APPROVED ║
╠══════════════════════════════════════════════════════════════╣
║ EXPERT CONTRIBUTIONS: ║
║ ├─ senior-architect: API design (12 endpoints) ║
║ ├─ backend-architect: Implementation (2,400 LOC) ║
║ ├─ database-architect: Schema (8 tables) ║
║ ├─ security-specialist: Auth + security (JWT, RBAC) ║
║ └─ codi-documentation-writer: OpenAPI spec (45 pages) ║
╠══════════════════════════════════════════════════════════════╣
║ JUDGE SCORES (Final): ║
║ ├─ architect-review: 9/10 ✅ ║
║ ├─ backend-api-security: 8/10 ✅ (improved from 6) ║
║ ├─ code-reviewer: 8/10 ✅ ║
║ └─ codi-qa-specialist: 8/10 ✅ (85% coverage) ║
╠══════════════════════════════════════════════════════════════╣
║ OVERALL: 8.25/10 - SILVER QUALITY GATE PASSED ║
╚══════════════════════════════════════════════════════════════╝
Related Commands
/moe-agents <task>- Assemble experts only/moe-judges <output>- Evaluate only/which <task>- Quick single-agent recommendation/agent <name> <task>- Direct agent invocation
Action Policy
<default_behavior> This command orchestrates complete MoE lifecycle:
- Assembles experts
- Creates deliverables
- Assembles judges
- Evaluates output
- Iterates until quality
User receives quality-assured deliverable. </default_behavior>
Success Output
When moe-workflow completes:
✅ COMMAND COMPLETE: /moe-workflow
Task: <description>
Experts: N contributors
Judges: N evaluators
Iterations: N
Score: N/10
Gate: <GOLD|SILVER|BRONZE>
Completion Checklist
Before marking complete:
- Requirements analyzed
- Experts assembled
- Deliverable created
- Judges assembled
- Evaluation complete
- Quality gate passed
Failure Indicators
This command has FAILED if:
- ❌ No task provided
- ❌ Experts failed
- ❌ Quality gate not passed
- ❌ Max iterations exceeded
When NOT to Use
Do NOT use when:
- Simple single-agent task
- Already have deliverable (use /moe-judges)
- Just need experts (use /moe-agents)
Anti-Patterns (Avoid)
| Anti-Pattern | Problem | Solution |
|---|---|---|
| Skip iteration | Low quality | Iterate until gate passes |
| Low gate target | Poor output | Target Silver minimum |
| Too many iterations | Wasted time | Set iteration limit |
Principles
This command embodies:
- #3 Complete Execution - Full lifecycle
- #9 Based on Facts - Evidence-based quality
- #6 Clear, Understandable - Clear quality gates
Full Standard: CODITECT-STANDARD-AUTOMATION.md
Version: 1.0.0 Created: 2025-12-22 Author: CODITECT Team