Index of every page on this site: llms.txt
All skills
wix avatar

/rp-subagent-dispatch

@e2bc48e official
by Wix.comwix/skills40 stars
42
Run it yourself

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.

  • 1 file
  • 3.6 KB
  • Updated last week
  • GitHub
Use this Skill: https://skilld.dev/gh/wix/skills/rp-subagent-dispatch

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈66 tokens for metadata: the name and description. ≈837 when used: this file.

Description uses 3.3% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈265 characters, or 3.3%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

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.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at e2bc48e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated last week

README badge

README badge for wix/skills/rp-subagent-dispatch