AH
Ali Hasan
← Back to Agentic AI Architecture
Meta-Orchestrator Workflow Engine Role: Lifecycle Manager

orchestrate-flow

Autonomous Skill Graph & Multi-Agent Lifecycle Orchestrator

$ invoke_subagent('orchestrate-flow')
Trigger Scenarios (When Needed)
  • When executing an entire software development lifecycle autonomously from idea to production-grade code.
  • When coordinating multiple specialized skills (planning, issue generation, implementation, deep research, and code review) into a unified graph.
  • When managing parallel subagents working across independent GitHub issues without context pollution.
  • When automated rollback and persistent state tracking (revert-on-failure) are required across multi-step agent actions.
Activation & Guardrails

Trigger: Manual activation only (`invoke_subagent('orchestrate-flow')`). Never triggered autonomously without explicit user instruction.

Execution Rules:
Must assess existing project state before execution (verifies plan.md, features.md, issues-graph.json, and progress.json).
Subagents must receive strictly bounded context budgets (max 200k tokens for issue agents, 100k for research/review).
Never auto-execute destructive file operations or Git force-pushes without confirmation.
Example Prompt: "Orchestrate the development flow for our new microservice feature."
Technical Architecture & Data Contracts
Execution Pattern

Directed Acyclic Skill Graph (DAG) with Dynamic Subagent Spawning

Context Budget

Zero token budget for the deterministic Python graph traverser; 200k tokens per issue agent; 100k for research subagents.

State Management

JSON adjacency list (issues-graph.json) with deterministic progress logging in progress.json and Git commit rollbacks.

Input Contracts
User High-Level Intent & Scoping Constraints Repository Codebase & Configuration Files Execution Graph & State Manifests (progress.json)
Output Contracts
Fully Implemented, Tested, and Verified Codebase docs/plan/issues/progress.json (Execution Trail) Automated Architecture & Code Review Artifacts
Bundled Scripts & Reference Resources

Reference Specifications (`references/`)

skill-graph.md Architecture Specification

Defines the full skill dependency graph, node roles (root, mid, leaf, support), and edge data flows.

routing-rules.md Routing Protocol

Contains deterministic decision trees routing user requests to the optimal entry point in the skill graph.

execution-model.md Execution Framework

Specifies the multi-agent execution model, context budgeting, subagent isolation, and error handling.

data-flow-matrix.md Data Contract

Detailed input-output matrix detailing exactly how artifacts flow between consecutive skill nodes.

skill-registry.md Registry

Comprehensive registry of all registered sub-skills, trigger criteria, and capabilities.

Executive Overview

In real-world software engineering, naive monolithic AI prompts fail as systems scale: single-prompt contexts overflow, hallucinations compound, and debugging automated changes becomes impossible.

orchestrate-flow is an autonomous meta-skill designed to treat the entire software development lifecycle as a Directed Acyclic Graph (DAG) of specialized subagents. Instead of asking a single model instance to write an entire system, orchestrate-flow coordinates specialized skill nodes:

[hunt-feature / navigate-compass]  --> Strategy & Architectural Planning

        [split-plan]              --> Plan to GitHub Issue DAG Compilation

       [execute-issues]           --> Deterministic Python Traversal Engine
         ↙    ↓    ↘
   [Subagent] [Subagent] [Subagent]  --> Layer 0 / Layer 1 Issue Execution
      ↓            ↓
  [dig-deep]   [elevate-code]     --> On-Demand Research & Quality Gatekeeping

The 4-Node Skill Graph Topology

The orchestration graph models development stages as distinct node types with explicit data dependencies:

1. Root Nodes (Strategy & Planning)

  • navigate-compass: Conducts adaptive consultant interviews to map user intent, technical constraints, and data models into docs/plan/plan.md and plan-graph.json.
  • hunt-feature: Can run independently or pre-flight planning, scanning repository gaps and job postings to recommend the top 5 high-impact features.

2. Mid Node (Decomposition & Compilation)

  • split-plan: Consumes docs/plan/plan.md, analyzes task complexity, and compiles the plan into actionable, self-contained GitHub issues with topological layers.

3. Leaf Node (Execution & State Machine)

  • execute-issues: A deterministic Python engine that traverses the issue DAG layer by layer, launching isolated subagents per issue.

4. Support Nodes (On-Demand Lifecycle Subagents)

  • dig-deep: Spawned when an executing agent encounters an architectural unknown or requires library validation across >=5 authoritative sources.
  • elevate-code: Triggered as a quality gatekeeper before commits, checking SOLID design patterns and clean code principles.

Subagent Context Budget & Resource Isolation

To guarantee predictable reasoning and eliminate cross-task context contamination, orchestrate-flow enforces strict context budgets:

Agent RoleMax Token BudgetContext ScopeError Protocol
Python Orchestrator0 tokens (Deterministic)issues-graph.json, progress.jsonReverts Git commit on failure
Issue Worker Agent200,000 tokensIssue spec, relevant source files, prerequisite outputsRetries once, then flags issue
Research Subagent100,000 tokensResearch query, search results, official documentationFlags consensus gaps
Review Subagent100,000 tokensGit diff, clean code checklist, security rulesFails build on [MUST-FIX]

Interruption & State Recovery

orchestrate-flow is resilient to developer interruptions:

  • If paused or canceled, all completed issue states are committed and saved in docs/plan/issues/progress.json.
  • Upon resumption, the engine scans the repository state, reconciles completed Git commits against the DAG, and resumes from the exact incomplete topological layer without re-executing completed work.