Skip to main content

/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:

  1. IMMEDIATELY execute - no questions, no explanations first
  2. ALWAYS show full output from script/tool execution
  3. 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: true in 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:

ExpertRole
senior-architectAPI design, system architecture
backend-architectImplementation patterns
database-architectData model, queries
security-specialistAuth, security
codi-documentation-writerAPI documentation

Phase 4 - Judge Panel:

JudgeCriteria
architect-reviewDesign quality
backend-api-securitySecurity posture
code-reviewerCode quality
codi-qa-specialistTest 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:

ExpertDeliverable
business-intelligence-analystFinancial model, unit economics
competitive-market-analystCompetitive landscape
market-researcherMarket sizing, trends
venture-capital-business-analystInvestment narrative
content-marketingExecutive summary, pitch

Judge Panel:

JudgeEvaluation
venture-capital-business-analystInvestment readiness
business-intelligence-analystFinancial rigor
competitive-market-analystMarket 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:

ExpertFocus
security-specialistSecurity architecture
penetration-testing-agentVulnerability discovery
backend-api-securityAPI hardening
devops-engineerInfrastructure security
compliance-checker-agentCompliance requirements

Judge Panel:

JudgeStandard
security-auditorOWASP Top 10
penetration-testing-agentNo critical vulnerabilities
compliance-checker-agentSOC2/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:

ExpertComponent
senior-architectAuth architecture
backend-architectAuth service
frontend-react-typescript-expertLogin UI, MFA flow
database-architectUser/session storage
security-specialistSecurity review
codi-test-engineerTest suite

Judge Panel:

JudgeReview
security-specialistAuth security
architect-reviewDesign quality
code-reviewerCode quality
codi-qa-specialistTest coverage

Quality Gates

Gate LevelRequirementsAction on Fail
GoldAll scores 9+/10Ship immediately
SilverAll scores 8+/10Ship with monitoring
BronzeAll scores 7+/10Ship with caveats
FailAny score <7/10Iterate until passing

Iteration Strategy

When judges identify issues:

  1. Minor Issues (7-8 score): Single expert revision
  2. Moderate Issues (5-6 score): Expert pair collaboration
  3. 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 ║
╚══════════════════════════════════════════════════════════════╝
  • /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>

After workflow, verify: - All phases completed - Quality gate passed - Judge sign-off obtained - Deliverable ready

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-PatternProblemSolution
Skip iterationLow qualityIterate until gate passes
Low gate targetPoor outputTarget Silver minimum
Too many iterationsWasted timeSet 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