richfrem/agent-plugins-skills / plugins/agent-orchestration/.apm/skills/orchestrating-agent-work
orchestrating-agent-work
VerifiedInteractive 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.
references/strategy-selection.md
View on GitHub# Strategy selection (diagnostic interview + deterministic selector)
Interactive front door for choosing an execution topology and compiling a structured decision record before planning begins.
## Constraints
- **Governance Orthogonal**: Human approvals and worktree confinement wrap all patterns identically. Never ask about approval or rollback (those belong to caller governance).
- **Pattern-Owned Plan Artifacts**: Each pattern produces its own native artifact (`graph` -> `graph-manifest.json`, `dual-loop` -> `task_packet_*.md`, `swarm` -> `*.job.md`).
- **Read-Only DAGs Valid**: Structural fan-out with join barriers and zero mutations qualifies for graph routing.
- **Stand-alone Independence**: Zero dependencies on external plugins or control plane code.
## Quick start
```bash
# Non-interactive evaluation with answers
python3 scripts/select_strategy.py --answers '{"unit_structure":"one_bounded","ordering_convergence":"none","assurance_need":"normal"}'
# Interactive pattern selection with task-scoped output
python3 scripts/select_strategy.py --out docs/plans/work-tasks/my-task/
```
## Workflow
1. **Context First**:
Read caller-supplied brief, spec, plan, or diagnostic files. Derive answers for known dimensions from explicit requirements; ask only about unresolved dimensions.
2. **Diagnostic Interview (Max 3 Questions, 1 per turn)**:
- **Unit structure**: minimal direct change | one bounded change | distinct steps with dependencies | many identical independent units
- **Ordering/convergence**: none | results must merge at a barrier | ordered mutations with gates between them
- **Assurance need**: normal | adversarial review required (security/architecture)
Each question presents structured options with a recommended default (`Option A [Recommended]`).
3. **Deterministic Selection**:
Execute `scripts/select_strategy.py` with gathered answers. The script determines the topology based on explicit rules:
- Many identical independent units -> `agent-swarm`
- Distinct steps + barrier or ordered mutations -> `graph`
- One bounded change -> `dual-loop`
- Minimal direct edit -> `direct`
- Adversarial assurance -> `red-team-review` (wrapper modifier; [strategy-red-team-review.md](strategy-red-team-review.md))
Open-ended research and self-improvement are out of scope here; use agent-agentic-os (`os-lab`).
4. **Confirm & Record Decision**:
Write `select-loop-strategy-decision.json` (and `.md`) to the task directory (via `--out docs/plans/work-tasks/<task-id>/`). Present the decision to the human to confirm or override. Record any requested override in the decision artifact.
5. **Hand Off**:
Name the next step (`next_step` in the result, a reference in this skill) with its input path (e.g. [graph-planning.md](graph-planning.md) with `--decision docs/plans/work-tasks/<task-id>/select-loop-strategy-decision.json`). Do not invoke downstream execution automatically.
## Pattern Comparison
| Pattern | Planner / Dispatcher | Executor | Plan Artifact | Primary Use Case |
|---|---|---|---|---|
| **Graph** | graph planning ([graph-planning.md](graph-planning.md)) | graph execution ([graph-execution.md](graph-execution.md)) | `graph-manifest.json` | Fan-out reads, sync barriers, ordered mutations |
| **Dual-Loop** | `agent_orchestrator.py packet` | [strategy-dual-loop.md](strategy-dual-loop.md) | `handoffs/task_packet_*.md` | Bounded bug fixes, localized feature coding |
| **Swarm** | `swarm_run.py --dry-run` | [strategy-agent-swarm.md](strategy-agent-swarm.md) | `*.job.md` | Batch conversions, mass refactors across files |
| **Adversarial** | [strategy-red-team-review.md](strategy-red-team-review.md) | cli-agent persona dispatch | Review brief | Security audits, architecture stress-testing |
| **Async Bot Handoff** | [bot-delegation-patterns.md](bot-delegation-patterns.md) | Asynchronous Cloud/Web VM | Task brief / PR / Webhook | GUI computer-use, telephony, SaaS triage, multimodal research |
## Verification
```bash
# Run strategy selection tests
pytest tests/test_select_strategy.py -v
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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: 471k | Updated | Claude CodeCodex | Verified | Install |
| 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: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| 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 available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |