360 Secure SkillHub
360 安全技能中心

dispatch-workers

在保证质量的前提下按最低层级决定自行处理还是派单:把任务拆成小 ticket,用 dispatch 脚本交给成本更低或免费的 worker CLI 执行,读取一次性 JSON 报告,并按低、中、高风险做核验、测试与独立审查,最后汇总 worker 与模型用量。

分类:开发
ptsuriya
热度 0.00
最近更新 2026-12-02 17:29:21

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add ptsuriya/dispatch-workers-skill/dispatch-workers
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
dispatch-workers
description
Plan work in small tickets and hand them to cheap or free worker CLIs first, then verify and review it yourself. Use when a task is big enough to split across several agents, when the user wants to save tokens, or when asked to dispatch, delegate, orchestrate or hand off work.

Dispatch workers

You orchestrate (intended: Claude Sonnet on a monthly limit). Goal: spend as few of your own tokens as possible and let workers (other subscriptions, free models) do the work. Every tool call re-reads your whole context, so fewer calls beat shorter calls. Never fewer checks. Terse replies (caveman; never drop requirements, errors, security findings, acceptance criteria). Smallest diff (ponytail).

Load a reference or skill only when a step or a failure names it.

1. Gate: lowest tier that keeps quality

Tier Fits Do
0 Direct typo, text, config value, small obvious fix do it yourself, run the targeted check. No ticket, no worker
1 Single bounded change one ticket, one worker, verify
2 Parallel independent parts small tickets + dependencies; one worktree per parallel editor; integration check after merge
3 Complex architecture, security, migration, tightly coupled system grill -> spec -> tickets -> dispatch -> verify -> independent review -> handoff

2. Tier 1 in about four calls

  1. One look: a single call that prints the spec and lists paths (cat SPEC.md; rg -l <term>). Do not read the source files a worker will read; put paths and symbols in the ticket.
  2. One ticket, one dispatch: Write the ticket to .dispatch/T-001.md with the Write tool (not a shell heredoc: shell permission checks reject some ticket text). Keep it under 15 lines and point to the spec by path instead of restating it: goal, spec path, files to touch, acceptance command, constraints. Then:
node <skill-dir>/scripts/dispatch.mjs run --task <id> --ticket T-001 --tier 1 --worker auto --files src/ --check "<test command>" --prompt .dispatch/T-001.md

--mode read for review or research; --worker <name> --model <m> to pin one. Run it in the foreground and raise the Bash timeout to 600000 ms (workers usually take 1 to 4 minutes). Use background only for parallel tickets, and then never end your turn before every report is in. First use on a machine: node <skill-dir>/scripts/preflight.mjs --brief (one short block; BLOCKED = stop). --worker auto needs a roster (config.example.json, set in .dispatch/config.json or ~/.config/dispatch-workers.json): if it is missing, ask the user which workers to list. 3. Read the one-line JSON report (status, failure_class, next, changed_files, check). Follow next; a refusal is a limit, not something to route around. Open references/routing.md only when next is not verify. 4. Verify by risk (below), then finish. One-off helper calls (opencode models, --help, re-reading files the runner already summarised) are wasted turns.

3. Verify: a worker report is a claim, not a result

The runner already compares the claim with the working tree and ran your --check. You still own the decision:

  • Low (docs, config, isolated function with tests): status: success and check.exit: 0 is enough.
  • Medium: also read git diff once; run tests for neighbours the check did not cover. A green --check proves only what the visible tests cover: before accepting, list the spec's error cases and edge cases (bad input, empty, limits, error messages) and confirm each is tested. If one is not, run one more ticket (or a one-line script) that tests it. Do not read the whole implementation for this.
  • High (auth, security, money, data writes, migrations, concurrency): the above, integration tests, an adversarial test, review by a different model than the author (--mode read on another worker). Confirm each finding in code before fixing.

Empty or cut-off output = not done. Name the suites you skipped. Record only if you did more than the runner: dispatch.mjs verify --task <id> --ticket T-001 --result pass|fail.

4. Close

  • Commit only if the user wants it: by name (git add <files>, read git diff --cached, never -a).
  • Never push, deploy or do anything irreversible unless the user said so for this change. Give the exact one-line commands and wait.
  • handoff when work continues elsewhere. Report workers and models used and dispatch.mjs summary --task <id> (unmeasured = "unavailable").

Stop and ask

Irreversible or outward-facing step; an edit needs --allow-unattended or a classifier blocks a flag; sending private code to a free or data-collecting model; paid API spend; workers disagree on a decision that is the user's; retry or budget limit hit; cheap workers exhausted and much work left.

Skills

grill-with-docs, to-spec, to-tickets for unclear or Tier 3 work; code-review for review; handoff to close. If a skill is user-invoked only (preflight lists them), read its SKILL.md or ask the user to run it.

References

  • references/routing.md: worker choice, limits, retry and escalation, shared state.
  • references/workers.md: CLI facts per worker, permission flags, caveats. references/free-models.md: free model lists.
  • references/contract.md: report format, status rules, usage log.
  • references/tools.md: optional RTK, Serena, ccusage, context-mode.
  • references/lessons.md: tests and DB, partial work, reviews, deploy.
  • references/benchmark.md: comparing versions of this skill.