The pattern, the four hard constraints, the state contract, and the portability seam.
Applies to the enrichment pilot (enrichment-pilot.md) and the full pipeline
(full-pipeline-map.md) alike.
| Role | Lives in | Active/passive | Owns |
|---|---|---|---|
| Orchestrator | commands/run-enrichment.md (→ .claude/commands/) |
active, main thread | the DAG, parallel dispatch, the reviewer-retry loop, stage-boundary existence checks |
| Skills | skills/<name>/SKILL.md (→ .claude/skills/) |
passive | reusable domain logic (≈90% of each existing prompt); each also invocable standalone |
| Worker sub-agents | agents/<name>.md (→ .claude/agents/) |
active, isolated context | load the named skill, read named inputs, write the named output, return {status, outputPath, summary} |
The workers are deliberately thin and generic — the intelligence is in the skills, the control flow is in the orchestrator. A worker is just "load skill X, read files Y, write file Z, report."
Packaged as a plugin. The canonical install is the
diffmode-growth-tacticsClaude Code plugin:.claude-plugin/plugin.jsonmakes Claude Code auto-discoverskills/,agents/, andcommands/at the plugin root. The(→ .claude/…)annotations below describe the legacy symlink layout (install.sh, now local-dev only). Under the plugin, skills and agents are namespaceddiffmode-growth-tactics:<name>, and a worker "loads skill X" via the Skill tool (preloaded through itsskills:frontmatter; the research worker invokes the dispatched dimension at runtime) — not by reading.claude/skills/<name>/SKILL.md. A sub-agent must not Read a sibling skill's file by hardcoded path; the reviewer worker reaches its bundled rubric via${CLAUDE_PLUGIN_ROOT}/skills/growth-reviewer/references/.
- The orchestrator runs in the main thread — never as a sub-agent. Sub-agents are
one level deep (
../../pipeline-skills/research/claude-code-skills-2026.md); a sub-agent orchestrator could not spawn the research/reviewer workers. So the orchestrator is a slash command read and executed by the primary agent. - Skills are passive. The fan-out, the waiting, and the retry loop are performed by the orchestrator's Agent-tool calls — not "by the skill." Skills supply the logic; the orchestrator supplies the control flow.
- State passes through the filesystem — the existing
ai-cmo-workspace/{product}/…convention. Workers return only a small JSON summary + the output path, so the orchestrator's context stays lean even across a 5-output stage. - The reviewer→retry quality gate is a main-thread loop. On a failing review, the
orchestrator spawns a FRESH worker with the reviewer's blocking issues injected into
the brief. Workers are stateless and not addressable after they return — there is no
"re-dispatch the same worker," and the orchestrator never
SendMessages a completed worker. Capped at 3 iterations — the repo's existing threshold-7 / max-3 norm (workflow-config.yamloutput_validation_config).
orchestrator (main thread)
│
├─ dispatch worker(skill=<dimension>, inputs=[…], output=<path>) ──► writes <path>
│ worker returns {status, outputPath, summary}
│ three outcomes:
│ ok → continue
│ error{reason} → surface reason, stop this branch
│ died mid-run (no JSON) → spawn a FRESH worker, up to 2×;
│ still dead → fail clean (worker-dispatch-failed),
│ tell the founder to re-run
│ /diffmode-growth-tactics:start (auto-resume
│ picks up from what's on disk), NO main-thread fallback
│
├─ existence check: <path> exists AND non-empty? else spawn a fresh worker / abort
│
└─ reviewer loop (iter = 1..3):
dispatch reviewer(rubric=<dimension>, spec=<path>, output=<path>)
reviewer returns {score, pass/fail, blocking_issues[]}
if score ≥ 7 and pass → done
else if iter < 3 → spawn a FRESH worker with blocking_issues injected
(workers are stateless / not addressable after return —
never SendMessage a completed worker)
else → mark dimension failed, surface to user, stop the dependent branch
This is structurally identical to generate-pseo-cells.md's Stage 5 (generate) →
Stage 6/8 (validate/review) → Stage 7 (capped self-heal). We are not inventing a
pattern; we are reusing the proven one.
Every worker returns a small JSON object (printed as its final message), never the file contents:
{ "status": "ok", "outputPath": "ai-cmo-workspace/<slug>/02-enrichment/<file>.md", "summary": "<1-2 lines: what was produced, counts>" }
{ "status": "error", "reason": "<what blocked it>" }The reviewer returns:
{ "score": 8, "verdict": "APPROVED", "format_compliance": "PASS", "blocking_issues": [], "confidence": "HIGH" }
{ "score": 5, "verdict": "REJECTED", "format_compliance": "PASS", "blocking_issues": ["…", "…"], "confidence": "HIGH" }The orchestrator reads only these summaries to drive the DAG — it does not re-read the big markdown outputs into its own context except when it must inject a path.
Skills describe a capability ("use the web-research backend"), never a vendor. The concrete
tool is chosen by the worker's tools: list — and, since v2.8.0, by which worker file the
orchestrator dispatches:
- Claude Code:
research-workercarriesWebSearch+WebFetchand nothing else. A Step-6 citation-integrity re-fetch drops any non-resolving (NXDOMAIN / hard-404) cited URL and confirms the page actually contains the attributed claim. - Claude Code, opt-in:
research-worker-perplexityis the same worker withmcp__perplexity__perplexity_research/_searchadded. The orchestrator dispatches it only when the founder wroteperplexityin$ARGUMENTS. It must reportbackend: "perplexity→websearch"if a Perplexity call fails and it continues on the built-in search. - Codex: the native
web_searchtool (enabled per-dispatch with-c web_search="live"), with the same citation-integrity re-fetch.orchestrate.pyhard-codes--backend native.
Selection is structural, not advisory. The default worker cannot call Perplexity because the tools are absent from its definition — the same enforcement that keeps the analysis workers off the web. A prose instruction not to use a tool that is sitting in the tool list is the weakest pattern available, and this repo deliberately doesn't use it.
Why opt-in, precisely. Not quality: eval-methodology.md §4c measured no delta and requires
n≥3 to re-open that. It's that Perplexity bills a paid API and holds a key that can expire —
which happened mid-run in the field (HTTP 401 on the first research stage) after the founder
had been told they were paying for it, with every later stage silently running on the built-in
search. Detection is not consent, and a configured server is not a request.
The one mechanical asymmetry survives: Perplexity returns already-grounded result URLs, while on the built-in search the model assembles citations itself. That is why the re-fetch is the default path's non-negotiable gate, and why the opt-in worker skips it only for Perplexity-sourced URLs.
The audience dimension is the exception (ENR-001 forbids new web searches). It is
served by a dedicated no-web worker (analysis-worker, tools: [Read, Write, Edit, Glob, Grep, Skill]) so the no-search rule is structurally enforced — not merely
requested in prose.
The CLI's Python verify_outputs (existence + non-empty + section presence) becomes
the orchestrator's stage-boundary completeness check — a Bash test -s <path> plus a
last-required-section grep (and a min-line floor for large stages). No Python needed. In the
free diffmode-growth-tactics pipeline the proprietary Python scripts the paid pipeline
shelled out to are replaced by clean-room skills (lite-constraints for the constraints
generator; in-context validation for the vector checks) — no proprietary script ships in the
plugin (full-pipeline-map.md).
Share the skills (SKILL.md), re-author the orchestrator per runtime. The skills
are the portable asset; the DAG/fan-out/retry control flow is runtime-specific
(../../pipeline-skills/research/sources.md → "the portability headline").