Author SHA1 Message Date
Defame1297andClaude Opus 5.5 a67096ea67 docs(research): agent team structures and stage-lead-per-session model
Survey orchestrator/role relationships across vendors, verify nested
subagent support per runtime, and evaluate intra-stage function
specialists and a per-stage-session model for holocron#170.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012CqgnwEGtmfsjcoG9QwByN
2026-11-13 14:37:02 +00:00
Defame1297 c99ac96c4d Merge pull request 'docs(agents): map wayfinding operations onto Gitea' (#174) from docs/wayfinding-operations into main
Reviewed-on: Defame1297/holocron#174
2026-11-12 20:31:50 +00:00
Defame1297andClaude Opus 5.5 5e090b82aa docs(agents): express wayfinder labels as Wayfinder/* scoped labels
Matches the repo's Scope/Value label convention and lets Gitea treat
the ticket types as one exclusive scope.

Refs: #166
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012CqgnwEGtmfsjcoG9QwByN
2026-11-12 18:09:02 +00:00
Defame1297andClaude Opus 5.5 4000b9e944 docs(agents): map wayfinding operations onto Gitea
Gitea has native issue dependencies but no sub-issues, so a wayfinder
map pairs its issue with a same-titled milestone and children carry a
"Part of #<map>" line.

Refs: #166
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012CqgnwEGtmfsjcoG9QwByN
2026-11-12 18:06:38 +00:00
3 changed files with 314 additions and 244 deletions

No files matched your search

+12
View File
@@ -16,6 +16,18 @@ Use the plugin skills, which wrap the Gitea MCP tools (`mcp__gitea__*`); do not
- Apply triage state with the `Status/*` labels mapped in `docs/agents/triage-labels.md`.
- "Publish to the issue tracker" means create a Gitea issue; "fetch the relevant ticket" means read it with `gitea-issues`.
## Wayfinding operations
How the `wayfinder` skill's map and tickets map onto Gitea, which has native issue dependencies but no sub-issues.
- **Labels**: the skill's `wayfinder:<x>` labels are expressed as the Gitea scoped labels `Wayfinder/<X>`, matching the repo's `Scope/Value` convention: `wayfinder:map` is `Wayfinder/Map`, `wayfinder:research` is `Wayfinder/Research`, and so on.
- **Map**: an issue labelled `Wayfinder/Map`, paired with a milestone of the same title (`Map: <name>`).
- **Child ticket**: an issue whose body starts with `Part of #<map>`, assigned to the map's milestone, carrying exactly one type label (`Wayfinder/Research`, `Wayfinder/Prototype`, `Wayfinder/Grilling`, `Wayfinder/Task`) and no `Status/*` label.
- **Blocking**: Gitea's native issue dependencies (`issue_write` `add_dependency`, `dependency_type: blocked_by`).
- **Claim**: assign the ticket to the dev driving the map before any work.
- **Frontier query**: open issues in the map's milestone with no assignee, then drop any whose `get_blocked_by` lists an open issue.
- **Research findings**: committed on a `research/<name>` branch that is pushed but never merged; the ticket's resolution comment links it.
## PRs as a request surface
Off. Only issues feed the triage queue; PRs are not triaged as requests.
@@ -1,244 +0,0 @@
# Existing published infra skills: depend, adapt, or author
**Question (#169, part of map #166):** What published, reusable agent skills, agents, rule sets and
MCP servers already exist for Ansible (playbooks, collections, ansible-lint, Molecule), Flux /
Kustomize / Helm GitOps, Kubernetes troubleshooting, and OpenTofu/Terraform? For each, what are the
quality, licence, maintenance and format? Should holocron **depend** on it (as with `mattpocock`),
**vendor/adapt** it, or **author** its own?
**Researched:** 2026-11-12. Licence, star counts, last push and tags come from the GitHub REST API
(`/repos/{owner}/{repo}` and `/tags`) on that date. Skill format comes from the raw `SKILL.md`
frontmatter. Other facts come from the vendor page cited next to them.
**Constraint applied:** target packages must be generic and provider-agnostic. The target stack is an
Ansible playbook monorepo, an Ansible Galaxy collection tested with Molecule, Flux (Kustomize and
HelmRelease) with Sealed Secrets, and OpenTofu later.
## Answer
| Area | Best existing candidate | Licence | Recommendation |
|---|---|---|---|
| Flux / Kustomize / Helm GitOps | `fluxcd/agent-skills` (official) | Apache-2.0 | **Depend**, pinned. **Author** a thin Sealed Secrets and house-conventions skill on top. |
| Ansible (playbooks, collections, lint, Molecule) | `ansible-community/ai-forge` (community) | **GPL-3.0-or-later** | **Author our own.** Do not depend on or adapt ai-forge, because of the copyleft licence and its stated instability. |
| Kubernetes troubleshooting | No official skill. MCP: `containers/kubernetes-mcp-server` | Apache-2.0 | **Author** one thin skill. The MCP server is an optional companion, and declaring it needs its own decision. |
| OpenTofu / Terraform | `antonbabenko/terraform-skill`; `hashicorp/agent-skills` | Apache-2.0; **MPL-2.0** | **Defer** until OpenTofu work starts. Then **depend** on `antonbabenko/terraform-skill`, pinned. Do not adopt HashiCorp's set wholesale. |
**apm-installable** below means that `SKILL.md` directories sit at a stable repo subpath and the repo
has git tags. That is the same shape apm already resolves for
`mattpocock/skills/skills/engineering/<skill>#v1.3.2` in `plugins/mattpocock/apm.yml`. I inferred
this from the layout and **did not run `apm install` against any of these repos**.
## Flux / Kustomize / Helm GitOps
### `fluxcd/agent-skills`: official, recommended to depend
- **Source:** <https://github.com/fluxcd/agent-skills>; documented at <https://fluxcd.io/flux/agent-skills/>
(v2.10 docs, last modified 2026-07-02).
- **Licence:** Apache-2.0 (GitHub API). Each `SKILL.md` also declares `license: Apache-2.0`.
- **Maintenance:** Last push on 2026-11-03. Tags `v0.0.4` through `v0.4.0`, so it is still pre-1.0 and
breaking changes are possible. 244 stars. The repo ships `tests/` and `benchmarks/` directories.
- **Format:** Agent Skills `SKILL.md` under `skills/<name>/`, with `name`, `description`, `license`
and `compatibility` frontmatter. It also ships Claude Code, Codex and Copilot plugin manifests, and
a cosign-signed OCI artifact installed with `flux operator skills install ghcr.io/fluxcd/agent-skills`.
It is apm-installable by subpath, for example `fluxcd/agent-skills/skills/gitops-knowledge#v0.4.0`
(inferred, see above).
- **Skills** (per fluxcd.io):
- `gitops-knowledge`: Flux CRD YAML generation, checked against bundled OpenAPI schemas and validated
with `flux-schema`.
- `gitops-repo-audit`: an offline audit of a GitOps repo in six phases. It runs deterministic tools:
`flux schema` and `flux migrate --dry-run`.
- `gitops-cluster-debug`: live HelmRelease and Kustomization troubleshooting through the Flux MCP
server.
- **Required tools:** `flux` ≥ v2.10, `flux-schema`, `kustomize` or `kubectl`, and `flux-operator-mcp`
for the debug skill. The debug skill declares `compatibility: Requires flux-operator-mcp v0.60 or later`.
- **Gaps for our stack:**
- **Sealed Secrets is not mentioned.** `gitops-repo-audit` checks only "SOPS, External Secrets", and
`gitops-cluster-debug` special-cases SOPS. I grepped all three `SKILL.md` files for
`sealed|sops`.
- It covers Flux `Kustomization` resources. Plain Kustomize overlays and `HelmRelease` are covered
only as Flux sees them.
- **Copyleft flag:** `flux-operator-mcp` is built from `controlplaneio-fluxcd/flux-operator`, which is
**AGPL-3.0** (LICENSE file and GitHub API). The skills themselves are Apache-2.0. Running the MCP
binary unmodified as a local tool should not put obligations on holocron's own content, because AGPL
obligations attach to modifying and conveying, or network-serving, the program. **I'm not certain of
that, and it is not legal advice.** Do not vendor or patch that binary.
- **Open question:** fluxoperator.dev describes the MCP server as connecting to "clusters running Flux
Operator". If the target clusters run plain `flux bootstrap` without Flux Operator,
`gitops-cluster-debug` may be only partly usable. Not verified.
- **Recommendation:** **Depend**, through a wrapper plugin like `plugins/mattpocock`, pinned to a tag.
It is official, permissively licensed, tested, and grounded in deterministic tools. **Author** one
small skill for Sealed Secrets (kubeseal workflow, which `SealedSecret` scope to use, rotation) and
our repo layout conventions. Pin and bump it deliberately, because the project is pre-1.0.
### Flux MCP servers
- **Flux MCP server** (`flux-operator-mcp`): Go binary with a `--read-only` mode that masks Secret
values (<https://fluxoperator.dev/mcp-server/>, <https://fluxcd.io/flux/agent-skills/>). It is
**AGPL-3.0**, as above.
## Ansible (playbooks, collections, ansible-lint, Molecule)
No official, permissively licensed Ansible agent skill set exists.
### `ansible-community/ai-forge`: community, copyleft
- **Source:** <https://github.com/ansible-community/ai-forge>. It came out of the Ansible forum proposal
of 2026-03-20 (<https://forum.ansible.com/t/proposal-new-repo-for-ansible-ai-collaboration/45575>)
and was announced on 2026-04-09.
- **Licence:** **GPL-3.0-or-later. COPYLEFT.**
- **Maintenance:** Last push on 2026-11-06. **No tags**, so nothing can be pinned except a commit SHA.
43 stars. The README warns that the repo is brand new and its "structure and contents may change
frequently". The forum thread states it is "not Red Hat Supported".
- **Format:** Lola modules, installed with `pip install lola-ai` then `lola install`. Skills live under
`.agents/skills`. Neither the Claude plugin marketplace nor `npx skills` is documented. Whether apm
can install it is unverified.
- **Content:** Mostly collection SDLC: `ansible-collection-standards` (CoP review), `ansible-role`
scaffolding, and `ansible-collection-sdlc` (17 skills covering changelog fragments, ansible-test,
release and PR review). `ansible-content-development` includes `write-content-tests`, which covers
Molecule. **There is no dedicated ansible-lint skill.**
- **Recommendation:** **Do not depend and do not adapt.** Redistributing it through holocron's MIT
marketplace, as we do with `mattpocock`, would convey GPL content. Adapting it would make the adapted
skill a GPL derivative. Its own maintainers also say the structure is unstable and it has no tags.
Reading it for ideas is fine. Copying its text is not.
### `leogallego/claude-ansible-skills`: community, copyleft
The four CoP review and scaffolding skills (role, collection, EE) that seeded ai-forge (forum thread
above). The licence is **GPL-3.0** (GitHub API) and it has 48 stars. **Avoid**, for the same reasons.
### `akin-ozer/cc-devops-skills`: community, permissive
- **Licence:** Apache-2.0. 339 stars, last push on 2026-07-26, tags `v1`/`v1.0.0`, single maintainer.
- **Format:** Agent Skills `SKILL.md` under `devops-skills-plugin/skills/<name>/`. It includes
`ansible-generator` and `ansible-validator`. Aggregators report that the validator runs Molecule
when a role has a `molecule/` directory; I did not verify that. The same repo also has `k8s-debug`
and Terraform skills.
- **Quality:** Unreviewed by me beyond the frontmatter. The `ansible-validator` description is a
terse keyword list ("Validate, lint, audit, or debug Ansible playbooks, roles, inventories, FQCN,
tasks."), which falls short of ADR-0020's description contract.
- **Recommendation:** A permissible **reference to adapt from** (Apache-2.0 requires keeping the
NOTICE and attribution). It is not worth depending on: one maintainer, and pushes stopped in July.
### Red Hat material
- **Ansible development tools MCP server** (`@ansible/ansible-mcp-server`, image
`ghcr.io/ansible/devtools-mcp-server`): a **Technology Preview**
(<https://developers.redhat.com/articles/2026/08/19/red-hat-ansible-development-tools-mcp-server>,
<https://docs.ansible.com/projects/vscode-ansible/mcp/>).
- **Tools:** Zen of Ansible and best-practice lookup, environment setup, `ansible-creator`
scaffolding, ansible-lint with fixes, the EE builder, and `ansible-navigator` execution.
- **Molecule is not a tool.**
- **Licence:** not stated on either page. The `ansible/vscode-ansible` repo that bundles it is MIT,
but I did not confirm that the server source lives there.
- It can execute playbooks, so ADR-level scoping applies before any adoption.
- **`RHEcosystemAppEng/agentic-collections`:** Red Hat's Summit 2026 skills repo, Apache-2.0
(LICENSE file). Its `rh-automation` plugin is **Ansible Automation Platform governance**, not
playbook or collection authoring. That is product-specific and fails the provider-agnostic
constraint. Its only tag is a moving `latest`. **Not relevant.**
- **Tooling licences, for awareness:** `ansible/ansible-lint` and `ansible/ansible-dev-tools` are
**GPL-3.0**. `ansible/molecule` is MIT and `ansible/ansible-creator` is Apache-2.0. Skills that
*invoke* these CLIs do not redistribute them, so this does not affect holocron.
**Recommendation for Ansible: author our own.** Suggested split, to be settled in the map: playbook
authoring, collection authoring, and Molecule testing, with ansible-lint run as a deterministic gate
inside those skills rather than as its own skill. Ground them in the canonical sources below, not in
ai-forge text.
## Kubernetes troubleshooting
No official Kubernetes-project agent skill was found. Community skills are plentiful and uneven:
- `akin-ozer/cc-devops-skills` → `k8s-debug`: Apache-2.0, see above.
- `laurigates/claude-plugins` → `kubectl-debugging`: MIT, last push on 2026-11-12. It covers ephemeral
containers and `kubectl debug`.
- `ahmedasmar/devops-claude-skills` → `k8s-troubleshooter`: **no licence** (GitHub API `None`, no
LICENSE file), so all rights are reserved. **We cannot depend on it or adapt it.**
- Many registry mirrors (`majiayu000/claude-skill-registry` and others) are re-hosts with unclear
provenance. **Avoid them.**
MCP servers:
- **`containers/kubernetes-mcp-server`:** Apache-2.0, 2,243 stars, last push on 2026-11-12, latest tag
`v0.1.2`. Its toolsets include `core` and `helm`. It has a `read_only` setting, plus
`denied_resources`, which its README calls best-effort, deferring to RBAC as the real control. It
ships as a native binary, npm, uvx and a container. This is the strongest generic option.
- `Azure/mcp-kubernetes` (MIT, 62 stars) and `rohitg00/kubectl-mcp-server` (MIT) are alternatives.
`k8sgpt-ai/k8sgpt` (Apache-2.0) is an analyser rather than a skill.
**Recommendation: author** one thin troubleshooting skill (events, describe, logs, `kubectl debug`,
then hand off to Flux's `gitops-cluster-debug` for anything Flux-owned), grounded in kubernetes.io.
Treat `containers/kubernetes-mcp-server` in read-only mode as an optional companion. Root `apm.yml`
currently has `mcp: []`, and adding an MCP dependency is a change that needs its own decision.
## OpenTofu / Terraform
### `antonbabenko/terraform-skill`: community, recommended when needed
- **Licence:** Apache-2.0 (LICENSE file; the `SKILL.md` declares `license: Apache-2.0`).
- **Maintenance:** 2,461 stars, last push on 2026-10-24, tagged regularly (latest `v1.17.2`). The
author runs terraform-best-practices.com.
- **Format:** Agent Skills `skills/terraform-skill/SKILL.md`. Also a Claude marketplace
(`antonbabenko/agent-plugins`) and `npx skills`. It is apm-installable by subpath (inferred).
- **Scope:** Explicitly covers **Terraform 1.0+ and OpenTofu 1.6+**: testing (native `test` vs
Terratest), modules, state, CI, and Trivy/Checkov. Examples default to AWS. The guidance itself is
cloud-generic, but we would want to check that the AWS examples do not bias a provider-agnostic
package.
### `hashicorp/agent-skills`: official, mostly out of scope
- **Licence:** **MPL-2.0. Weak, file-level copyleft:** files we modify must stay MPL and their source
must be made available. Depending on it unmodified carries no extra obligation. Adapting it means
keeping the MPL on each derived file.
- **Maintenance:** 927 stars, last push on 2026-11-04, **one tag, `v1.0.0`**.
- **Format:** Agent Skills `SKILL.md` under `plugins/terraform/skills/<name>/`.
- **Scope:** 16 Terraform skills (SKILLS.md). Most target provider development, Terraform Stacks,
Sentinel/policy and Azure Verified Modules, which are HashiCorp or provider-specific. OpenTofu is
**not mentioned**. Only `terraform-style-guide`, `terraform-test` and `refactor-module` are plausibly
generic.
- **Recommendation:** at most, depend on those two or three skills individually, pinned to `v1.0.0`.
Check each against OpenTofu semantics first.
### MCP servers
- **`opentofu/opentofu-mcp-server`:** official. MPL-2.0 (LICENSE file; the GitHub API reports
NOASSERTION because some folders carry different licences). Latest tag `v1.0.0`, last push on
2026-09-21. It is **registry lookup only** (search, provider, module, resource and data-source docs),
hosted at `https://mcp.opentofu.org/mcp` or run with `npx @opentofu/opentofu-mcp-server`. Read-only
and low-risk.
- **`hashicorp/terraform-mcp-server`:** MPL-2.0, `v1.4.1`. It is the Terraform Registry and HCP
equivalent. Prefer the OpenTofu server for an OpenTofu target.
**No official OpenTofu agent skills exist** (search on 2026-11-12 found only the MCP server).
**Recommendation: defer.** When OpenTofu work starts, **depend** on `antonbabenko/terraform-skill`
through a pinned wrapper plugin and **author** only OpenTofu-specific deltas (state encryption, `tofu`
CLI differences) if they prove necessary.
## Canonical sources for our own skills' research registries
All URLs resolved on 2026-11-12.
- **Ansible:**
- ansible-lint: <https://docs.ansible.com/projects/lint/>
- Molecule: <https://docs.ansible.com/projects/molecule/>
- Ansible dev tools MCP: <https://docs.ansible.com/projects/vscode-ansible/mcp/>
- Red Hat CoP good practices: <https://github.com/redhat-cop/automation-good-practices>. The GitHub
API reports **no detected licence**; cite and paraphrase it, do not copy it.
- `ansible-creator` (Apache-2.0) for scaffolding conventions.
- **Flux:**
- <https://fluxcd.io/flux/>
- Sealed Secrets guide: <https://fluxcd.io/flux/guides/sealed-secrets/>
- <https://github.com/bitnami-labs/sealed-secrets> (Apache-2.0)
- Agent skills page: <https://fluxcd.io/flux/agent-skills/>
- **Kustomize:** <https://kubectl.docs.kubernetes.io/references/kustomize/>
- **Helm:** <https://helm.sh/docs/>
- **Kubernetes troubleshooting:** <https://kubernetes.io/docs/tasks/debug/>
- **OpenTofu:** <https://opentofu.org/docs/>. Terraform: <https://developer.hashicorp.com/terraform>.
## Caveats
- Quality judgements are based on frontmatter, READMEs and vendor docs. No skill was evaluated
end-to-end, and none was installed with apm.
- Star counts and last-push dates are a snapshot from 2026-11-12.
- The licence readings, especially AGPL for `flux-operator-mcp` and MPL-2.0 for HashiCorp and
OpenTofu, are my reading of the licence terms and not legal advice.
@@ -0,0 +1,302 @@
# Agent team structures for software delivery
Researched 2026-11-13 for holocron#170 (ADR-0031, GLOSSARY "Delivery team"). This note builds on
`docs/research/team-patterns/multi-agent-team-patterns.md` (branch `research/team-patterns`) and
does not repeat it: that note already showed that generic roles loading skills beat tool
specialists, and that orchestrator–worker with state passed by pointer is the standard shape. This
note gathers evidence and makes a recommendation. It does not decide anything.
## Question
How do multi-agent delivery teams relate an orchestrator or lead to its role agents in practice?
Which structure fits holocron's constraints: provider-agnostic apm, human on the loop, and state
passed by pointer through Gitea? Two scope additions are folded in. The first is function
specialists *within* a stage (test writer, implementer, QA). The second is a "stage lead per
session" model.
## Answer in brief
- **The orchestrator is almost always the main loop.** That is the main session, or code that
carries a prompt. It is not a separately dispatched agent. Where a vendor calls it an agent
(Anthropic's LeadResearcher, Magentic manager, CrewAI manager, Claude agent-team lead), it is
still the top of the loop, and in Claude agent teams "the main session is the lead for its
lifetime" [S7].
- **Orchestrators decompose dynamically, and fixed SDLC roles are rarer.** Orchestrator–workers
is defined by subtasks that "aren't pre-defined" [S1]. Fixed role chains appear in research
systems (MetaGPT, ChatDev, AgentCoder), in Anthropic's planner/generator/evaluator harness
[S21], and in VS Code's Plan→Implement→Review handoffs [S26]. The fixed role with the best
evidence is a **separate verifier or evaluator**, not a separate implementer.
- **Nested delegation is not portable.** Claude Code nests by default, up to three levels [S4].
Cursor allows one extra level [S14]. Gemini CLI forbids nesting [S13]. Codex blocks it by
default [S12][S27]. Copilot CLI is unverified. ADR-0031's *conclusion* (leaf role agents) stands
as the lowest common denominator. Its stated *reason* is out of date: Claude Code subagents can
now spawn subagents.
- **A fixed pipeline should be sequenced by deterministic code, with the LLM working inside each
stage.** Every framework says so: Anthropic workflows [S1], the OpenAI "orchestrating via code"
section [S8], Microsoft Agent Framework's "If you can write a function to handle the task, do
that" [S23], ADK graph workflows [S24], and the LangChain custom workflow [S17].
- **Recommendation:** keep leaf role agents and state passed by pointer. Replace the
cross-stage LLM Lead with **one session per stage**. Tracker labels and a small script sequence
the stages, and each session's main loop is that stage's lead, dispatching flat leaf
specialists. Inside *implement*, add a test-author step before the implementer and keep a
fresh-context verifier. Those are function specialists working one at a time, never parallel
writers.
## 1. Structural patterns in use
| Pattern | Who controls the flow | First-party examples |
|---|---|---|
| Orchestrator–worker or supervisor (agents as tools) | Main loop calls workers and keeps control | Anthropic orchestrator–workers [S1] and research system [S2]. Claude Code, Codex, Gemini CLI, Cursor and Copilot subagents [S4][S12][S13][S14][S25]. OpenAI `Agent.as_tool()`, "manager keeps control" [S8]. LangChain "Subagents: a main agent coordinates subagents as tools" [S17]. OpenHands `task` tool: "the parent blocks until the sub-agent finishes" [S28] |
| Hierarchical (nested supervisors) | Supervisors of supervisors | `langgraph-supervisor` supports multi-level setups, but its maintainers now recommend the supervisor pattern "directly via tools" for most cases (search-result snippet of [S29], not read in full). ADK hierarchical decomposition [S9]. Manager Devins spawning child Devins [S22] |
| Handoffs or swarm | Control passes peer to peer, and the active agent changes | OpenAI handoffs: "that specialist becomes the active agent" [S8]. `langgraph-swarm` [S29]. MAF Handoff [S23]. VS Code custom-agent `handoffs`, which are user-clicked and use `send: false` by default [S26] |
| SOP pipeline with fixed roles | A fixed sequence of persona roles | MetaGPT's "assembly line paradigm to assign diverse roles" [S15]. ChatDev's design, coding and testing phases via a chat chain [S16]. Anthropic's planner→generator→evaluator harness [S21] |
| Group chat or magentic | A manager selects the next speaker in a shared conversation | MAF Group Chat and Magentic, where Magentic is "a dedicated Magentic manager" with a task and progress ledger, built on AutoGen Magentic-One [S23]. MAF warns that performance outside the original Magentic-One design "is untested" |
| Workflow or graph (deterministic) | Code or graph edges | Anthropic prompt chaining [S1]. OpenAI code orchestration [S8]. MAF Sequential/Concurrent workflows [S23]. ADK graph and dynamic workflows, which are "deterministic processes that combine code logic and AI reasoning" (ADK 2.0) [S24]. CrewAI sequential process [S30] |
| Peer team with a shared task list | Lead plus self-claiming teammates | Claude Code agent teams. These are experimental, with "No nested teams", "Lead is fixed", and "Start with research and review" [S7] |
| Single agent plus skills | One loop that loads context | LangChain: "A single agent stays in control while loading context from skills" [S17]. Cognition [S3][S22] |
What vendors report working in production for coding, as of 2026: Cognition's April 2026
follow-up says "writes stay single-threaded and the additional agents contribute intelligence
rather than actions". In practice that means a generator–verifier loop in which review works best
"when the coding and review agents do not share any context beforehand", plus manager-and-children
map-reduce. It calls "arbitrary networks of agents negotiating with each other" "mostly a
distraction" [S22].
## 2. Orchestrator: an agent definition or the main loop? Role-less or fixed roles?
| Source | What the orchestrator is | Workers |
|---|---|---|
| Anthropic research system [S2] | A prompted LeadResearcher at the top of the loop. Only the lead is described creating subagents | Dynamic and per-query ("it can be any number") |
| Anthropic "Building effective agents" [S1] | "a central LLM" | "subtasks aren't pre-defined" |
| Claude Code [S4][S7] | The main session. `claude --agent X` makes the *main thread* adopt agent X. The agent-team lead is fixed to the main session | Generic built-ins plus user-defined agents |
| Codex, Gemini CLI, Cursor [S12][S13][S14] | "ChatGPT or Codex handles orchestration". Gemini: subagents are "exposed to the main agent as a tool" | Generic built-ins (worker, explorer, generalist and similar) |
| OpenAI Agents SDK [S8] | Either a manager agent (LLM) or code | Specialists |
| CrewAI hierarchical [S30] | `manager_llm` (auto-created manager) or a custom `manager_agent` | Persona roles |
| MAF Magentic [S23] | A manager agent with fixed Magentic-One prompts by default | User-defined specialists |
| Cognition [S22] | A manager Devin. Failure modes: managers are "overly prescriptive", and children wrongly assume they share state | Child Devins |
**Synthesis.** The orchestrator is the top of the loop. Packaging it as an "agent definition" is
just a way to hand that loop a prompt (`--agent`), and only some runtimes support it (§5). Generic
decomposition is the default. Fixed SDLC roles have direct evidence in their favour in only one
place: **separating the evaluator or verifier from the producer**.
- Anthropic's harness: agents "reliably skew positive when grading their own work", and tuning a
standalone evaluator to be skeptical is "far more tractable" [S21].
- Cognition: review without shared context works best [S22].
- Claude Code best practice: `/code-review` runs "in a fresh subagent that never saw your
conversation". Also, "Handing the same task to a subagent doesn't make the answer any better. A
fresh reviewer does help" [S31].
The evidence against fixed roles:
- In Anthropic's own harness, roles were *removed* as models improved. With Opus 4.6 the sprint
construct went, and the evaluator moved to a single pass at the end. The planner stayed, because
the generator under-scoped without it [S21].
- Anthropic's long-running harness used two "agents" that were the *same* system prompt and tools
with different first prompts. It left open whether specialised testing or QA agents do better
[S32].
- MAST found 14 failure modes across 1,600+ traces, including inter-agent misalignment [S19].
## 3. Nested delegation support (verified 2026-11-13)
| Runtime | Can a subagent spawn subagents? | Evidence |
|---|---|---|
| Claude Code (v2.1.323) | **Yes, by default, up to 3 layers** below main. `CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH`, where `1` turns nesting off. A per-agent block is possible by omitting `Agent` from its tools. Agent teams: "No nested teams" | [S4][S7] |
| Codex CLI | **No, by default.** Multi-agent V1 uses `agents.max_depth` with default `1` (root=0, so children cannot spawn), and it is configurable. The opt-in V2 (`multi_agent_v2`, `default_enabled: false`) ignores `max_depth`. The current public docs no longer list `max_depth` | Source `codex-rs/core/src/config/mod.rs` `DEFAULT_AGENT_MAX_DEPTH: i32 = 1`, `features/src/lib.rs`, commit `69231e1` (2026-11-13) [S27]. Docs [S12] |
| Gemini CLI | **No.** "subagents cannot call other subagents" | [S13] |
| Cursor (2.5+) | **One extra level.** The main agent and its direct subagents can spawn, "but a subagent launched by another subagent can't launch further ones" | [S14] |
| Copilot CLI | **Unverified.** The docs are silent. A third-party changelog mirror mentions "nested subagents respect concurrency limits" (1.0.62), which is not confirmed | [S25] |
| VS Code Copilot, Local harness | Off by default. `chat.subagents.allowInvocationsFromSubagents` allows a maximum depth of 5. The Local harness is deprecated and will be removed in February 2027. The Copilot harness (`task` tool) is undocumented on this point | [S26] |
**Implication.** The portable lowest common denominator is *one* level: main loop → leaf.
ADR-0031's "Lead is the only dispatcher" is correct for portability. GLOSSARY and the issue should
cite Gemini CLI and Codex's default as the binding constraints, not Claude Code.
## 4. Deterministic code versus LLM orchestration for a fixed pipeline
- Anthropic: "workflows offer predictability and consistency for well-defined tasks". Agents are
for when "flexibility and model-driven decision-making are needed" [S1].
- OpenAI: orchestrating via code "makes tasks more deterministic and predictable, in terms of
speed, cost and performance". Its patterns are classify-then-route, chaining, and
evaluator loops [S8].
- Microsoft: use a workflow when "the process has well-defined steps" and "you need explicit
control over execution order". "If you can write a function to handle the task, do that instead
of using an AI agent" [S23].
- Google ADK: template workflow agents run "without consulting an AI model … deterministic and
predictable". ADK 2.0 adds graph and dynamic workflows that mix code and LLM nodes [S24].
spec → tickets → code → review → merge has fixed stages and human gates. The *transition* between
stages is a pure function of tracker state: label X means run stage Y. That is code. The *work
inside* a stage (decomposing a spec, writing code, judging a diff) is LLM work. An LLM Lead that
reads labels and picks the next stage is an LLM doing a lookup. It adds cost and an
instruction-following failure surface (MAST "system design" failures [S19]) for no flexibility the
human gates do not already remove.
## 5. "Stage lead per session": runtime support
The model runs each stage as its own top-level session whose main loop is the stage lead. That
lead spawns leaf specialists, so the model needs no nesting. Hand-off between stages goes through
Gitea plus human gates, and a script chains headless sessions in run mode.
| Runtime | Main session as a custom agent | Headless | Both together |
|---|---|---|---|
| Claude Code | `--agent <name>`. The main-thread agent can spawn subagents, and `Agent(type)` allowlists them [S4][S33] | `-p` | **Verified locally**: `claude -p --agent lint-runner …` ran with the agent's prompt (v2.1.323) |
| Copilot CLI | `--agent <id>` or `/agent` [S34] | `-p` / `--prompt`, with `--allow-tool` and `--no-ask-user` [S35] | Documented example: `copilot --agent security-auditor --prompt "…"` [S34] |
| Codex CLI | **No `--agent` flag** for the root session (checked in source: `exec/src/cli.rs`). Closest: `--profile`, `-c developer_instructions=…` or `model_instructions_file` [S36] | `codex exec` | Via profile or config override, not an agent file |
| Gemini CLI | **No `--agent` flag** (checked in `packages/cli/src/config/config.ts`). `GEMINI_SYSTEM_MD` *replaces* the whole system prompt [S37] | `-p` | Via `GEMINI_SYSTEM_MD`, or a prompt that invokes the stage skill |
| Cursor CLI | **No flag.** `--mode` accepts only `plan` or `ask` [S38] | `-p` / `--print` | Prompt only |
So `--agent` is portable to two of five runtimes. What is portable to all five is **a headless
session whose prompt invokes the stage skill**. That is how ADR-0031's Lead skill already works.
The stage lead should therefore be a *skill* (one per stage), with a thin `--agent` wrapper only
where the runtime has one.
**Vendor precedent for chaining sessions with a script.** Anthropic's long-running harness runs
each step as a fresh session. State is handed over through `claude-progress.txt`, a JSON feature
list and git commits, so that a new session can "quickly understand the state of work when
starting with a fresh context window" [S32]. Claude Code's best practices say to write `SPEC.md`
and "start a fresh session to build from it". They also recommend a second session as the
independent reviewer [S31]. Copilot and Cursor document `-p` specifically "for scripts, CI
pipelines, or automation" [S35][S38]. I found no vendor that recommends one long-lived LLM
orchestrator spanning spec through merge, and Claude agent teams cannot be resumed ("No session
resumption") [S7].
## 6. Function specialists within a stage
The earlier note argued against **tool** specialists (an "ansible-engineer"). **Function**
specialists (test author, implementer, verifier) are a different question, and the evidence on
them is mixed.
**(a) Separating test authoring from implementation**
- AgentCoder: programmer, test designer and test executor agents. Test accuracy was 61.0/51.8
when a single agent wrote both, against 87.8/89.9 with a separate designer (HumanEval/MBPP),
because "the tests designed by the same agent that generates the code can be biased by the code
and lose objectivity". Ablation pass@1 (likely GPT-3.5) rose from 61.0 for the programmer alone
to 79.9 for the full pipeline [S39]. Caveat: these are 2023–24 function-level benchmarks, not
repository work.
- ImpossibleBench (Oct 2025): agents with test access "may delete failing tests rather than fix
the underlying bug". GPT-5 cheats 54% on Conflicting-SWEbench (76% one-off). Hiding tests cuts
cheating to near zero but hurts legitimate performance. Read-only tests are "a middle ground"
that "does not eliminate … special-casing or operator overloading" [S40]. Anthropic system cards
track hard-coding and special-casing as reward hacking (secondary reading only, not verified in
the PDFs) [S41].
- Counter-evidence: "More agent-written tests do not mean more solves" (six frontier models, Apr
2026) [S42]. This concerns the *volume* of tests a single agent writes, not author separation.
**(b) Flat versus per-stage sub-lead**
A per-stage sub-lead *as a subagent* needs two levels. That works on Claude and Cursor, and fails
on Gemini and on Codex's default (§3). The portable options are:
1. **Flat**: the top-level Lead dispatches test author, implementer and verifier directly.
2. **Stage lead per session** (§5): the stage session *is* the sub-lead, and its specialists are
one level down.
LangGraph's maintainers steering users from the multi-level supervisor library to a flat
supervisor via tools [S29] points the same way (secondary snippet).
**(c) Benefits versus costs**
- Benefits: test oracles independent of the code [S39], and less self-grading bias [S21][S22][S31].
- Costs: multi-agent systems use about 15× the tokens of chat [S2]. Agent teams use "significantly
more tokens" [S7]. A fresh subagent "can end up *slower*", because it re-gathers context [S31].
Context loss at hand-off and children assuming shared state are reported failures [S22][S19].
- AgentCoder reports *lower* tokens than its multi-agent baselines (56.9K against 138.2K) [S39].
That comparison is against other multi-agent systems, not a single agent.
**Implication.** One function specialist is justified: the one that **verifies or constrains** the
writer. That covers a test author working before the code, and a verifier or reviewer with fresh
context. A second *writer* running in parallel is not justified [S3][S22]. A sequential
test-author → implementer hand-off keeps a single writer at any one time.
## 7. Recommendation
Keep the parts of ADR-0031 that fit the evidence: leaf role agents, human-set gates, state passed
by pointer, and one dispatcher per session. Change the shape of the Lead:
1. **Sequence stages with tracker state and code, not an LLM.** Each stage is a skill
(`spec-lead`, `tickets-lead`, `implement-lead`, `review-lead`, `verify-lead`), started as its
own session. Interactive mode: a human starts it. Run mode: a short script maps a Gitea label to
the next stage and launches `claude -p --agent implement-lead …`, `copilot --agent … -p …`, or
`codex exec` / `gemini -p` / `agent -p` with a prompt that invokes the skill. The thin `--agent`
wrapper is optional and only exists for Claude and Copilot.
2. **Within a session, the stage skill is the only dispatcher**, and specialists stay leaves. No
nesting is required on any runtime.
3. **Inside implement, use sequential function specialists**: test author (writes failing
acceptance tests from the ticket and commits them) → implementer (tests read-only) → verifier
(fresh context, runs the tests and checks the diff against the ticket). Enforce "implementer
does not edit the test author's tests" with a hook or pre-push diff check, not a prompt
(governance: deterministic enforcement). Do not run parallel writers on one ticket.
4. Correct the stated rationale in ADR-0031, GLOSSARY and #170. The binding constraints are Gemini
CLI (no nesting) and Codex's default `max_depth=1`. Claude Code is not one of them.
**Strongest counter-argument.** Do less: one implementer session per ticket doing test-first
itself, followed by a fresh-context reviewer.
- Every extra hand-off loses context and costs tokens and latency [S2][S31].
- Vendors are *removing* harness roles as models improve [S21].
- More agent-written tests do not move outcomes [S42].
- Read-only tests do not stop special-casing [S40], so the test-author split buys an independent
oracle but not integrity.
- A per-stage session also gives up any cross-stage judgement a long-lived Lead could exercise,
and adds a script to maintain.
Answer: the human gates already supply that cross-stage judgement. And the verifier step is the
part the evidence supports most strongly [S21][S22][S31]. If cost matters more than oracle
independence, drop the test author first and keep the verifier.
## Unverified or not reached
- Copilot CLI nested subagents, and whether the Copilot harness `task` tool nests.
- Whether Codex V2 multi-agent permits unbounded nesting in practice. Source shows that
`max_depth` is ignored, but the V2 depth logic was not traced.
- The headless/`--agent` combination on Copilot CLI is documented but was not run locally.
- Anthropic system-card reward-hacking figures were read only through secondary quotes.
- The ADK multi-agent page (`sub_agents` single-parent rule) is now a redirect, so the 2.0 graph and
dynamic docs were used instead.
## Sources
Fetched 2026-11-13 unless noted. S1–S20 carry the numbering of the prior note.
- [S1] Anthropic, "Building effective agents" (2024-12-19) — <https://www.anthropic.com/engineering/building-effective-agents>
- [S2] Anthropic, "How we built our multi-agent research system" (2025-06-13) — <https://www.anthropic.com/engineering/multi-agent-research-system>
- [S3] Cognition, "Don't build multi-agents" (2025-06-12) — <https://cognition.com/blog/dont-build-multi-agents>
- [S4] Claude Code docs, "Subagents" — <https://code.claude.com/docs/en/sub-agents>
- [S7] Claude Code docs, "Agent teams" — <https://code.claude.com/docs/en/agent-teams>
- [S8] OpenAI Agents SDK, "Agent orchestration" — <https://openai.github.io/openai-agents-python/multi_agent/>
- [S9] Google Developers Blog, multi-agent patterns in ADK (cited from prior note)
- [S12] Codex docs, "Subagents" — <https://learn.chatgpt.com/docs/agent-configuration/subagents>
- [S13] Gemini CLI docs, "Subagents" — <https://geminicli.com/docs/core/subagents/>
- [S14] Cursor docs, "Subagents" — <https://cursor.com/docs/context/subagents>
- [S15] Hong et al., MetaGPT, arXiv:2308.00352 v7 — <https://arxiv.org/abs/2308.00352>
- [S16] Qian et al., ChatDev, arXiv:2307.07924 v5 (ACL 2024) — <https://arxiv.org/abs/2307.07924>
- [S17] LangChain docs, "Multi-agent" — <https://docs.langchain.com/oss/python/langchain/multi-agent>
- [S19] Cemri et al., MAST, arXiv:2503.13657 v3 — <https://arxiv.org/abs/2503.13657>
- [S21] Anthropic, "Harness design for long-running application development" (2026-03-24) — <https://www.anthropic.com/engineering/harness-design-long-running-apps>
- [S22] Cognition, "Multi-Agents: What's Actually Working" (2026-04-22) — <https://cognition.com/blog/multi-agents-working>
- [S23] Microsoft Agent Framework docs: Overview (2026-10-23), Orchestrations, Magentic — <https://learn.microsoft.com/en-us/agent-framework/overview/>, <https://learn.microsoft.com/en-us/agent-framework/workflows/orchestrations/magentic>
- [S24] Google ADK docs: Agents, Template workflows, Graph-based and Dynamic workflows (ADK 2.0) — <https://github.com/google/adk-docs/tree/main/docs> (`agents/index.md`, `agents/workflow-agents/index.md`, `graphs/index.md`, `graphs/dynamic.md`)
- [S25] GitHub Docs, "About custom agents" (Copilot CLI) — <https://docs.github.com/en/copilot/concepts/agents/copilot-cli/about-custom-agents>
- [S26] VS Code docs, "Subagents" and "Custom agents" (2026-11-11) — <https://code.visualstudio.com/docs/agents/run/subagents>, <https://code.visualstudio.com/docs/copilot/customization/custom-agents>
- [S27] openai/codex source at commit `69231e119bfc` (2026-11-13): `codex-rs/core/src/config/mod.rs`, `core/src/tools/spec_plan.rs`, `core/src/agent/registry.rs`, `features/src/lib.rs`, `core/config.schema.json` — <https://github.com/openai/codex>
- [S28] OpenHands SDK docs, "Task tool set" — <https://docs.openhands.dev/sdk/guides/task-tool-set>
- [S29] LangChain reference, `langgraph-supervisor` / `langgraph-swarm` — <https://reference.langchain.com/python/langgraph-supervisor> (the multi-level and "use tools instead" claims come from search snippets, not the page as fetched)
- [S30] CrewAI docs, "Processes" — <https://docs.crewai.com/en/concepts/processes>
- [S31] Claude Code docs, "Best practices" — <https://code.claude.com/docs/en/best-practices>
- [S32] Anthropic, "Effective harnesses for long-running agents" (2025-11-26) — <https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents>
- [S33] Claude Code docs, "CLI reference" — <https://code.claude.com/docs/en/cli-reference>
- [S34] GitHub Docs, "Creating custom agents for Copilot CLI" — <https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/create-custom-agents-for-cli>
- [S35] GitHub Docs, "Run Copilot CLI programmatically" — <https://docs.github.com/en/copilot/how-tos/copilot-cli/automate-copilot-cli/run-cli-programmatically>
- [S36] Codex config reference — <https://learn.chatgpt.com/codex/config-file/config-reference>; `codex-rs/exec/src/cli.rs`, `utils/cli/src/shared_options.rs` [S27]
- [S37] Gemini CLI source and docs: `packages/cli/src/config/config.ts`, `docs/cli/system-prompt.md` — <https://github.com/google-gemini/gemini-cli>
- [S38] Cursor CLI docs, "Overview" and "Parameters" — <https://cursor.com/docs/cli/overview>, <https://cursor.com/docs/cli/reference/parameters>
- [S39] Huang et al., AgentCoder, arXiv:2312.13010 v3 (§4.3 Table 2, §4.7 Table 6) — <https://arxiv.org/html/2312.13010v3>
- [S40] Zhong, Raghunathan, Carlini, ImpossibleBench, arXiv:2510.20270 v1 — <https://arxiv.org/html/2510.20270v1>
- [S41] Anthropic, Claude Opus 4 & Sonnet 4 system card (May 2025), reward-hacking section (read only through secondary quotes)
- [S42] "Rethinking the Value of Agent-Generated Tests", arXiv:2602.07900 v2 (2026-04-09) — <https://arxiv.org/html/2602.07900v2>
Repo sources: `docs/adr/0031-first-party-delivery-team-replaces-mattpocock-chain.md` (untracked on
`docs/wayfinding-operations`), `GLOSSARY.md` "Delivery team",
`docs/research/team-patterns/multi-agent-team-patterns.md` (branch `research/team-patterns`).