agentleFS
yuniorsfyuniorsf/GeoAssets/.claude/skills/outer-loop-dag-orchestrator/SKILL.md

outer-loop-dag-orchestrator

Skill2 starsChanged 18 days agoMITView on GitHub

Coordinate multi-agent subagents and parallel Jira/feature worktrees in Claude Code using categorical DAG composition, monoidal disjoint-scope parallelization, ISP context projection, and localized self-healing rollback. Use when spawning multiple Claude subagents, decomposing multi-layer epics, or running /orchestrate-tickets.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 0 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    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
  1. Very specific:

    Branch Baseline: Every worktree or branch must originate from origin/develop.

    line 17
  2. Very specific:

    If task $g$ depends on contracts, entities, or migrations created by task $f$, never launch $f$ and $g$ concurrently in separate worktrees.

    line 28
  3. Very specific:

    When verify-solid-contracts.py or verify-agent-worktree.sh exits non-zero (10, 20, or 30):

    line 51
  4. Very specific:

    Rewind ($f^{op}$) on Non-Convergence: If a retry increases diagnostic count or breaks passing tests, restore $SNAP (git checkout -- .

    line 58
  5. Very specific:

    Post-Rebase Re-Verification: After git fetch origin develop && git rebase origin/develop, always re-run ./scripts/verify-agent-worktree.sh …

    line 59

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Claude Code Outer-Loop DAG Orchestrator

Applies categorical composition ($g \circ f$), monoidal parallelization ($A \otimes B$), and SOLID agent-coordination invariants whenever Claude Code decomposes work across parallel subagents (.claude/agents/* or Agent tool with isolation: "worktree").

Tooling & Policy Guardrails

  • Branch Baseline: Every worktree or branch must originate from origin/develop. Never branch from, rebase onto, or touch main or master (CLAUDE.md § Branching & Release Policy).
  • Worktree Sandbox: scripts/agent-sandbox.sh or Claude isolation: "worktree" (.claude/worktrees/<id>).
  • SOLID & Scope Pre-Flight: scripts/verify-solid-contracts.py
  • 3-Stage Build/Analyzer/Arch Oracle: scripts/verify-agent-worktree.sh

1. Categorical Decomposition Rules

  1. Sequential Composition ($g \circ f$):
    • Inspect both formal Jira Blocks links and prose "Depends on <TICKET-KEY>" notes.
    • If task $g$ depends on contracts, entities, or migrations created by task $f$, never launch $f$ and $g$ concurrently in separate worktrees. Synthesize and verify $f$ first (core/ ports before providers/ / workflow/ adapters).
  2. Monoidal Parallelization ($A \otimes B$):
    • Spawn parallel workers (<= 5 concurrent workers by default) only when tasks have zero causal dependency and strictly disjoint mutation scopes (scope(A) ∩ scope(B) = ∅), e.g., independent Bounded Context verticals (GeoAssets.Server vs. GeoAssets.IpBilling) or production domain logic vs. disjoint test/DTO scaffolding against a frozen C# 14 interface contract.

2. SOLID Agent-Coordination Invariants

  • SRP (Bounded Mutation Scope): Assign each subagent an explicit list of allowed path prefixes/files (--allowed-scope). Verify post-execution via:
    python3 scripts/verify-solid-contracts.py --target <worktree> --allowed-scope "<csv-globs>"
  • ISP (Minimal Context Projection $\pi_k$): Strip unrelated codebase context from subagent prompts. Provide only:
    1. Target C# 14 interface/record contracts (TimeProvider, CancellationToken signatures).
    2. Assigned [NEW] / [MODIFY] paths.
    3. Relevant domain skill references (csharp-conventions, observability-conventions, jira-conventions).
  • LSP (Behavioral Subagent Equivalence): Any persona subagent (ticket-worker, arch-designer, test-agent) must satisfy the same postcondition gate: zero #pragma warning disable / [SuppressMessage] / <NoWarn>, Exit 0 from verify-solid-contracts.py, and Exit 0 from verify-agent-worktree.sh.
  • DIP (Contract Mediation): Subagents coordinate solely via upfront C# interface contracts and verified Git commits/diffs — never via implicit assumptions about sibling agent internals.

3. Localized Self-Healing & Dual Rollback ($f^{op}$)

When verify-solid-contracts.py or verify-agent-worktree.sh exits non-zero (10, 20, or 30):

  1. Checkpoint Before Retry: Record SNAP=$(git -C <worktree> stash create) before each self-healing pass (max 3 retries).
  2. Targeted Error-Monad Routing:
    • Exit 10 (Formatting / .razor.cs split / scope drift) $\rightarrow$ Run dotnet format style GeoAssets.sln or split inline @code into .razor.cs.
    • Exit 20 (Roslyn / AsyncFixer / Meziantou / RS0030) $\rightarrow$ Inject System.TimeProvider, propagate CancellationToken, remove blocking calls without suppressing warnings.
    • Exit 30 (Onion layer leak / NotImplementedException / failed xUnit or ArchitectureTests) $\rightarrow$ Move infrastructure dependencies behind core/ ports and repair domain invariants.
  3. Rewind ($f^{op}$) on Non-Convergence: If a retry increases diagnostic count or breaks passing tests, restore $SNAP (git checkout -- . + git stash apply $SNAP) rather than stacking broken edits, and escalate after 3 attempts.
  4. Post-Rebase Re-Verification: After git fetch origin develop && git rebase origin/develop, always re-run ./scripts/verify-agent-worktree.sh and dotnet test in the worktree — never trust pre-rebase green results.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.