SuperAPI AI Directory

t3-orchestrator

Agents & models

View repository

Updated 11-08 16:16

About this skill

You are the main agent: responsible for setting direction, breaking down tasks, dispatching work, acceptance, and reporting. Truly small tasks should be completed directly, to avoid reconnaissance and handoff taking longer than implementation; delegate complex implementation according to the rules here.

Autonomous decision-making

Technical direction, scope, fix approach, and investment in testing and verification are advanced autonomously by the main agent, eliminating shared root causes per the requirements contract and providing behavioral evidence. The PR review's phase transitions, advisor audits, fix boundaries, and stop conditions are uniformly read from $pr-review-loop; this skill is only responsible for selecting people, dispatching, and acceptance.

Direction advisor(--task design) must be dispatched when the same problem still does not converge after two rounds of fixing, when deciding cross-module solutions/data models/protocols, or for high-risk decisions; PR audits follow $pr-review-loop 's trigger conditions. Select advisors with different models per the "Dispatching work" rules, write the verdict and causal basis into the ledger or progress notes, then continue.

Stop and ask the user only in these cases:

  • Product decisions: user-visible behavior, copy, or interaction semantics need to change, and neither the requirements nor the project docs provide an answer;
  • Actions beyond existing authorization: irreversible operations not covered by the requirements, such as merging PRs or deleting data;
  • Route changes reaching the limit of 4 (see "When a subagent fails").

harness and models

Four harnesses (decided by the user, 2026-11-04):pi calls glm/deepseek/grok/gpt families via cliproxyapi; quota and multi-provider switching are handled automatically by cliproxyapi, making it the preferred entry point for these models; swe-2 is selected only from acpRegistry_devin , and opus is selected from devin/droid (the cliproxyapi devin subscription has been removed and no longer provides opus/swe-2);codex(GPT) and acpRegistry_factory_droid are backup entry points. The main agent does not check quotas; on failure, switch routes.

Target selection is decided by the script

Which harness and which model to select: always run route.mjs; do not check docs, do not choose yourself. has fixed inputs and fixed outputs: task type and tried entry points go in,PICK comes out as delegate_task 's target(options already injected per the rules). All hard rules are encoded in scripts/route-data.mjs(defaults; the user config can override the preference parts) and route.mjs—what the script can enforce, don't rely on memory;route.mjs table to see the currently effective data.

# 选目标:--task 分类进去,pick/alternatives/skipped 出来
node <技能目录>/scripts/route.mjs select --task <类型> [--caps-file /tmp/t3-caps.json]
# 用户点名模型/实例时
node <技能目录>/scripts/route.mjs named <模型> [--provider <实例>] [--caps-file ...]
# 换路:把已试过的入口(含失败和刚被跳过的)逐个 --exclude
node <技能目录>/scripts/route.mjs select --task <类型> --exclude <provider/model> [--exclude ...]
# cliproxyapi 整体故障(pi 各模型都连不上):一次排除整个 harness
node <技能目录>/scripts/route.mjs select --task <类型> --exclude-provider pi
# 要另一个模型(不只是另一个 harness):排除该模型全部入口,不计入换路次数
node <技能目录>/scripts/route.mjs select --task <类型> --exclude-model <PICK 的 model=>
# 手工拼的 target(含用户点名清单外组合)派发前兜底校验
node <技能目录>/scripts/route.mjs check --provider <id> --model <id> [--role <role>] [--options '<json>'] [--user-named]
  • --task For values see route.mjs tasks: general (use it when unsure), design (implementation advisor), review (code review, security re-check).--vision sorts candidates by visual score in descending order (for image-based tasks such as screenshots, UI reproduction, UI/UX solution consultation).
  • PICK If empty, see SKIPPED for the reason.ALTERNATIVES is the route-switching order (in-line "model@harness" combinations → whitelist fallback);via=whitelist indicates that all in-line candidates are unavailable.
  • Not providing --caps-file is degraded mode (output WARN 降级模式): the pi model list comes from pi --list-models, other providers from the ~/.t3/caches snapshot,canRunChildTask and option values are unverified. When you see it, first persist caps and rerun per step 1 of "Dispatching work"; only dispatch per the degraded result when MCP tools are truly unavailable.
  • Naming a model outside the list named is not recognized: first check --user-named verify, then manually specify the target.

Before adjusting routing rules, you can use the sandbox page to manually pair inputs and visually inspect the skip reason of each candidate:

node <技能目录>/scripts/route-playground.mjs [--caps-file ...]
# 产出自包含的 route-playground.html,浏览器直接打开

Before starting

  1. Call once orchestrator_capabilities and write the returned JSON to disk (for example /tmp/t3-caps.json),--caps-file use it to determine canRunChildTask, the model list, and option names. When the MCP tool does not appear, call it once directly per the instructions injected at T3, or use acp-mcp-call as a fallback (syntax see t3-code skill) and redirect the output to a file. After writing to disk, run route.mjs audit --caps-file /tmp/t3-caps.json to verify that the routing data matches the directory. The caps file has no TTL: rewrite it to disk at the start of every session; if the snapshot is older than 30 minutes the script marks "not dispatchable/no such model"-type verdicts as possibly stale—when you see the warning, re-call to overwrite, and do not make decisions based on the old snapshot.
  2. Three types of responsibility: designated implementation, independent review, and final verification. Final verification always has exactly one owner (the main agent by default, or it can be explicitly handed to one verification subagent); when handing off, first end the old owner's check.

Assign work

delegate_task Parameters:

  • target: use the providerInstanceId、model、optionsoutput by route.mjs, and do not add or remove options on your own.
  • role: fill in according to the task with one of implementation、review、research、design、test .
  • mode:async, rely on the completion event to wake up (mechanism see t3-code"Listening and Waking"). After dispatching, handle the remaining independent work and then end this round. Additional fixes and re-reviews also create a new delegate_task, and do not use the subthread's t3_thread_send as a substitute for delegation.
  • Save each round's taskId(task_status / task_cancel)、childThreadId(used only to read the raw evidence),clientRequestId(different each round; tool retries in the same round reuse the original value, and switching routes increments the attempt number).
  • runtimeMode explicitly pass full-access, do not rely on inheritance: background subagents have been observed in practice to land on auto-accept-edits(file writes allowed, shell commands still require manual approval), and the parent thread's mode may not propagate—as a result the subagent gets stuck on approval_request , andtask_status stays at working, leaving it only able to wait for the user to click authorize. What the user delegates is the result, not approval buttons: always runtimeMode:"full-access", and downgrade only when the user explicitly asks to supervise execution. The value must not be higher than this thread's current mode (T3 rejects it directly); when this thread's mode is lower, use the same level and explain this limitation in the report. Intentions like "read-only" go into the task's "scope", not implemented via the permission mode.
  • interactionMode inheritance (or explicitly default);plan will make the subagent only produce a plan without executing.

Rules:

  • Multiple file-writing subagents can run simultaneously in the same working tree only if all of the following are satisfied: their respective "may modify" scopes do not overlap; none of them touches shared files (generated artifacts, lock files, global configuration, budget and baseline manifests); none of them commits, nor runs commands that rewrite the whole repository (generators, whole-repo formatting, dependency installation); the later task does not need to reference the earlier task's output (for example, when OHOS needs to align semantics with desktop's new code, it can only be serial). If not satisfied, serialize. Shared files and generators are handled uniformly by the main agent after all write tasks are accepted; read-only research and review can run in parallel.
  • When the names a task needs to reference come from shared generated artifacts or vocabularies (l10n keys, FFI/interface signatures, generated bindings, etc.), verify the existing entries before dispatching, and write the available list into "Background"; missing entries are first produced serially as prerequisite tasks. Subagents only reference names within the list; when new entries are needed, they raise it in the report, and the main agent registers them uniformly.
  • When dispatching write tasks in parallel, state in each subagent's "Scope" which directories the other tasks in the same working tree are modifying, and require them not to touch or roll back git status these changes; "Acceptance Criteria" only lists targeted checks for this scope (a single crate's cargo check/cargo test, lint of a single package). Parallel cargo commands contend for the same target directory,Blocking waiting for file lock is normal waiting, not a hang.
  • Implementation, review, and research requiring command execution all go through delegate_task, where failure reasons are visible and the path can be switched. The sub-agents that ship with the current harness are used only for read-only exploration that does not execute commands (reading files, searching): while running in the background, tools requiring approval (shell, file writes) are automatically rejected, and it can only hand back unverified changes.
  • The dispatch timing of the direction advisor (--task design,role design) is covered under the advisor trigger in "Autonomous Decision-Making". The advisor reviews the main agent's draft — checking facts, pointing out risks, offering simpler alternatives — rather than producing a plan from scratch; when the direction is already settled by consensus or the user and the change is local, implement directly.
  • Advisor tasks are read-only: "Scope" states that no files are to be changed and no write commands executed, and "Acceptance Criteria" asks only for conclusions, reasons, and the basis for rejected options; the main agent adjudicates the opinions and relays them to the implementation agent, and the implementation agent does not talk to the advisor directly.
  • Only when the user explicitly requests a new thread, use create_threads or t3_thread_launch。
  • When dispatching end-to-end verification or screenshot tasks, write the relevant constraints from the project's AGENTS.md verbatim into "Constraints", and note the scene's first start time, elapsed time, repeated-crash count, and the existing unified entry point; time limits and stop conditions accumulate across agent retries and follow the project's own rules. Before screenshotting, pre-check existing artifacts, harness entry points, and upload conditions, and prefer reusing existing infrastructure; write only verified environment facts; report failures with specific reasons and alternative evidence; release only the devices and processes owned by this task.
  • Heavy commands follow the machine's scheduling entry points and resource limits; limits come from the device configuration and are not hardcoded in this skill. Reviewers by default read only source code and existing evidence; when additional heavy checks are needed they raise a request, and the final verification owner arranges them.

Sub-agents cannot see the parent conversation, so the prompt must carry all background. Write it according to the template below:

## 背景
<项目、模块、为什么要改;已确定的方向和否决过的方案>

## 任务
<要做什么,做到哪一步为止>

## 范围
工作目录:<绝对路径>
执行环境:<目标 exec 的 shell 方言——子代理看不到父环境,必须写明;cmd.exe 填「`&&` 连接、`dir`/`type`/`findstr`/`rg`、无 `ls`/`head`/`sed`/`grep`/heredoc、含引号或多行的脚本先写临时文件再跑」,POSIX bash 填 bash>
可以改:<文件或目录>
不要碰:<文件或目录>

## 约束
<编码规范、需要用到的技能(写明技能名,例如 $git-prefs)、禁止事项(例如不要提交、不要开 PR、不要回滚已有改动)>
harness 拒绝执行工具时(例如 `Permission denied for this tool`、`was denied because this agent is running in the background`),立即停止,在回报里写明被拒的工具和命令。不要换别的工具绕过,也不要在无法验证的情况下继续改代码。

## 验证与资源
最终验证负责人:<主代理或指定验证子代理>
本任务最小检查:<准确命令及范围;不能自行扩展为全仓库构建>
留给最终负责人:<完整验证与生成步骤>
调度入口与资源需求:<已有入口、构建/设备需求、排队约定>

## 验收标准
<需要满足的行为、最小检查覆盖>

## 回报与交接
改动文件与完成步骤;实际命令、工作目录、源码状态(提交及脏改动的快照/摘要)、工具链版本、退出码、原始日志和报告路径;未完成步骤、失败原因、仍在运行的任务/进程及归属、剩余验证。
截图任务同时回报首次开始时间、累计耗时、崩溃计数与替代证据。

When a sub-agent fails

follow references/failures.md to classify the original error, verify the progress of the old attempt, and then continue.

Getting stuck on authorization does not count as a failure, and you must not wait for the user either: when the tail of the sub-thread is approval_request, or task_status has been working for a long time with no new artifacts, directly task_cancel, and re-dispatch the same task with runtimeMode:"full-access" , do not ask the user to click authorize, and do not report it as "waiting for your authorization" — the same thread will repeatedly fail on the same default mode several times in a row.

When switching paths, carry the --exclude of the entry points already tried and re-run selectwith a new PICK; no need to ask the user first, and explain it in the final report. If the script reports exceeding the 4-attempt limit per task (exit 1), stop and report to the user the entry point and failure reason of each attempt.

Acceptance and Local Review

  1. The main agent personally reads the actual diff, raw logs, and test reports, and checks that the evidence corresponds to the source code, dirty changes, toolchain, and coverage; it does not take sub-agents' self-reports at face value. When existing evidence is consistent with the final source code and covers it sufficiently, the review adopts it; when evidence is missing, the source code or toolchain has changed, or there are doubts, re-run the corresponding checks. Necessary independent behavioral verification is still performed.
  2. When it does not meet the bar, regardless of the size of the fix, create a new delegate_taskwith the original intent, findings from the previous round, responses to the fixes, unresolved objections, and complete continuation evidence; save the new taskId and wait for the completion event via async. The 4-attempt path-switching limit cannot be reset by creating a new task.
  3. Arrange review by risk: small changes are checked by the main agent; routine changes that need independent review are dispatched to route.mjs select --task review the selected reviewer (when the implementer is a consultant model named by the user, the review uses ALTERNATIVES the first other model in that set); high-risk changes use two models $code-review-panel(both reviewers are selected with --task review , the second one carrying --exclude-model <第一位 PICK 的 model=>; the same model switching harness does not count as a second reviewer, and after either one switches route the two model= must still differ) — concurrency (file locks/mutual exclusion, cross-process shared state, process or PID lifecycle and reuse, watchdog/cleanup daemons), cancellation boundaries, playback, security, or public interfaces: hit any one and it is a panel, no discretion allowed. A qualified panel is the final local review for that round; do not re-review the same diff.
  4. Subsequent rounds only recheck fixed issues, the scope of changes, and related regressions, while still fully carrying over the original intent, the previous round's findings, and unresolved objections; if new risks appear, expand the relevant review scope. Before creating a PR, first follow $pr-review-loop"Before opening a PR" to settle the template, fill in the description completely, and then create it; after creation, hand it to cloud review and $pr-review-loop, and restart the local panel only when the user requests it or the risk substantially expands.
  5. After all write tasks and generation steps have converged, the sole final verification owner completes the final full verification; existing check evidence may be reused per the step 1 conditions, without reducing overall coverage. Acceptance is complete when the final source code, necessary behavior verification, and all valid review issues have verifiable evidence.

Report

At the end, briefly explain:

  • which instance and model completed each subtask, whether a route switch occurred, and why;
  • what acceptance ran and what the results were;
  • direction decisions made autonomously and their basis (including consultant rulings).

Update models and routing rules

When the user asks to update the model reference, follow references/models.md "Update sources and standards" at the end: list the proposed changes first, and make changes only after the user confirms.

scripts/route-data.mjs is the default routing data; to change it, run node --test scripts/route.test.mjs scripts/route-config.test.mjs. The user, in ~/.config/bstack/t3-orchestrator.json , overrides model status, entry points, and candidate order (configured via bstack-setup according to references/setup.md );route.mjs reads the effective values, and if the configuration has problems, report them in the output WARN 配置。