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/acceptance-criteria.md

View on GitHub
# Acceptance Criteria: orchestrating-agent-work

## Strategy selection
- [ ] Known dimensions are derived from the caller's brief; at most 4 diagnostic questions, one per turn, each with a recommended option.
- [ ] `scripts/select_strategy.py` makes the selection deterministically from the answers.
- [ ] The decision is written to `select-loop-strategy-decision.json` (and `.md`) in the task directory, confirmed or overridden by the human, with any override recorded.
- [ ] Selection never starts execution by itself; it names the next step and its input path.

## Routing and closure
To pass Open Standard certification, the `agent-orchestrator` plugin must dynamically instantiate hierarchical loops independently of global `.agents/` state tracking directories.

### Core Rules
1. Must natively execute the `./agent_orchestrator.py` script directly without legacy slash-command wrappers.
2. Must not assume the existence of external branch dependencies or global templates.
3. Must generate `handoffs/` and `retros/` dynamically in the active Project Runtime.
4. Orchestrator must be able to act autonomously to verify output against provided prompt packets utilizing the `verify` command.

## Dual-loop
### 1. Strategy Packet Fidelity
- [ ] Outer Loop ALWAYS generates an explicit, written markdown Strategy Packet containing constraints, file paths, and the "NO GIT" mandate before delegating.
- [ ] The Inner Loop is only fed the packet and necessary files, drastically isolating its context window.

### 2. Anti-Simulation Checks
- [ ] Outer Loop NEVER marks a task "Done" without manually checking the file deltas and mechanically running lint/test commands.
- [ ] "Assume it works" behavior results in an immediate audit failure.

### 3. Structured Correction
- [ ] Failed verifications are NEVER manually patched by the Outer Loop without feedback, unless tagged as `MINOR` (naming/style).
- [ ] Critical and Moderate failures are routed back to the Inner Loop via structured Markdown Correction Packets citing the exact failure logs.

## Agent swarm
### 1. Execution Boundary Constraints
- [ ] Orchestrator does NOT execute the payload commands itself. It strictly maps the jobs and invokes `../scripts/swarm_run.py`.
- [ ] The swarm partition strategy ensures that no two workers are modifying the same source code file simultaneously.

### 2. Resiliency & Scale
- [ ] The orchestrator implements the `--resume` flag on large batches to protect against partial system failures.
- [ ] The orchestrator strictly limits Copilot workers to `2` to prevent throttling, while allowing higher limits for Gemini/Claude.

### 3. Protocol Fidelity
- [ ] Target logic relies purely on injected shell post-commands and input passing without depending on the sub-agents having complex filesystem context.

## Graph planning
### 1. Trigger Verification
- [ ] Triggers on requests to design, architect, or compile a multi-step DAG, execution graph, or `graph-manifest.json`.
- [ ] Does **not** trigger for executing an existing manifest (that is graph execution ([graph-execution.md](graph-execution.md))), single-file fixes, or strategy selection (strategy selection ([strategy-selection.md](strategy-selection.md))).

### 2. Interview Discipline
- [ ] Reads caller briefs, specs, and any `--decision <path>` record before asking questions.
- [ ] Asks only about unresolved topology gaps: fan-out candidates, join barriers, verifier scripts, mutation targets, failure escalation.

### 3. Manifest Correctness
- [ ] Manifest passes `python3 scripts/validate_manifest.py <manifest>` with zero errors.
- [ ] Manifests intended for `--approval none` also pass with `--check-approval-none`.
- [ ] Every `command_or_eval` is an executable shell command (model tiers are invoked through a CLI inside the command, never as a bare prompt).
- [ ] Every `sequential_mutation` declares `mutation_targets`; no bare `*` or `**` targets.
- [ ] Mutations form one linear chain; fallbacks have the same type as their primary and the same preceding mutations.
- [ ] External or irreversible actions set `reversible: false` and depend on the approval gate.
- [ ] `verifier_hash` values are computed from the script file named in the command (or the command string when it names no file).

### 4. Handoff
- [ ] A Mermaid diagram of the DAG is presented alongside the manifest.
- [ ] Handoff states the manifest SHA256 for `--expect-manifest-sha256` and the intended `--approval` mode and workspace flag.

## Graph execution
### 1. Trigger Verification
- [ ] Triggers on requests to run, execute, or resume a compiled `graph-manifest.json`.
- [ ] Does **not** trigger for designing a new graph (that is graph planning ([graph-planning.md](graph-planning.md))), single-agent delegation, or swarm batch jobs.

### 2. Startup Gates
- [ ] Runner validates schema and topology before any node executes; invalid manifests exit 1 with no side effects.
- [ ] Mutation or irreversible graphs under `--approval none` require `--expect-manifest-sha256` and a leading `role: "approval"` verifier gate.
- [ ] Mutation graphs refuse `--no-workspace` and run only in `--worktree` / `--create-worktree` with a clean tree.

### 3. Execution Invariants
- [ ] Parallel reads never change HEAD or `git status`; any change fails the batch.
- [ ] Mutations run one at a time, touch only `mutation_targets`, never `forbidden_paths`, and never self-commit.
- [ ] The runner commits once per mutation that changed files; a no-op mutation succeeds without a commit.
- [ ] `verifier_hash` mismatches fail the node before it runs.

### 4. Failure Handling
- [ ] Retries reset mutation debris to the node's pre-run HEAD.
- [ ] Fallbacks run only when their own dependencies are complete and are recorded in `state.json` as `substituted_nodes`.
- [ ] Worktree runs roll back to the start SHA on unrecovered failure; `--no-workspace` runs halt without touching the checkout.

### 5. Evidence
- [ ] `receipts.jsonl` holds one line per attempt and survives rollback (anchored in `<git-common-dir>/graph-run/`).
- [ ] `state.json` records terminal status: `success`, `rolled_back`, or `halted`.
- [ ] The runner never pushes, merges, or deletes worktrees.

## Red-team review
### 1. Bundle Discipline
- [ ] Agent relies entirely on `bundling-context` and `manifest.json` to compile review packets, rather than manually `cat`ing files into prompts.
- [ ] Packets always include an explicit "Prompt" guiding the reviewer's focus.

### 2. Iteration Mandate
- [ ] Agent automatically parses the reviewer's verdict and correctly triggers the next loop iteration (Research vs Approval) based on that verdict.
- [ ] Agent refuses to manually override a negative or pending verdict to force an approval.

### 3. Delegation Limits
- [ ] As a specialized loop, it only manages the review cycle. It does not execute the actual implementation or dictate global repo state updates post-approval.
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: 472kUpdated 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