Generated banner for Rp Subagent Dispatch
Generated logo for Rp Subagent Dispatch

Rp Subagent Dispatch

WixOfficialPublished by Wix

  • Skill
  • Meta (authoring, orchestration, planning, memory)
  • Agent tooling
  • MIT
  • No issues found

From the author

How the orchestrator dispatches Developer and QA subagents so a run's token cost stays bounded: a fresh subagent per round, a short deterministic handoff file, a context budget with a clean handoff, and bounded helpers instead of raw ledgers.
— the description by Wix

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a set of architectural patterns for orchestrating Developer and QA subagents to prevent runaway token costs. By enforcing a fresh subagent lifecycle per round, utilizing deterministic handoff files, and implementing strict context budgets, the system ensures that agents remain performant without carrying the weight of historical logs or previous transcripts. It emphasizes the use of specialized summary helpers over raw file access to keep context windows lean and manageable.

What it does

  • Mandates the creation of a fresh subagent for every round of work.
  • Defines a deterministic handoff file format to pass state between subagents.
  • Establishes a strict context budget of 200K tokens or 150 model calls per subagent.
  • Provides guidelines for handling budget exhaustion without terminating the overall run.
  • Replaces raw log file access with bounded summary helpers to reduce context bloat.
  • Encourages the use of supervisor scripts for long-running tasks to minimize model calls.

When to use it

  • When building or maintaining multi-agent systems that perform long-running tasks.
  • When token costs for agent runs are exceeding project budgets.
  • When subagents are becoming sluggish or failing due to excessive context history.
  • When orchestrating complex workflows that require multiple handoffs between specialized agents.

Advantages

  • Significantly reduces token consumption by eliminating redundant history.
  • Prevents context window overflow in long-running automated processes.
  • Improves agent reliability by providing a clean, deterministic state at each step.
  • Ensures consistent progress tracking through standardized handoff reporting.

Usage examples

“How should I handle a Developer subagent that has reached its token limit?”
The subagent should write a handoff file using the specified script with the budget_exceeded status, then terminate. The orchestrator should then dispatch a fresh subagent using that handoff file.
“How can I check the status of import attempts without reading the entire audit log?”
Use the write-log-summary script to retrieve a concise count of entities by status and top error classes, keeping the output under 4 KB.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/wix/rp-subagent-dispatch/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip rp-subagent-dispatch.zip -d .agents/skills

Documentation by Wix

rp-subagent-dispatch

Most of a run's token cost is history re-sent on every model call, not tool output. A subagent that is resumed round after round keeps re-sending everything it ever saw: one measured run spent 239.5M tokens in a single resumed Developer whose context reached 919K, out of 522M for the whole run. These rules keep each subagent short.

A fresh subagent every round

  • Every Developer or QA dispatch is a new subagent. Never resume or re-message one from an earlier round — not for QA findings, a crash fix, a retry, or "continue".

  • Before each re-dispatch, write the handoff:

    node skills/wix-replatform/scripts/subagent-handoff.js write --project <dir> \
      --stage <stage> --resource <resources/rp-...> --outcome <outcome> \
      [--findings <QA result file>] [--changed <path,path>] [--notes <one line>]

    outcome is done, failed, qa_findings, budget_exceeded, needs_decision or resume_limit. It writes state/handoffs/<stage>-<round>.json (≤ 8 KB) from durable state only: the QA findings verbatim, a write-log summary (counts, never rows), the completion report status, open user actions and the paths changed last round. It prints { file, round, bytes, budgetRoundsWithoutProgress }.

  • The new subagent's prompt is only: the resource path, the project directory and the handoff file. Paste nothing else — no earlier result text, transcript or log. The subagent reads the handoff first; anything it trimmed is still in its source files.

A context budget per subagent

  • Each Developer works within about 200K context or 150 model calls, whichever comes first.

  • Near the budget it stops starting new work, runs subagent-handoff.js write --reason budget_exceeded (with --changed and --notes for where it stopped), and returns budget_exceeded with the handoff path.

  • budget_exceeded is not a failure and not a QA miss. Dispatch a fresh Developer for the same resource with that handoff.

  • When the printed budgetRoundsWithoutProgress reaches 3 (three budget rounds in a row with no new settled import progress), tell the operator in one status line that the stage is repeating without progress, add the same note to the next handoff (--notes), and keep going. Never stop the run for it.

  • Where the host does not report context size, count your own model calls, and keep every tool output under 20 KB by using the bounded helpers below.

Bounded helpers instead of raw files

  • Never open, cat, grep, tail or jq state/attempts/write-attempts.ndjson or logs/import-audit.ndjson — they reach tens of MB and stay in context for the rest of the subagent's life. Use:

    node skills/wix-replatform/scripts/write-log-summary.js --project <dir> \
      [--entity <targetEntityType>] [--status <status>] [--limit 20] \
      [--run latest | --since-run <runId>] [--log audit] [--json]

    Default output: counts per entity × status (current status per attempt) and top error classes; --entity/--status add up to --limit matching rows. Output stays ≤ 4 KB.

  • Run a generated import with scripts/import-supervise.js (see rp-execute-import): one tool call that launches, polls, resumes and returns complete, needs_decision or resume_limit, instead of one model call per poll.

Files

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs Node.js

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
Wix
Publisher
Wix (Official)
Source
wix/skills · skills/wix-replatform/resources/rp-subagent-dispatch · commit d168bc2
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Wix.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download rp-subagent-dispatch.zip