Skip to content

richfrem/agent-plugins-skills / plugins/agent-orchestration/.apm/skills/orchestrating-agent-work

orchestrating-agent-work

Verified

Interactive orchestrator for complex engineering work. Analyzes the task, conducts a diagnostic interview to select the appropriate execution strategy (Directed Acyclic Graph versus Loop, and which Loop type), plans the artifact, and supervises execution and verification. Use for "how should I orchestrate this", "plan this workflow", "should this be a DAG or a loop", "run these jobs in parallel", "delegate this to a worker agent", or "run/resume this graph manifest". Not for single trivial edits or skill self-improvement.

FileKindSize
SKILL.mdskill md6.8 KB
assets/templates/dual-loop-meta-tasks.mdmarkdown1.6 KB
assets/templates/loop_retrospective_template.mdmarkdown1.5 KB
assets/templates/red_team_briefing_template.mdmarkdown747 B
assets/templates/scratchpad-template.mdmarkdown991 B
assets/templates/strategy-packet-template.mdmarkdown1.2 KB
assets/templates/workflow-retrospective-template.mdmarkdown1.3 KB
evals/evals.jsonconfig7.0 KB
references/PATTERN_GUIDE.mdmarkdown6.2 KB
references/acceptance-criteria.mdmarkdown6.8 KB
references/agentic-os-reuse-map.mdmarkdown2.5 KB
references/bot-delegation-patterns.mdmarkdown5.2 KB
references/cheapest_models.jsonconfig845 B
references/cheapest_models.mdmarkdown1.1 KB
references/cli-agent-executor.mdmarkdown3.5 KB
references/delegated-dag-refactoring-playbook.mdmarkdown5.5 KB
references/diagrams/agent_swarm.mmdother1.8 KB
references/diagrams/dual_loop_architecture.mmdother1.4 KB
references/diagrams/graph-planner-flow.mmdother540 B
references/diagrams/graph_execution_state_machine.mmdother823 B
references/diagrams/orchestrating_agent_work_architecture.mmdother4.5 KB
references/dispatch-preflight.mdmarkdown2.1 KB
references/fallback-tree.mdmarkdown9.7 KB
references/graph-execution.mdmarkdown4.1 KB
references/graph-manifest-schema.jsonconfig7.0 KB
references/graph-planning.mdmarkdown3.0 KB
references/learning-loop.mdmarkdown4.9 KB
references/patterns.jsonconfig2.0 KB
references/post_run_survey.mdmarkdown1.4 KB
references/routing-and-closure.mdmarkdown2.4 KB
references/strategy-agent-swarm.mdmarkdown2.1 KB
references/strategy-dual-loop.mdmarkdown1.6 KB
references/strategy-red-team-review.mdmarkdown2.0 KB
references/strategy-selection.mdmarkdown4.0 KB
references/topology-rules.mdmarkdown6.0 KB
scripts/agent_orchestrator.pyscript7.6 KB
scripts/dispatch_guard.pyscript1.1 KB
scripts/graph_runner.pyexecutablescript36.3 KB
scripts/select_strategy.pyscript13.1 KB
scripts/swarm_run.pyscript28.0 KB
scripts/validate_manifest.pyexecutablescript19.8 KB
scripts/work_loop.pyscript28.0 KB
tests/_loop_fixtures.pyscript2.5 KB
tests/test_graph_fixes.pyscript12.6 KB
tests/test_graph_runner.pyscript30.0 KB
tests/test_isolation.pyscript3.5 KB
tests/test_loop_strategies.pyscript7.7 KB
tests/test_select_strategy.pyscript7.8 KB
tests/test_swarm_run.pyscript9.4 KB
tests/test_swarm_run_models.pyscript3.1 KB
tests/test_validate_manifest.pyscript18.1 KB
tests/test_work_loop_e2e.pyscript3.8 KB
tests/test_work_loop_hardening.pyscript27.3 KB

references/routing-and-closure.md

View on GitHub
# Routing, delegation and closure

Assesses incoming tasks, routes to specialized execution patterns, and enforces verification and closure.

## Constraints

- **Trust but verify**: Never blindly trust sub-agent outputs; mechanically run automated tests.

- **Inner loop isolation**: Inner Loop agents are strictly forbidden from running `git` commands.

- **Background execution**: Always redirect stdin (`< /dev/null`) when spawning sub-agents.

- **Zero autonomous merge**: Merging and pushing are strictly caller-managed. The orchestrator halts after verification and retrospective.

## Quick start

```bash
# Generate strategy packet for delegation
python3 scripts/agent_orchestrator.py packet --wp 001 --spec-dir handoffs
```

## Routing Decision Table

| Signal | Pattern | Follow |
|---|---|---|
| Security review, architecture decision, high risk | Adversarial Critique | [strategy-red-team-review.md](strategy-red-team-review.md) |
| Bounded code implementation, bug fix | Supervisor / Worker | [strategy-dual-loop.md](strategy-dual-loop.md) |
| Bulk migration, 10+ independent partitioned jobs | Parallel Swarm | [strategy-agent-swarm.md](strategy-agent-swarm.md) |
| Structural dependencies, parallel fan-out joined at barriers | Graph | [graph-planning.md](graph-planning.md), then [graph-execution.md](graph-execution.md) |
| GUI computer-use, telephony, external SaaS/commerce, deep research | Asynchronous Bot Handoff | [bot-delegation-patterns.md](bot-delegation-patterns.md) |
| Ambiguous routing, topology comparison | Decision Tree | strategy selection ([strategy-selection.md](strategy-selection.md)) |

## Workflow

1. **Assess & Route**: Match incoming signal against the Routing Decision Table.

2. **Package**: Author Task Packet via `agent_orchestrator.py packet`. For graph workflows, mandate compilation of `graph-manifest.json` via graph planning ([graph-planning.md](graph-planning.md)).

3. **Dispatch**: Dispatch inner worker into isolated worktree with stdin redirection (`< /dev/null`).

4. **Supervised Verify**: Audit diff and run tests via `agent_orchestrator.py verify`.

5. **Close & Retro**: Run `agent_orchestrator.py retro`. Stop after recording retrospective. Caller performs review, merge, and deployment.

## Verification

```bash
# Verify worker execution results
python3 scripts/agent_orchestrator.py verify --packet handoffs/task_packet_001.md --worktree .
# Ensure tests pass
pytest
```
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall