PILOT Execution Workflow
Workflow ID: WF-PILOT-001 Version: 1.0.0 Status: Active Effective Date: January 1, 2026 Owner: Hal Casteel, Founder/CEO/CTO, AZ1.AI INC
1. Overview
The PILOT Execution Workflow orchestrates the complete lifecycle of CODITECT platform development from session start to completion. It integrates:
- Track-based task management (CODITECT-STD-001 nomenclature)
- MoE Task Execution methodology (5-step process)
- Agent discovery and invocation (/which, /agent)
- Context preservation (/cx, /cxq)
- Session logging (/session-log)
- Document classification (/classify)
2. Workflow Diagram
┌─────────────────────────────────────────────────────────────────────────────┐
│ PILOT EXECUTION WORKFLOW │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │ PHASE 1: SESSION START │ │
│ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │
│ │ │ /orient │ → │ /cxq │ → │ /which │ → │ Read │ │ │
│ │ │ │ │ --recent │ │ <task> │ │ PILOT │ │ │
│ │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │ │
│ └────────────────────────────────────────────────────────────────────┘ │
│ ↓ │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │ PHASE 2: TASK SELECTION │ │
│ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ │
│ │ │ Identify │ → │ Check │ → │ Create │ │ │
│ │ │ Next Track │ │ Dependencies │ │ Invocation │ │ │
│ │ │ (A-G) │ │ │ │ │ │ │
│ │ └──────────────┘ └──────────────┘ └──────────────┘ │ │
│ └────────────────────────────────────────────────────────────────────┘ │
│ ↓ │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │ PHASE 3: TASK EXECUTION │ │
│ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │
│ │ │ Execute │ → │ Verify │ → │ Update │ → │ Classify │ │ │
│ │ │ Agent │ │ Output │ │ PILOT │ │ Docs │ │ │
│ │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │ │
│ └────────────────────────────────────────────────────────────────────┘ │
│ ↓ │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │ PHASE 4: SESSION MANAGEMENT │ │
│ │ ┌────────────┐ ┌────────────┐ ┌────────────┐ │ │
│ │ │/session-log│ → │ /cx │ → │ Checkpoint │ │ │
│ │ │ │ │ │ │ (if major) │ │ │
│ │ └────────────┘ └────────────┘ └────────────┘ │ │
│ └────────────────────────────────────────────────────────────────────┘ │
│ ↓ │
│ Loop to Phase 2 │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
3. Phase Details
Phase 1: Session Start
Purpose: Orient to current project state and establish session context.
| Step | Command/Action | Purpose |
|---|---|---|
| 1.1 | /orient | Execute 5-step MoE Task Execution methodology |
| 1.2 | /cxq --recent 200 | Load recent session context |
| 1.3 | /cxq --decisions --limit 20 | Review recent decisions |
| 1.4 | /which <task> | Discover recommended agents |
| 1.5 | Read PILOT-PARALLEL-EXECUTION-PLAN.md | Load current project state |
Outputs:
- Session orientation summary
- Context loaded into working memory
- Agent recommendations for pending tasks
- Current track progress status
Phase 2: Task Selection
Purpose: Select next task(s) for execution using Track nomenclature.
| Step | Action | Details |
|---|---|---|
| 2.1 | Identify Next Track | Select from pending tracks (A-G) |
| 2.2 | Check Dependencies | Verify blocked_by fields are clear |
| 2.3 | Create Invocation | Generate Task(subagent_type=..., prompt=...) |
| 2.4 | Update Tasklist | Add invocation to task item in PILOT plan |
Track Selection Priority:
- Blocking tracks (tracks that block others)
- P0 Critical Path (highest priority)
- Active tracks (in_progress status)
- Sequential dependencies (unblocked tasks)
Invocation Format:
- [ ] A.1.1: Task description
- **Agent:** `Task(subagent_type="backend-development", prompt="Implement Track A.1.1...")`
Phase 3: Task Execution
Purpose: Execute selected task(s) with proper agent coordination.
| Step | Action | Details |
|---|---|---|
| 3.1 | Execute Agent | Run agent invocation (Task tool or /agent) |
| 3.2 | Verify Output | Confirm task completion criteria met |
| 3.3 | Update PILOT Plan | Mark task complete with details |
| 3.4 | Classify Documents | Run /classify on any new/modified documents |
Verification Checklist:
- Code compiles/passes linting
- Tests pass (if applicable)
- No security vulnerabilities introduced
- Documentation updated (if applicable)
PILOT Plan Update Format:
- [x] A.1.1: Task description ✅
- **Completed:** 2026-01-01T19:00:00Z
- **Agent:** backend-development
- **Changes:** `path/to/file.py` - Added feature X
Phase 4: Session Management
Purpose: Preserve session context and create audit trail.
| Step | Command/Action | Trigger |
|---|---|---|
| 4.1 | /session-log "entry" | After each significant task |
| 4.2 | /cx | Periodically or before session end |
| 4.3 | Create Checkpoint | After major milestone (track complete) |
Session Log Entry Format:
### 2026-01-01T19:00:00Z - Track A.1.1 Complete
- **Track:** A.1.1 (Backend: Heartbeat: Background thread)
- **Changes:** Implemented background heartbeat thread
- **Files Modified:**
- `backend/core/heartbeat.py`
- `backend/tests/test_heartbeat.py`
- **Status:** Track A.1 25% complete
Checkpoint Triggers:
- Track completion (e.g., "Track D: Security 100%")
- Phase transition
- Major milestone
- End of day/session
4. Track Nomenclature Integration
This workflow uses CODITECT-STD-001 Agentic Communication Standard Track nomenclature:
| Track | Domain | Repository |
|---|---|---|
| Track A | Backend API | coditect-cloud-infra/backend |
| Track B | Frontend UI | coditect-cloud-frontend |
| Track C | DevOps & Deployment | Infrastructure/K8s |
| Track D | Security Hardening | Cross-cutting |
| Track E | Integration Testing | Test suites |
| Track F | Documentation | Docs sites |
| Track G | DMS Integration | Document Management |
Task Identifier Format:
Track <LETTER>.<MAJOR>.<MINOR>
Examples:
- Track A.1.1 → Backend: Heartbeat: Background thread
- Track D.2.3 → Security: P1 Security: Error response hardening
5. Component Integration
Skills Used
| Skill | Purpose | Location |
|---|---|---|
moe-task-execution | 5-step MoE methodology | skills/moe-task-execution/SKILL.md |
session-logging | Session log management | skills/session-logging/SKILL.md |
pilot-execution | This workflow | skills/pilot-execution/SKILL.md |
Commands Used
| Command | Purpose |
|---|---|
/orient | Session orientation |
/which <task> | Agent discovery |
/agent <name> "task" | CODITECT agent invocation |
/cx | Context extraction |
/cxq | Context query |
/classify | Document classification |
/session-log | Session log updates |
/pilot | Workflow orchestration (this workflow) |
Agents Mapped to Tracks
| Track | Primary Agent | Fallback Agent |
|---|---|---|
| Track A | backend-development | senior-architect |
| Track B | frontend-react-typescript-expert | general-purpose |
| Track C | devops-engineer | cloud-architect |
| Track D | security-specialist | coditect-adr-specialist |
| Track E | testing-specialist | codi-qa-specialist |
| Track F | codi-documentation-writer | qa-reviewer |
| Track G | prompt-analyzer-specialist | general-purpose |
Scripts Used
| Script | Purpose |
|---|---|
session-orient.py | Session orientation |
context-db.py | Context database operations |
unified-message-extractor.py | Context extraction |
moe_classifier/classify.py | Document classification |
session_log_manager.py | Session log management |
Hooks
| Hook | Trigger | Action |
|---|---|---|
post-session-log-update.py | After session log update | Auto-classify log file |
session-retrospective.py | Session end | Capture learnings |
6. Execution Modes
Interactive Mode (Default)
Human-guided execution with agent assistance:
/pilot
# → Runs Phase 1 (orientation)
# → Presents recommended next tasks
# → Human selects task(s)
# → Agent executes
# → Human confirms completion
# → Loop
Semi-Autonomous Mode
Agent-driven with human checkpoints:
/pilot --semi-auto
# → Runs Phase 1-3 automatically
# → Pauses for human approval at:
# - Track transitions
# - Security-related tasks
# - Deployment tasks
Dry-Run Mode
Preview without execution:
/pilot --dry-run
# → Shows what would be executed
# → No actual changes
# → Validates dependencies
7. Error Handling
Task Failure
1. Log failure in session log
2. Mark task as failed in PILOT plan
3. Analyze failure (agent or infrastructure)
4. Create retry invocation if recoverable
5. Escalate to human if unrecoverable
Context Corruption
1. Restore from last checkpoint
2. Re-run /cx to rebuild context
3. Verify PILOT plan state
4. Resume from last known-good task
Agent Timeout
1. Log timeout in session log
2. Check agent output for partial completion
3. Create continuation invocation
4. Retry with increased timeout if needed
8. Success Metrics
| Metric | Target | Measurement |
|---|---|---|
| Task Completion Rate | 95%+ | completed / attempted |
| Context Preservation | 100% | sessions with /cx capture |
| Session Log Coverage | 100% | significant tasks logged |
| Classification Accuracy | 85%+ | moe_confidence score |
| Track Progress | Per PILOT plan | percentage complete |
9. Quick Reference
Start Session
/pilot # Full workflow
/orient # Just orientation
During Session
/which <task> # Find best agent
/agent <name> "x" # Invoke CODITECT agent
Task(subagent_type="x", prompt="y") # Claude Code agent
/session-log "x" # Log progress
/classify path/ # Classify documents
End Session
/cx # Capture context
/session-log --view # Review log
/checkpoint # Create checkpoint (if milestone)
10. Related Documents
| Document | Purpose |
|---|---|
| CODITECT-STD-001 | Track nomenclature standard |
| PILOT-PARALLEL-EXECUTION-PLAN.md | Active project plan |
| ADR-048 | Architecture decision |
| /pilot command | Command reference |
| pilot-execution skill | Skill definition |
Workflow Owner: Hal Casteel, Founder/CEO/CTO, AZ1.AI INC Review Cycle: Weekly during active development Next Review: January 8, 2026