MoE Task Execution Workflow
MoE Task Execution Workflow
Overview
This skill defines the standard workflow for task discovery, agent selection, invocation creation, and coordinated execution using Mixture-of-Experts (MoE) orchestration.
When to Use This Skill
Use this skill when:
- Starting a new session and need to orient quickly
- Popping the next task from the tasklist to execute
- Coordinating multiple agents for complex tasks
- Ensuring consistent task execution methodology
- Updating tasklists with explicit agent invocations
Don't use this skill when:
- Simple single-step tasks (just execute directly)
- Non-agentic work (manual file edits)
- Research/exploration without task execution
The 5-Step Methodology
Step 1: Find Project Plan & Checkpoints
# Find pilot plan and related documents
Glob("**/PILOT*.md")
Glob("**/CHECKPOINT*.md")
# Read latest checkpoint
Read("/path/to/docs/CHECKPOINT-YYYY-MM-DD.md")
# Read the active tasklist
Read("internal/project/plans/PILOT-PARALLEL-EXECUTION-PLAN.md")
Step 2: Multi-Query Context Search
Run multiple /cxq searches to build complete context:
# Search 1: Find the documents
/cxq --recall "pilot project-plan tasklist"
# Search 2: Get current status
/cxq --recent 200
# Search 3: Find recent work (use date constraints)
/cxq --since "1 day ago" --limit 50
# Search 4: Identify next steps
/cxq --decisions --limit 20
Step 3: Agent Discovery with /which
Find the right agents for your tasks:
# Discover agents for specific task types
/which moe-agents orchestrator project-organizer
# Get agent recommendations
/which analyze pilot tasklist
/which implement security hardening
/which create documentation
Agent Type Reference:
| Task Type | Primary Agent | Supporting Agents |
|---|---|---|
| Security | security-specialist | testing-specialist |
| Frontend | frontend-react-typescript-expert | - |
| Backend | senior-architect | database-architect |
| Testing | testing-specialist | - |
| DevOps | devops-engineer | cloud-architect |
| Documentation | codi-documentation-writer | - |
| Orchestration | orchestrator | project-organizer |
Step 4: Create Invocations & Update Tasklist
For each task, create explicit invocations and add to the tasklist:
Format:
- [ ] D.1.1: Rate limiting middleware
- **Agent:** `Task(subagent_type="security-specialist", prompt="Create api/middleware/rate_limit.py with slowapi rate limiting")`
Section-Level Invocation:
### D.1: P0 Security
**Agent Invocation:**
\`\`\`bash
Task(subagent_type="security-specialist", prompt="Implement Track D.1 P0 Security: (1) rate limiting; (2) security headers; (3) login protection")
\`\`\`
Step 5: Execute with MoE Orchestration
Option A: Full Track Orchestration
Task(subagent_type="orchestrator", prompt="Execute Track D.1 tasks per PILOT-PARALLEL-EXECUTION-PLAN.md using security-specialist agents")
Option B: Specific Task Execution
# Copy invocation from tasklist
Task(subagent_type="security-specialist", prompt="Implement Track D.1 P0 Security...")
Option C: MoE Consensus (Multiple Agents)
# Run orchestrator + project-organizer in parallel
Task(subagent_type="orchestrator", prompt="Coordinate Track D implementation")
Task(subagent_type="project-organizer", prompt="Verify file organization for Track D deliverables")
Quick Reference Commands
# Start session
/orient
# Find agents
/which <task description>
# Execute task
Task(subagent_type="<agent>", prompt="<from tasklist>")
# Mark complete
# Edit tasklist: [ ] → [x]
Invocation Templates
Security Tasks
Task(subagent_type="security-specialist", prompt="Implement security hardening: rate limiting, security headers, input validation, audit logging per PILOT-PARALLEL-EXECUTION-PLAN.md Track D")
Testing Tasks
Task(subagent_type="testing-specialist", prompt="Implement E2E testing: user flow tests, security tests, platform tests per PILOT-PARALLEL-EXECUTION-PLAN.md Track E")
Documentation Tasks
/agent codi-documentation-writer "Create user documentation: installation guide, user guide, FAQ per PILOT-PARALLEL-EXECUTION-PLAN.md Track F"
Frontend Tasks
Task(subagent_type="frontend-react-typescript-expert", prompt="Implement entitlement display: product access badges, subdomain links, upgrade CTAs per PILOT-PARALLEL-EXECUTION-PLAN.md B.3.4")
DevOps Tasks
Task(subagent_type="devops-engineer", prompt="Deploy infrastructure: GKE deployment, DNS configuration, SSL certificates per PILOT-PARALLEL-EXECUTION-PLAN.md Track C")
Integration with /orient
The /orient command uses this skill for the enhanced 5-step methodology:
# Full orientation with MoE workflow
/orient
# Deep orientation for specific topic
/orient --deep "security hardening"
# Quick status check
/orient --quick
Best Practices
- Always create invocations first - Before executing, add the invocation to the tasklist
- Use section-level invocations - Group related tasks under a single orchestrated invocation
- Date-constrain searches - Use
--sinceand--untilfor relevant context - Mark tasks immediately - Update
[ ]→[x]as soon as task completes - Update checkpoints - Create session checkpoint after significant work
Success Output
When this skill completes successfully, output:
✅ SKILL COMPLETE: moe-task-execution
Completed:
- [x] Project plan and checkpoints found and read
- [x] Multi-query context search executed (4+ searches)
- [x] Agent discovery completed with /which
- [x] Invocations created and added to tasklist
- [x] Tasks executed with appropriate agents
- [x] Tasklist updated with completed tasks
MoE Execution Summary:
- Plans found: [count]
- Context queries executed: [count]
- Agents discovered: [count]
- Invocations created: [count]
- Tasks completed: [count]
Outputs:
- Updated tasklist with invocations
- Task completion markers ([x])
- Session context captured
Completion Checklist
Before marking this skill as complete, verify:
- Project plan found (PILOT*.md or project-plan.md)
- Latest checkpoint read and context restored
- At least 4 context searches executed (/cxq)
- Agent discovery performed for each task type (/which)
- Invocations created in correct format (Task() or /agent)
- Invocations added to tasklist before execution
- Tasks executed successfully with recommended agents
- Tasklist updated with completion markers [x]
- Session context captured with /cx
Failure Indicators
This skill has FAILED if:
- ❌ Project plan not found or not read
- ❌ Context search skipped or insufficient (<4 queries)
- ❌ Agent discovery not performed (/which skipped)
- ❌ Invocations not created before execution
- ❌ Wrong agent used for task (didn't follow /which recommendations)
- ❌ Tasklist not updated with invocations or completion
- ❌ Tasks executed without proper MoE coordination
- ❌ Context lost between sessions (no /cx)
When NOT to Use
Do NOT use this skill when:
- Simple single-step tasks (just execute directly)
- No tasklist exists (exploratory work)
- Task doesn't require agent coordination (manual file edits)
- Research/analysis without execution
- Quick fixes or hotfixes (overhead not worth it)
- Emergency debugging (skip coordination overhead)
- Working outside CODITECT framework
Use instead:
- Direct tool calls for simple tasks
- Manual execution for quick fixes
- Standard workflow for non-agentic work
- Research skills for exploration
- Debugging skills for emergency fixes
Anti-Patterns (Avoid)
| Anti-Pattern | Problem | Solution |
|---|---|---|
| Skip context search | Start blind, repeat past work | Always run multi-query /cxq first |
| Execute without /which | Use wrong agent, inefficient | Always discover agents before execution |
| No invocation in tasklist | Can't reproduce, track, or audit | Always document invocation before running |
| Wrong agent used | Task fails or poor quality | Follow /which recommendations |
| Skip orientation | Lost context, inefficient session | Always run /orient at session start |
| Single context query | Incomplete context, missed info | Run 4+ queries from different angles |
| No completion markers | Can't track progress | Update tasklist [x] immediately after completion |
| Execute before creating invocation | No audit trail, can't reproduce | Invocation BEFORE execution, always |
Principles
This skill embodies CODITECT principles:
- #1 Recycle → Extend → Re-Use → Create - Reuses past context, prevents duplicate work
- #2 First Principles - Understands WHY MoE coordination improves quality
- #3 Keep It Simple - 5 clear steps, repeatable methodology
- #4 Separation of Concerns - Discovery separate from execution
- #5 Eliminate Ambiguity - Explicit invocations, clear agent assignments
- #6 Clear, Understandable, Explainable - Each step documented in tasklist
- #8 No Assumptions - Always discover, never assume right agent
- #9 Measurable & Traceable - Completion markers, invocation history
- #10 Provide Context - Multi-query search ensures complete context
Full Standard: CODITECT-STANDARD-AUTOMATION.md
Related Components
| Component | Purpose |
|---|---|
/orient | Session orientation with 5-step methodology |
/which | Agent discovery and recommendations |
/agent | CODITECT agent invocation |
orchestrator | Multi-agent coordination |
project-organizer | File/directory organization |
session-analysis | Session indexing and tracking |
Created: December 31, 2025 Author: CODITECT Team Version: 1.0.0 Updated: 2026-01-04