/agent-bridges:delegation-pipelinefrom Agent Bridges
Carries the pipeline steps, payload contracts, session-continuity rules, example prompts, and checkpoint format for a fixed-role delegation pipeline used when delegating to an MCP bridge or Codex QA/Security path.
Ships in Agent Bridges. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This skill is orchestrator-facing (Claude Code only) — it is never pasted
into a QA/Security Codex prompt; see "Shared skills" below for what does
get pasted there. If this project runs two-bridge mode
(no openai/codex-plugin-cc plugin installed — check whether your
CLAUDE.md carries the two-bridge overlay), also read two-bridge.md in
this directory: it replaces step 4 and the QA/Security material below.
The role table, the Gate, "Do NOT delegate", and the model pins referenced
throughout (Antigravity Fast pin, Antigravity Deep pin, QA pin, Security pin) live in CLAUDE.md — this
file assumes you've already read that.
Decide this once, during step 1 (Plan), before delegating anything, and record it in the checkpoint — it determines which steps below actually run for this unit; a step not listed for a size is skipped outright, not just abbreviated.
codex-companion.mjs task call
covering both questions, rather than two separate ones) → Reconcile (5).
No Analyze (0), no Release notes (6).Default to M when unsure. S is for changes you'd genuinely feel silly running a 7-step pipeline over — not an excuse to skip QA/Security scrutiny because a diff "looks small." If step 3 (Review) turns up more than expected once you've started, upgrade the unit to M/L mid-flight, switch Coder re-sends to the Deep pin, and note the upgrade (and why) in the checkpoint.
antigravity, Document Analyzer role, Antigravity Fast pin).
Skipped outright for S-sized units (see "Sizing a unit" above).
When the unit starts from a spec/PRD/doc rather than a self-evident bug
or already-clear ask, send Antigravity the full doc set via agy_run
with mode: "plan", pass json_schema from skills/delegation-pipeline/schemas/requirement-matrix.json,
and ask for a structured requirement matrix. Skip this step
for units with no doc input to ingest.agy_run, mode: "plan", Antigravity Deep pin) to expose blind spots,
unhandled edge cases, or breaking changes before locking the plan.antigravity, Coder role, Antigravity Fast pin for S / Deep pin for M & L).
Send the full plan plus every file/module it touches in one agy_run call with
mode: "accept-edits" — see "Macro-Delegation" below. Antigravity does
the actual edit/execution; mode: "accept-edits" is what makes this the
one role allowed to touch files — every other role runs mode: "plan".
Self-Verification Mandate:
Bash — not the codex:codex-rescue subagent; see "Why direct Bash, not
the subagent" below). Once you're satisfied with the diff, launch both
as --background codex-companion.mjs task calls — see "Session
continuity" below for why this is two backgrounded calls you poll, not
two parallel foreground ones. QA checks correctness/edge cases/
regressions; Security checks for exploitable issues. Neither sees the
other's output. For an S-sized unit, this is one combined call
instead — QA and Security questions asked in the same prompt, one
--model (the QA pin), one job to poll — see "Sizing a unit" above.antigravity, Release Writer role, Antigravity Fast pin).
Skipped outright for S-sized units (see "Sizing a unit" above).
Once a unit is accepted, send the final diff plus the plan to Antigravity
via agy_run with mode: "plan" to draft the changelog entry / doc
update. This is drafting only, and mode: "plan" makes that mechanical
rather than a matter of asking nicely — you still review and commit it
yourself, same as any other Antigravity output. Also a new conversation,
not a continuation of the Coder session.learning-curator skill
(bundled in this plugin, alongside this one) and let it classify the unit as
NOOP, MEMORY, PATCH_SKILL, or CREATE_SKILL from a compact trace of what
you already verified. Order relative to step 6 doesn't matter — this
never gates release. A curator failure never changes the unit's outcome;
see that skill's "Failure handling".Never let Antigravity call Codex directly, or vice versa — you are always the one relaying the diff between roles. No bidirectional delegation, no ping-pong.
Both bridges have high-capacity context (Antigravity/Gemini: 1M–2M tokens; Codex: 128k+ tokens). Package a whole plan plus every file it touches into a single high-payload call rather than fragmenting into single-file requests.
Every call to Antigravity is agy_run (or agy_run_sync if you're willing
to block up to its 10-minute cap for an inline result — prefer agy_run for
anything from the Coder role, since that's the payload most likely to run
long) and must specify:
model: set to the relevant Antigravity pin explicitly (Antigravity Fast pin for
Analyzer, Release Writer, and S-unit Coder; Antigravity Deep pin for M/L-unit Coder
and Adversarial Plan Critique — do not rely on the bridge's own default-model setting
as anything but a fallback — see docs/SETUP.md for why).mode: — "plan" for every role except Coder, "accept-edits" for
Coder alone. This is what makes "read-only" a property the tool enforces,
not just a convention you ask for in prose.json_schema: on any call whose output you'll parse or spot-check
structurally (a requirement matrix, a findings table) — this bounds
output by shape instead of by character count, so ask for the shape you
actually want rather than trusting prose framing alone.Plus, depending on which role it's playing:
cwd set to project root) and the exact requirement question to
answer.Every Codex QA/Security call is node codex-companion.mjs task (see "Why
direct Bash, not the subagent" for how to locate the script) and must
specify:
--model set to the relevant pin (QA pin or Security pin — see
CLAUDE.md "Model pins"), passed as the literal pin value (e.g.
--model gpt-5.6-terra) — codex-companion.mjs only aliases spark,
so any other string, including a pin's human-readable name, is passed
to Codex as-is and fails.--background (large diffs; QA/Security payloads almost always
qualify) and --fresh (never --resume — see "Session continuity").--write flag. Omitting it is what puts the run in
codex-companion.mjs's read-only sandbox — this is how "read-only" is
enforced by the tool here, not by asking nicely in the prompt. Still add
an explicit instruction in the prompt text too ("Review only. Do not
propose edits as a diff.") as a second layer, but the sandbox flag is
the actual enforcement.main, cwd is the repo root") rather than a pasted diff — Codex runs
inside the repo and can read the real working tree itself, which is
cheaper and can't go stale against a diff you pasted earlier in the
conversation. Paste the diff text only if the change isn't committed/
stashed anywhere Codex's own git diff could see it.file:line citations — a
pass/fail-style table, not prose.QA and Security calls go through node codex-companion.mjs task directly
via the Bash tool — not the codex:codex-rescue subagent (Agent
tool, subagent_type: "codex:codex-rescue"), even though that subagent
wraps the same script. Two reasons:
codex:codex-rescue is itself a Claude subagent
(model: sonnet in its own frontmatter) that reads your prompt and then
shells out to the script on your behalf. That read-and-forward step runs
on Claude's quota and burns Claude context on the pasted diff before
Codex ever sees it. Calling the script directly skips that hop entirely
— the whole QA/Security pass runs on Codex's quota, not Claude's.--write "unless the user explicitly asks for read-only," which
makes the read-only guarantee depend on how your prompt text is phrased
and how the subagent's model interprets it. Calling the script directly
and simply never passing --write removes that dependency — the
read-only sandbox (codex-companion.mjs's own behavior: no --write
→ sandbox: "read-only") is what the tool does, not what a middle model
decided to do with your phrasing.Locate the script once per session (it moves when the openai-codex
plugin updates, so don't hardcode a version):
find ~/.claude/plugins/cache/openai-codex -name codex-companion.mjs 2>/dev/null | sort -V | tail -1
Then invoke it as node <that path> task .... The codex:codex-rescue
subagent remains fine to use outside this pipeline — ad hoc debugging
help, a second opinion mid-conversation — just not for the QA/Security
pipeline role, where the read-only guarantee matters.
Each bridge is a separate MCP server process with its own session/thread namespace — do not mix them up:
conversation_id a prior agy_run call returned,
but only for follow-ups within the same role. Analyze, Coder, and
Release Writer are unrelated conversations even though they share one
server and one model — start a fresh call (omit conversation_id) when
the pipeline moves from one role to the next, so Antigravity's context
doesn't drag Document-Analyzer framing into a Coder call or vice versa.
Only reuse conversation_id to continue the same role's work (e.g.
Antigravity iterating on its own implementation after a test failure).
agy_run also offers continue_latest as a "resume whatever I last ran"
shortcut (mutually exclusive with conversation_id) — avoid it here for
the same reason: it can silently pick up the wrong role's thread. Name
the conversation_id explicitly instead of relying on "latest."node codex-companion.mjs task --background (openai/codex-plugin-cc plugin's own script — see "Why
direct Bash, not the subagent"; see docs/SETUP.md for install). It
returns a job id immediately; poll it yourself with
node codex-companion.mjs status <job-id> until done, then
node codex-companion.mjs result <job-id> for the findings — these are
the same commands the plugin's own /codex:status and /codex:result
slash commands run, but call the script directly rather than going
through those commands (they're disable-model-invocation: true, so
you can't invoke them programmatically from inside a skill; typing them
is a person's shortcut, not something you can trigger). QA's job id and
Security's job id are unrelated — don't cross them. The script also
offers --resume-last to continue the latest task thread for the repo
— always pass --fresh (i.e. omit --resume-last) for a QA or
Security call, since resuming would drag the other role's findings (or
a prior unit's) into this one's context; only resume deliberately, if a
QA/Security round genuinely needs to continue its own immediately-prior
call in the same unit (rare — most rounds should be a fresh, fully
self-contained call per "Macro-Delegation" above, since a resumed
thread's earlier framing can bias a second look).delegation-pipeline and learning-curator ship inside the agent-bridges
plugin — Claude Code discovers them globally once the plugin is enabled,
they are never copied into a project's own skills/ directory, and
Antigravity/Codex have no visibility into them at all (neither harness
reads Claude Code's plugin store). Both are orchestrator-facing and are
never pasted into a Codex call.
A project may still keep its own hand-authored skills at
skills/<name>/SKILL.md, symlinked into both .claude/skills and
.agents/skills (see templates/AGENTS.md) — that convention is unchanged
and is how you keep a project-specific skill visible to Antigravity too.
You (Claude Code) and Antigravity trigger those natively — same file
format, same description-matching mechanism. Codex cannot: it has no
per-task skill loader, so before a QA/Security Codex call, check whether a
skill in the project's skills/ matches what you're asking it to do and,
if so, paste that skill's markdown body into the prompt text you pass to
codex-companion.mjs task. Note in the checkpoint which skill (if any)
was pasted into a Codex call, since Codex won't have discovered it on its
own.
Before handing a high-stakes plan to Antigravity for implementation
(architecture-level change, risky refactor, anything security-sensitive by
nature of the task, not just the code), submit the plan itself to Antigravity in
a new conversation as a pre-implementation sanity check — agy_run, mode: "plan", Antigravity Deep pin, framing the prompt explicitly as an adversarial critique
request ("find what's wrong with this plan before it's built, uncovering blind
spots, backward compatibility risks, and hidden race conditions").
Record each finding as accepted or rejected (with reasoning) in your checkpoint.
This is mandatory for architectural or security-sensitive L units and optional
for M units — it does not replace the QA/Security pass in step 4, which is
mandatory for every unit regardless of stakes.
Antigravity agy_run (Document Analyzer):
Ingest
docs/billing-spec.md,docs/refund-policy.md, and the linked PRD underdocs/prd/refund-idempotency.md. Question: what are the concrete, testable requirements for idempotent refund processing? Output: structured requirement matrix conforming to the attached schema. json_schema: <content of skills/delegation-pipeline/schemas/requirement-matrix.json>. model: . mode: "plan". cwd: /path/to/repo
Antigravity agy_run (Implementation):
Plan: add idempotency key checking to
post_invoiceinsrc/billing/refund.pyper the acceptance criteria below. Touch:src/billing/refund.py,src/common/retry.py,tests/billing/test_refund_idempotency.py. Acceptance criteria:test_refund_idempotencypasses under concurrent retries; no new ledger entry without a committed invoice row. Self-Verification mandate: Run existing tests first to check baseline. Do NOT modify test files outside the explicit plan scope. Run local tests (pytest tests/billing/test_refund_idempotency.py) via Bash after editing. Iterate to fix failures up to 3 times. Report the diff along with commands run, exit code, and raw test stdout. model: <Antigravity Fast pin for S, Deep pin for M/L>. mode: "accept-edits". cwd: /path/to/repo
Codex QA pass (Bash, direct script call — no --write, so the run gets
codex-companion.mjs's read-only sandbox):
node codex-companion.mjs task --model gpt-5.6-terra --effort medium --background --fresh "Review only. Do not propose edits as a diff. Diff against main in this repo covers src/billing/refund.py, src/common/retry.py, tests/billing/test_refund_idempotency.py — read it yourself with git diff. Original plan/acceptance criteria: <paste from step 1>. Question: does this satisfy the acceptance criteria? What edge cases or regressions does it miss? Output: pass/fail table with file:line citations for each finding."
Codex Security pass (same mechanism, Security pin):
node codex-companion.mjs task --model gpt-6-sol --effort medium --background --fresh "Review only. Do not propose edits as a diff. Diff against main in this repo covers src/billing/refund.py, src/common/retry.py, tests/billing/test_refund_idempotency.py — read it yourself with git diff. Question: what's exploitable here — injection, auth bypass, unsafe deserialization, secret handling, race conditions with security impact? Output: severity-ranked findings table with file:line citations."
Antigravity agy_run (Release Writer):
Diff: . Plan/acceptance criteria it implements: <paste from step 1>. Draft: a changelog entry (one or two lines, user- facing framing) and any doc updates the diff makes stale. Output: the drafted text plus a list of files it should replace/append to — I will review and commit it myself. model: . mode: "plan".
--background jobs on the same diff,
launched one after the other — each returns its own job id immediately,
so you poll/collect both (node codex-companion.mjs status <job-id>,
then result <job-id>) rather than blocking on one before starting the
other. They're independent codex-companion.mjs task invocations with
no shared state or context between them.status <job-id> shows the job failed,
timeout, or unusable output — retry once with --fresh. For Antigravity,
the equivalent is an agy_run job whose terminal state is failed, a
wake reporting failure_reason (e.g. quota_exhausted, with a reset
window in error), or unusable output — retry once with a fresh call
(no conversation_id). Either way: on a second failure, do the check
yourself (there is no same-role fallback bridge in this pipeline — each
role is single-sourced) and record the failure in the progress file so
the next session knows that role was skipped for this unit.file:line citations; you spot-check one or two of them before recording
the result. Claims without citations get recorded as unverified and
must not be the sole basis for shipping a unit. Antigravity has no fixed
output-size cap here — use json_schema to force the shape of findings
(a structured pass/fail table, not prose you hope stays on-format), same
intent the old character-count truncation served, enforced differently.review-<topic>.md
progress file (see templates/review-topic-template.md) with: which step,
which role (spell out the Antigravity role — Analyzer/Coder/Release
Writer — since all three share one server in the tally), the returned
job_id (and conversation_id if a same-role follow-up is expected), and
the verified outcome. Do this before starting the
next unit of work. Step 7 (Learn) gets the same treatment — see
learning-curator/SKILL.md's "Checkpoint entry" for what to record; a
NOOP outcome still gets a one-line entry.templates/review-topic-template.md) — this is the
running signal for whether the Fast or Deep pin is holding up across units,
not just a per-unit note.job_ids are present.review-<topic>-archive.md and
leave a one-line summary behind.CLAUDE.md "Gate") — record it in the progress file rather
than letting it pass silently, same as any other failed-approach entry.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
delegation-pipeline, codex, mcp-bridge, qa-security, checkpoint
npx claudepluginhub sanoval/agent-bridges --plugin agent-bridges2 skills in this plugin
Other plugins' skills for the same job