ADR-048: PILOT Execution Workflow System
Status
Approved - January 1, 2026
Context and Problem Statement
The Manual Orchestration Problem
CODITECT's PILOT project execution has been manually orchestrated using:
- Individual Commands -
/orient,/which,/agent,/cx,/cxq,/session-log,/classify - Manual Track Management - Human selection of Track A-N tasks
- Ad-hoc Session Logging - Inconsistent session documentation
- Disconnected Components - Skills, agents, scripts, hooks operating independently
Current State (Manual Orchestration):
User → /orient → Manual task selection → /which → /agent → Manual logging → /cx
└── Disconnected ──┘ └── Disconnected ──┘
Target State (Unified Workflow):
User → /pilot → Unified 4-Phase Workflow
├── Phase 1: Session Start (orient, context, discovery)
├── Phase 2: Task Selection (Track nomenclature)
├── Phase 3: Task Execution (agent, verify, classify)
└── Phase 4: Session Management (log, capture, checkpoint)
Business Impact
- Consistency - Uniform workflow execution across sessions
- Traceability - Complete audit trail with session logs
- Efficiency - Reduced cognitive overhead for workflow execution
- Quality - Enforced verification and documentation steps
- Autonomy - Foundation for semi-autonomous operation
Decision Drivers
- Workflow Fragmentation - Too many independent commands to coordinate
- Session Continuity - Need systematic context preservation
- Track Nomenclature - ADR-054 requires consistent application
- Agent Coordination - Need systematic agent discovery and invocation
- Audit Requirements - Complete execution logging for compliance
- MoE Methodology - Need to enforce 5-step task execution process
Considered Options
Option A: Continue Manual Orchestration
- Keep individual commands, rely on human coordination
- Rejected: Inconsistent, error-prone, not scalable
Option B: Script-Based Automation
- Create shell script that chains commands
- Rejected: Inflexible, no interactive decision points
Option C: Unified Workflow System (Selected)
- Create workflow document, command, skill, and ADR
- Selected: Provides structure while maintaining flexibility
Option D: Full Autonomous Orchestrator
- Extend ADR-006 autonomous system
- Rejected: Premature; need human oversight for PILOT phase
Decision
Implement Option C: Unified Workflow System with four integrated components:
1. Workflow Document
File: docs/workflows/PILOT-EXECUTION-WORKFLOW.md
Purpose: Define the complete 4-phase workflow with:
- Phase 1: Session Start (orientation, context, discovery)
- Phase 2: Task Selection (Track nomenclature, dependencies)
- Phase 3: Task Execution (agent, verify, classify)
- Phase 4: Session Management (log, capture, checkpoint)
2. Command
File: commands/pilot.md
Purpose: Single entry point for workflow execution:
/pilot # Full workflow
/pilot --status # Status check
/pilot --track A # Track-specific
/pilot --task A.1.1 # Task-specific
/pilot --semi-auto # Semi-autonomous mode
3. Skill
File: skills/pilot-execution/SKILL.md
Purpose: Reusable skill definition for:
- 4-phase process documentation
- Track nomenclature reference
- Integration point documentation
- Error handling patterns
4. ADR (This Document)
Purpose: Architecture decision record documenting:
- Context and problem statement
- Decision rationale
- Component relationships
- Success metrics
Architecture
Component Integration
┌─────────────────────────────────────────────────────────────────────────┐
│ PILOT EXECUTION WORKFLOW SYSTEM │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────────────────────────────────────────────────────────┐ │
│ │ /pilot COMMAND │ │
│ │ Entry point for unified workflow execution │ │
│ └──────────────────────────┬───────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────────────────────────────────────────────────────────┐ │
│ │ pilot-execution SKILL │ │
│ │ Reusable skill with 4-phase process definition │ │
│ └──────────────────────────┬───────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────────────────────────────────────────────────────────┐ │
│ │ PILOT-EXECUTION-WORKFLOW DOCUMENT │ │
│ │ Complete workflow specification with diagrams │ │
│ └──────────────────────────┬───────────────────────────────────────┘ │
│ │ │
│ ┌───────────────┼───────────────┐ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ COMMANDS │ │ SKILLS │ │ SCRIPTS │ │
│ │ /orient │ │ moe-task- │ │ session- │ │
│ │ /which │ │ execution │ │ orient.py │ │
│ │ /agent │ │ session- │ │ context- │ │
│ │ /cx, /cxq │ │ logging │ │ db.py │ │
│ │ /session-log│ │ │ │ classify.py │ │
│ │ /classify │ │ │ │ │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────────────────────────────────────────────────────────┐ │
│ │ Track Nomenclature (ADR-054) │ │
│ │ Track A-N nomenclature for task identification │ │
│ └──────────────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────┘
Track-to-Agent Mapping
| Track | Domain | Primary Agent | Fallback Agent |
|---|---|---|---|
| A | Backend API | backend-development | senior-architect |
| B | Frontend UI | frontend-react-typescript-expert | general-purpose |
| C | DevOps | devops-engineer | cloud-architect |
| D | Security | security-specialist | coditect-adr-specialist |
| E | Testing | testing-specialist | codi-qa-specialist |
| F | Documentation | codi-documentation-writer | qa-reviewer |
| G | DMS Integration | prompt-analyzer-specialist | general-purpose |
| H | Framework | senior-architect | orchestrator |
| I | UI Components | frontend-react-typescript-expert | general-purpose |
| J | Memory | senior-architect | memory-context-agent |
| K | Workflow | devops-engineer | general-purpose |
| L | Extended Testing | testing-specialist | general-purpose |
| M | Extended Security | security-specialist | general-purpose |
| N | GTM/Launch | senior-architect | general-purpose |
Execution Modes
| Mode | Description | Human Intervention |
|---|---|---|
| Interactive (default) | Human-guided with agent assistance | Full control |
| Semi-Autonomous | Auto-execute with milestone checkpoints | Approval at milestones |
| Dry-Run | Preview without execution | None (read-only) |
Success Metrics
| Metric | Target | Measurement |
|---|---|---|
| Workflow Adoption | 100% | Sessions using /pilot vs manual |
| Session Log Coverage | 100% | Significant tasks with log entries |
| Context Preservation | 100% | Sessions with /cx capture |
| Classification Rate | 100% | New docs classified |
| Track Completion | Per plan | PILOT plan progress |
Implementation Checklist
- Workflow document (
PILOT-EXECUTION-WORKFLOW.md) - Command (
/pilotincommands/pilot.md) - Skill (
skills/pilot-execution/SKILL.md) - ADR (this document)
- Integration tests
- Update PILOT plan with workflow section
- Update TASKLIST with workflow tasks
- Training documentation
Consequences
Positive
- Unified Execution - Single command orchestrates entire workflow
- Consistent Nomenclature - Track A-N applied systematically
- Complete Audit Trail - Session logs, context capture, checkpoints
- Agent Optimization - Systematic discovery and matching
- Foundation for Autonomy - Structured workflow enables future automation
Negative
- Learning Curve - Users must learn new /pilot command
- Overhead - Additional structure for simple tasks
- Rigidity - Enforced phases may feel constraining
Mitigations
- Aliases -
/pxas shortcut for/pilot - Quick Modes -
--status,--task Xfor simple operations - Skip Options - Allow phase skipping with
--skip-phase
Migration Guide
From Manual Orchestration
Before (Manual):
/orient
/cxq --recent 200
/which heartbeat
/agent backend-development "implement heartbeat"
# ... execute ...
/session-log "heartbeat done"
/cx
After (Unified):
/pilot
# Workflow handles all phases automatically
# Human makes decisions at selection points
Gradual Adoption
- Week 1: Use
/pilot --statusalongside manual workflow - Week 2: Use
/pilotfor new sessions - Week 3: Full adoption, manual commands for edge cases
Related Documents
- ADR-006: Autonomous Orchestration System
- ADR-054: Track Nomenclature
- ADR-116: Track-Based Plan Architecture
- PILOT-EXECUTION-WORKFLOW.md
Decision: APPROVED Date: 2026-01-01 Author: Hal Casteel, Founder/CEO/CTO, AZ1.AI INC Migration: Migrated from cloud-infra per ADR-150 on 2026-02-03