workbench-setup

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Use the bundled Python 3.11+ installer on Linux or macOS. Native
npx skills
distributes this skill; it does not execute the installer or apply global prompts.
Orchestration's interactive Manager, native Worker ladder and configured context policy live in the
orchestrate-harnesses
skill. Window values come from base
policy.context
in the Worker configuration, not skill or role instructions. Updating that skill changes its distributed defaults, not the current Manager's interactive model/settings or the user's partial model overrides.
After global distribution, explicitly apply the setup:
sh
python3 ~/.agents/skills/workbench-setup/scripts/workbench.py install
~/.local/bin/agent-workbench status
The installer creates
~/.agents/AGENTS.md
, links Codex's
~/.codex/AGENTS.md
, and ensures
~/.claude/CLAUDE.md
has one native import resolving to the shared instructions. An existing equivalent Claude import is reused. Personal text belongs outside
<!-- BEGIN agent-workbench -->
/
<!-- END agent-workbench -->
and the optional
<!-- BEGIN agent-workbench personal -->
/
<!-- END agent-workbench personal -->
block in the shared file. When
~/.agents/skills/workbench-personal/AGENTS.md
exists, install applies it in that second block immediately after the public block; removing the package or file removes the owned personal block on install. Both blocks have ownership and drift checks; edit the package source instead of the installed personal block. Existing Codex regular-file bytes are kept outside the managed block on first installation; existing Claude text stays in its file.
agent-workbench install
reapplies distributed assets and runs thermal-guard's installer when that skill is installed. On a supported Linux sensor with user systemd it installs the
thermal
launcher and logger; unsupported machines report that condition without failing setup.
agent-workbench update
first updates installed skills owned by
onsager-ai/agent-workbench
plus
workbench-personal
from any source through the native skills lock, then runs freshly distributed setup code. Node.js 22.20+ and npx are needed for distribution and updates. Do not edit the native skills lock yourself.
When
orchestrate-harnesses
is installed,
install
(and
update
) generates one Claude Code subagent per routable tier at
~/.claude/agents/<tier>.md
. Distributed
workers.yml
, optional
~/.agents/skills/workbench-personal/workers.yml
, the partial user override (in that precedence order), and every profile contribute to this union. A tier is routable when it has
harness: claude
(using
model
) or a non-null
claude_route
. The default ladder generates haiku, sonnet and opus. The optional
codex
profile adds luna, sol and opt-in terra with null routes, so Claude Managers run them as
codex exec
Workers unless a user override supplies a gateway model ID. Change a route in the YAML override, or set it to null to remove it when no profile needs it. A tier name must use the same model, route and effort across profiles; rename conflicting tiers. Each agent carries model and effort in frontmatter and the Worker instructions as its prompt. Rerun
agent-workbench install
after edits. Without
orchestrate-harnesses
no agents are generated.
Use
agent-workbench workers --cwd PATH
to print effective JSON and the selected profile. Overrides live at
$XDG_CONFIG_HOME/agent-workbench/workers.yml
when XDG is nonempty and absolute, otherwise
~/.config/agent-workbench/workers.yml
. PyYAML is vendored; installation never invokes pip. Setup owns a resolved
workers.json
beside
state.json
and passes its path to the policy hook. The hook selects approval rules by dispatch cwd; missing or unreadable policy asks for approval and requests reinstall. Uninstall removes the unmodified owned JSON along with the agents and hook entries.
Generated agent files are recorded with content hashes in the state file. Setup never overwrites a file it does not own, or an owned file you edited, and reports a conflict instead; other files in
~/.claude/agents
are left alone.
status
lists owned agents, personal package presence and applied personal files;
uninstall
removes unmodified owned agents.
When
orchestrate-harnesses
is installed, setup adds three Claude Code
hooks.PreToolUse
entries and one
hooks.Stop
entry in
~/.claude/settings.json
, all running the installed
orchestrate-harnesses/scripts/policy-hook
. The PreToolUse entries match
Agent|Task
,
Bash
, and
mcp__t3-code__delegate_task
to require approval for Opus Workers, deny GitHub polling commands, and require explicit Worker models for built-in agents and T3 delegation. The Stop entry blocks turns that end in a prose question, directing the model to re-ask through AskUserQuestion. State records the exact entries setup added; foreign entries (including identical pre-existing ones) remain unowned. Status lists owned hooks as applied or missing; install re-adds a missing or edited owned entry and leaves the edited copy as yours, a duplicated owned entry causes a conflict, and uninstall removes only owned entries while preserving other settings and their key order.
agent-workbench uninstall
removes both managed instruction blocks and owned import/launcher, and makes Codex's file regular again with the current private text. Backups remain private under
~/.local/state/agent-workbench/backups
; uninstall never restores stale snapshots over later edits. This is the normal rollback operation. Review retained backups manually for historical recovery.
If a command reports an override, foreign entry, missing resource, or edited managed block, preserve the files and resolve that specific conflict before retrying. There is no force-overwrite mode. State and lock live under
~/.local/state/agent-workbench/
. Installation also owns
env.CLAUDE_CODE_AUTO_COMPACT_WINDOW
and optionally
env.CLAUDE_CODE_MAX_CONTEXT_TOKENS
in
~/.claude/settings.json
(replacing the earlier, unmodified
env.CLAUDE_AUTOCOMPACT_PCT_OVERRIDE
) and
model_auto_compact_token_limit
and optionally
model_context_window
in
~/.codex/config.toml
, when the respective config directory exists. It preserves other settings, including provider routing. Foreign or edited owned values conflict; missing values are reapplied. Status reports each key and uninstall removes only unmodified owned values. Compaction is advisory, not a hard request-token cap; restart running sessions to pick up changes. Installation does not edit other skills, project files, shell configuration, credentials, or permissions.
For isolated fixtures, put the skill at the canonical location under a disposable home, then pass
--home PATH
before the command. Alternate-home updates require an explicit
--skills-cmd
executable command; they never default to the real user's npx update. Native permission choices remain with the user.
在 Linux 或 macOS 上使用随附的 Python 3.11+ 安装器。原生
npx skills
仅负责分发此 skill;它不会执行安装器,也不会应用全局 prompts。
Orchestration 的交互式 Manager、原生 Worker 分层体系以及已配置的 context policy 均位于
orchestrate-harnesses
skill 中。窗口值取自 Worker 配置中的基础
policy.context
,而不是 skill 或 role instructions。更新该 skill 只会更改其分发默认值,不会更改当前 Manager 的交互式 model/settings,也不会更改用户的部分 model overrides。
完成全局分发后,请显式应用设置:
sh
python3 ~/.agents/skills/workbench-setup/scripts/workbench.py install
~/.local/bin/agent-workbench status
安装器会创建
~/.agents/AGENTS.md
,为 Codex 的
~/.codex/AGENTS.md
建立链接,并确保
~/.claude/CLAUDE.md
中有一条能够解析到共享指令的原生 import。若 Claude 中已有等效 import,则会直接复用。个人文本应放在共享文件中
<!-- BEGIN agent-workbench -->
/
<!-- END agent-workbench -->
之外,以及可选的
<!-- BEGIN agent-workbench personal -->
/
<!-- END agent-workbench personal -->
block 之外。当
~/.agents/skills/workbench-personal/AGENTS.md
存在时,install 会将其应用到第二个 block 中,紧接在 public block 之后;如果移除了 package 或该文件,后续 install 会删除受管理的 personal block。两个 block 均具有 ownership 和 drift 检查;应修改 package 源文件,而不是已安装的 personal block。首次安装时,现有 Codex 普通文件的 bytes 会保留在 managed block 之外;Claude 中已有的文本仍保留在其文件中。
agent-workbench install
会重新应用已分发的 assets,并在已安装
thermal-guard
skill 时运行其安装器。在受支持的 Linux 设备上且使用 user systemd 时,它会安装
thermal
启动器和 logger;不受支持的机器会报告该情况,但不会导致 setup 失败。
agent-workbench update
会先通过原生 skills lock 从任意来源更新由
onsager-ai/agent-workbench
拥有的已安装 skills 以及
workbench-personal
,然后运行新分发的 setup 代码。分发和更新需要 Node.js 22.20+ 和 npx。请勿自行编辑原生 skills lock。
安装
orchestrate-harnesses
后,
install
(以及
update
)会为每个可路由 tier 在
~/.claude/agents/<tier>.md
生成一个 Claude Code subagent。分发的
workers.yml
、可选的
~/.agents/skills/workbench-personal/workers.yml
、用户的部分 override(按上述优先级)以及每个 profile 都会参与生成该并集。当 tier 包含
harness: claude
(使用
model
)或非 null 的
claude_route
时,该 tier 可路由。默认 ladder 会生成 haiku、sonnet 和 opus。可选的
codex
profile 会添加 luna、sol 以及需显式启用的 terra,它们的 route 均为 null,因此 Claude Managers 会将它们作为
codex exec
Workers 运行,除非用户 override 提供了 gateway model ID。可以在 YAML override 中修改 route;若没有任何 profile 需要某个 route,也可将其设为 null 以移除该 route。同一 tier 名称在所有 profiles 中必须使用相同的 model、route 和 effort;如有冲突,请重命名相应 tiers。每个 agent 都会在 frontmatter 中记录 model 和 effort,并将 Worker instructions 作为 prompt。编辑后请重新运行
agent-workbench install
。未安装
orchestrate-harnesses
时不会生成 agents。
使用
agent-workbench workers --cwd PATH
可打印生效后的 JSON 和所选 profile。若 XDG 非空且为绝对路径,override 位于
$XDG_CONFIG_HOME/agent-workbench/workers.yml
;否则位于
~/.config/agent-workbench/workers.yml
。PyYAML 已内置;安装过程绝不会调用 pip。Setup 负责管理与
state.json
并列的已解析
workers.json
,并将其路径传给 policy hook。该 hook 根据 dispatch cwd 选择 approval rules;如果 policy 缺失或不可读,则请求 approval 并要求重新安装。Uninstall 会连同 agents 和 hook entries 一并删除未经修改的 owned JSON。
生成的 agent 文件会连同 content hashes 记录在 state file 中。Setup 绝不会覆盖非 owned 文件或用户编辑过的 owned 文件,而会报告 conflict;
~/.claude/agents
中的其他文件保持不变。
status
会列出 owned agents、personal package 是否存在以及已应用的 personal files;
uninstall
会删除未经修改的 owned agents。
安装
orchestrate-harnesses
后,Setup 会在
~/.claude/settings.json
中添加三个 Claude Code
hooks.PreToolUse
entries 和一个
hooks.Stop
entry,它们都会运行已安装的
orchestrate-harnesses/scripts/policy-hook
。三个 PreToolUse entries 分别匹配
Agent|Task
、
Bash
和
mcp__t3-code__delegate_task
,用于要求批准 Opus Workers、拒绝 GitHub polling commands,以及要求为内置 agents 和 T3 delegation 明确指定 Worker models。Stop entry 会阻止以自然语言问题结束的 turns,并指示 model 通过 AskUserQuestion 重新提问。State 会记录 Setup 添加的确切 entries;foreign entries(包括预先存在的相同 entries)仍为 unowned。Status 会将 owned hooks 列为 applied 或 missing;
install
会重新添加缺失的 owned entry,若 owned entry 已被编辑,则保留编辑后的副本并将其视为用户所有;重复的 owned entry 会引发 conflict,而
uninstall
只删除 owned entries,并保留其他 settings 及其 key order。
agent-workbench uninstall
会删除两个 managed instruction blocks 以及 owned import/launcher,并将 Codex 的文件恢复为普通文件,同时保留当前私有文本。备份以私有方式保留在
~/.local/state/agent-workbench/backups
下;uninstall 绝不会用陈旧 snapshots 覆盖后续 edits。这是正常的 rollback 操作。如需历史恢复,请手动检查保留的 backups。
如果命令报告 override、foreign entry、missing resource 或 edited managed block,请保留相关文件,并在重试前解决该具体 conflict。没有 force-overwrite 模式。State 和 lock 位于
~/.local/state/agent-workbench/
下。当相应配置目录存在时,安装过程还会管理
~/.claude/settings.json
中的
env.CLAUDE_CODE_AUTO_COMPACT_WINDOW
以及可选的
env.CLAUDE_CODE_MAX_CONTEXT_TOKENS
(替换此前未经修改的
env.CLAUDE_AUTOCOMPACT_PCT_OVERRIDE
),并管理
~/.codex/config.toml
中的
model_auto_compact_token_limit
以及可选的
model_context_window
。其他 settings(包括 provider routing)均会保留。Foreign 或已编辑的 owned values 会引发 conflict;缺失的 values 会重新应用。Status 会报告每个 key,而 uninstall 只删除未经修改的 owned values。Compaction 属于建议性设置,并非硬性的 request-token cap;请重启正在运行的 sessions 以使更改生效。安装过程不会编辑其他 skills、project files、shell configuration、credentials 或 permissions。
对于隔离的 fixtures,请将 skill 放在 disposable home 下的 canonical location,然后在命令之前传入
--home PATH
。Alternate-home 更新需要显式提供可执行的
--skills-cmd
命令;它们绝不会默认使用真实用户的 npx update。原生 permission choices 仍由用户决定。