outer-loop-dag-orchestrator
Skill2 starsChanged 18 days agoMITView on GitHub
Orchestrate multi-agent, multi-bounded-context software synthesis DAGs using categorical composition, monoidal parallelization, SOLID agent-coordination invariants, and localized self-healing rollback. Use when decomposing complex epics, multi-service/vertical features, or multi-worktree agent pipelines across Antigravity, Claude Code, and GitHub Copilot.
- Deletes or force-pushes
In this repository12 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- code-gen-dagSkill
- plan-gen-dagSkill
- solid-code-synthesizerSkill
- csharp-conventionsSkill
- jira-conventionsSkill
- observability-conventionsSkill
- outer-loop-dag-orchestratorSkill
- solid-code-synthesizerSkill
- ui-ux-pro-maxSkill
- solid-code-synthesizerSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 32
Every agent node $N_i$ owns a strictly bounded file/directory mutation scope (scope(N_i)), aligned to a single Onion layer or Bounded …
- Very specific: line 33
Verify post-run via python3 scripts/verify-solid-contracts.py --target <worktree> --allowed-scope "<globs>".
- Distinctive: line 39
Never dump unrelated global repository state into inner-loop prompts.
- Very specific: line 55
Run nodes concurrently if and only if they have zero causal dependency and strictly disjoint mutation scopes (scope(A) ∩ scope(B) = ∅), …
- Distinctive: line 66
After parallel branches join, execute both deterministic verifiers in order:
- Very specific: line 77
When a node fails verification (Exit 10, 20, or 30), execute up to maxRetries (default 3) localized repair cycles:
- Very specific: line 80
Dual Rollback ($f^{op}$) on Regression: If a retry introduces *more* diagnostics or corrupts previously passing tests, restore the …
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Outer-Loop Categorical & SOLID DAG Orchestrator
Governs macro-level task decomposition, context projection, parallel dispatch, and localized self-healing across GeoAssets' Tri-Planar Dual-Loop Architecture (Antigravity Control Plane → Claude Code 2A + GitHub Copilot 2B).
- For single-ticket 2-branch worktree execution, invoke
code-gen-dag. - For zero-mutation architectural planning, invoke
plan-gen-dag. - For mathematical axioms (Monoidal Category $(\mathbf{Arch}, \otimes, I)$, Effect Monad $(T, \eta, \mu)$, Dual Rollback $f^{op}$), read
references/categorical-dag-formalism.mdon demand.
Reference Tooling
- Worktree Sandbox Manager:
scripts/agent-sandbox.sh - SOLID & Disjoint-Scope Pre-Flight Oracle:
scripts/verify-solid-contracts.py - 3-Stage Build/Analyzer/Arch Oracle:
scripts/verify-agent-worktree.sh
1. SOLID Invariants for Multi-Agent Coordination
Enforce SOLID as structural execution constraints across every node in the agent DAG:
- Single Responsibility (SRP — Bounded Mutation Scope):
- Every agent node $N_i$ owns a strictly bounded file/directory mutation scope (
scope(N_i)), aligned to a single Onion layer or Bounded Context (core/,providers/,workflow/,ipbilling/,projects/,apps/). - Verify post-run via
python3 scripts/verify-solid-contracts.py --target <worktree> --allowed-scope "<globs>". Out-of-scope file mutations triggerExit 10.
- Every agent node $N_i$ owns a strictly bounded file/directory mutation scope (
- Open / Closed (OCP — Pluggable Subcategories):
- Extend orchestration to new providers, MEF command plugins (
GeoAssets.Plugin.*), or messaging transports (Kafka,ServiceBus) by adding leaf DAG nodes conforming to existing port contracts without mutating core traversal gates.
- Extend orchestration to new providers, MEF command plugins (
- Liskov Substitution (LSP — Runtime & Agent Equivalence):
- Substituting an external headless CLI (
claude,copilot) with a native Antigravity subagent (claude-code-specialist,github-copilot-worker) is valid if and only if the substitute honors identical behavioral postconditions: zero analyzer suppressions, disjoint file scope, andExit 0across both Oracles.
- Substituting an external headless CLI (
- Interface Segregation (ISP — Minimal Context Projection $\pi_k$):
- Never dump unrelated global repository state into inner-loop prompts. Project workspace context down to:
- Exact shared C# 14 type/interface signatures (
namespace, types,TimeProvider,CancellationToken). - Owned target file paths (
[NEW]/[MODIFY]). - Direct upstream port contracts and relevant
.claude/skills/<domain>/SKILL.mdreferences.
- Exact shared C# 14 type/interface signatures (
- Never dump unrelated global repository state into inner-loop prompts. Project workspace context down to:
- Dependency Inversion (DIP — Contract-First Mediation):
- Parallel agents coordinate exclusively through an upfront Shared C# Contract Specification and worktree filesystem artifacts — never by coupling to another agent's internal prompt transcript.
2. Categorical DAG Execution Protocol
Step 1 — Connected-Component Bounded Context Partitioning
- Build the task dependency graph (including Jira
Blockslinks and prose"Depends on <KEY>"references). - Extract Sequential Morphisms ($g \circ f$):
- Whenever node $g$ consumes types or ports authored by node $f$ (e.g.,
core/GeoAssets.Workflowdomain contracts $\to$workflow/GeoAssets.Workflow.EFCore&Restadapters), execute $f$ first and verify its contract postconditions before dispatching $g$.
- Whenever node $g$ consumes types or ports authored by node $f$ (e.g.,
- Extract Monoidal Parallel Branches ($A \otimes B$):
- Run nodes concurrently if and only if they have zero causal dependency and strictly disjoint mutation scopes (
scope(A) ∩ scope(B) = ∅), such as:- Disjoint Bounded Context verticals (e.g.,
GeoAssets.Servercore GIS vs.GeoAssets.IpBilling, enforced byServerArchitectureTests). - Intra-worktree
Branch 2A(production logic) $\otimes$Branch 2B(DTOs,DomainTestDataBuilders, xUnit suites) sharing a frozen upfront C# interface contract.
- Disjoint Bounded Context verticals (e.g.,
- Run nodes concurrently if and only if they have zero causal dependency and strictly disjoint mutation scopes (
Step 2 — Isolated Sandbox Provisioning ($\eta: A \to T(A)$)
- Provision isolated Git worktrees forked strictly from
origin/develop(mainandmasterare permanently forbidden):./scripts/agent-sandbox.sh create <task-id> origin/develop
Step 3 — Dual-Oracle Verification Gate
After parallel branches join, execute both deterministic verifiers in order:
- Fast Structural & Scope Pre-Flight (< 1s):
python3 scripts/verify-solid-contracts.py --target ../worktrees/<task-id> --base origin/develop --scope-a "<2A-globs>" --scope-b "<2B-globs>" --json - Full Compiler, Analyzer & Architecture Oracle:
./scripts/verify-agent-worktree.sh ../worktrees/<task-id>
Step 4 — Localized Self-Healing & Dual Morphism Rewind ($f^{op}$)
When a node fails verification (Exit 10, 20, or 30), execute up to maxRetries (default 3) localized repair cycles:
- Snapshot Before Retry: Capture the worktree state (
git stash createinside../worktrees/<task-id>) before dispatching a repair prompt. - Error Monad Injection: Feed only the structured JSON/diagnostic lines (
verify-solid-contracts.py --jsonorverify-agent-worktree.shsummary) to the specific responsible agent (Exit 10formatting/scope $\to$ Copilot/2B;Exit 20/30analyzer/SOLID/domain $\to$ Claude/2A). - Dual Rollback ($f^{op}$) on Regression: If a retry introduces more diagnostics or corrupts previously passing tests, restore the pre-retry tree snapshot (
git checkout -- ./git reset --hard <snapshot-tree>if uncommitted) rather than compounding broken edits, and refine or escalate. - Topological Merge Serialization: Rebase verified worktrees onto
origin/developin topological order and re-run both Oracles post-rebase before merge preparation.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

