Skip to content
Ali Hasan
← Back to coding-agent specs

SKILL.md spec for a coding agent — a prompt pack, not a shipped product.

Meta-Orchestrator Workflow Engine Role: Lifecycle Manager

orchestrate-flow

Coordinates plan, issues, implementation, and review as a skill graph

$ invoke_subagent('orchestrate-flow')

The zip contains SKILL.md, the reference notes, and the scripts. Unzip it into the folder your agent loads skills from. For Grok, that is ~/.grok/skills/. Keep the folder name so SKILL.md stays at the top of that folder, then start a new chat and use the command above.

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 progress.json must survive a stopped chat so a later run can continue unfinished issues.
Activation & Guardrails

Trigger: Manual activation only (`invoke_subagent('orchestrate-flow')`). Never triggered autonomously without explicit user instruction. One named issue is execute-issues.

Execution Rules:
• Must assess existing project state before execution (verifies plan.md, features.md, issues-graph.json, and progress.json).
• After a job finishes, hand off when reported context use passes the earlier of 40% of that run's window and 250,000 tokens. No file-size estimate, and no stop before the job finishes.
• Never force-push, reset main, or delete uncommitted work.
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

Handoff at the earlier of 40% of the reported window and 250,000 tokens. The run's own usage report is the measurement.

State Management

issues-graph.json is the DAG. progress.json and progress/<id>.md are the memory a fresh run reads.

Input Contracts
User High-Level Intent & Scoping Constraints Repository Codebase & Configuration Files Execution Graph & State Manifests (progress.json)
Output Contracts
Code and review artifacts from the agent run (only if you let it write) 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

Pool, phases, and the commands that advance every ready issue.

memory.md Memory

Handoff shape and the context rule shared with execute-issues.

data-flow-matrix.md Data Contract

Which file each skill writes, and who reads it next.

roles.md Roles

Tester, implementer, reviewer, and elevator. Commit shape lives here.

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
              ↓
       [orchestrate-flow]         --> Every ready issue, layer by layer
       [execute-issues]           --> One named issue, same phase scripts
         ↙    ↓    ↘
   [Tester] [Implementer] [Reviewer] --> One phase at a time, fresh chat
      ↓            ↓
  [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: Reads the repo against a gap checklist and cites docs and engineering blogs. A job ad can illustrate hiring language. It is not a source the skill scans.

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. Execution

  • orchestrate-flow: Walks every ready issue. progress.py next chooses the work.
  • execute-issues: The same phase scripts for one id. It does not call next. Dependencies must already be accepted.

4. Support Nodes (On-Demand Lifecycle Subagents)

  • dig-deep: Runs in this conversation when a worker handoff says BLOCKED:.
  • elevate-code: An optional pool slot, requested at pool init. In auto-apply it commits each finding on its own. It is not a check before every commit.

Context handoff

The skill does not estimate file size, and it does not stop a job before the job finishes. After the job, it uses the context use that run reports.

Hand off when that use passes the earlier of:

  • 40% of the reported window. Coding-agent sessions start dropping instructions from the start of the chat around there. The line moves with the task. It is not a fixed 10% or 20% slice.
  • 250,000 tokens. Measured task quality drops at that length, including answers pulled from an earlier turn. On a million-token window, length rot is already visible around 300,000 to 400,000, so the cap stops the 40% line from waiting until 400,000.

A 200,000 token window hands off at 80,000. A 1,000,000 token window hands off at 250,000. If the run reports use but not a window, the window is context_tokens in pool.json. If it reports neither, the work continues.

Past the line, progress/<id>.md is the handoff. The chat stops. The same skill starts again and reads progress.json. Accepted issues stay accepted.

Each planning node, the tester’s tests, and each implementer sub-task is its own commit. The message has a subject, How, and Why. Those commits are not squashed and not rolled back.


Interruption & State Recovery

  • Completed issue states are saved in docs/plan/issues/progress.json by progress.py.
  • A later run reads that file and continues unfinished phases. It does not redo an accepted issue.