为 DSH 注入治理内核与责任路由,让 agent 按任务复杂度自动在研究/规划/执行/验收之间切换,避免轻任务被流程拖慢、重任务被仓促带过。
- 语言
- JavaScript
- License
- MIT
- 分支
- main
安装
$ dsh plugin --profile web add github:orziz/odai在终端中运行以上命令,通过 dsh CLI 安装此插件。可在右上角切换 Profile。 第一次用 dsh?看这篇新手教程
一句话定位
odai 是一个把治理(goal / fact / authorization / risk / acceptance)写进任务执行流的内核,给 DSH 里的 AI agent 当主控;它根据任务的复杂度、清晰度、风险、领域缺口自动调节处理深度,并按需在研究、规划、执行、验收、前端设计之间拆分责任。
核心能力
- 注入一段常驻治理 prompt,让 agent 在每次请求时按"事|实|法|成|界"五项静默判断后才动手
- 依据当前任务的复杂度、清晰度、风险与领域需求,在直接执行、同轮升级、外包子代理三种模式间自动选择
- 维护可配置的责任模型映射(researcher / planner / executor / reviewer / frontend),用户用自然语言命名 provider 与 model 后即持久化并下轮生效
- 持久化输出形态(normal / 软精简 / 经济模式)、压缩摘要模型、技能来源(bundled / auto / user)与语义记忆,全部写在
$DSH_HOME/odai/下的对应 JSON 文件 - 注册
odai_routing_config、odai_route_card、odai_output_config、odai_compaction_config、odai_memory等工具,让控制器在不修改宿主文件的前提下读取和修改自身治理状态 - 提供 skill 自演化叠加层,用户在不重装包的情况下替换治理 markdown 内容;每次替换都留下 base/result 代际记录和血缘关系
技术实现
- 语言: JavaScript(Node.js ESM
.mjs),无构建步骤 - 关键依赖:
@deepseek-ai/dsh(peerDependency,作为 DSH Cordis 宿主;optional 标记)、node:cryptonode:fsnode:pathnode:os(内置模块),独立yaml仅用于 Agent 安装器(dsh/agent/package.json:48-50) - 架构模式: 通过 DSH 的 Cordis patch bundle(
dsh/plugin/cordis.patch.yml:1-7)向宿主注册一个名为odai-governance的插件,注入点为systemPrompt / tools / subagents / sessions(dsh/runtime/src/index.mjs:95-96);运行时挂载多个 ctx.on 钩子(system-prompt/assemble、agent/pre-step、agent/request、agent/turn-stopping、session/event、tools/result、llm/stream)实现治理与路由 - 入口文件:
dsh/runtime/src/index.mjs(通过dsh/plugin/cordis.patch.yml挂载;package.json:16的 main 与 exports 也指向同一文件)
适用场景
适合让 DSH agent 处理真实项目改动、又不想让它带着虚假确定性乱冲的人:原版宿主在面对模糊、跨能力、高风险任务时容易直接动手或流于仪式。odai 把"先看清事实、再选最短充分路径、做完要靠证据"固化为可复用治理,同时保证琐碎请求不被流程拖慢。它在保留宿主默认模型的前提下工作,用户不需要预先指定每个责任用什么模型。
前置依赖与兼容性
| 依赖 | 最低版本 | 说明 |
|---|---|---|
| DeepSeek Harness (dsh) | 0.1.0-rc.6 | 两个包均以 optional peerDependency 形式声明 @deepseek-ai/dsh@0.1.0-rc.6;Agent 安装器在 dsh -V 输出版本不等于该值时直接拒绝 |
| Node.js | >=22.15.0 | 两个 package.json#engines.node 均声明该下限 |
| pnpm | 未声明具体版本 | Plugin 安装命令会调用 pnpm,要求 pnpm 在 PATH 中 |
| 平台 | 跨平台 | 未声明 os / cpu 限制;plugin 在所有 DSH 支持平台生效 |
| 原生模块 | 无 | 全部依赖 Node.js 内置模块或可选 peer 提供的宿主 |
安装方式
dsh plugin --profile web add github:orziz/odai
配置项
| 配置 | 类型 | 说明 | 默认值 |
|---|---|---|---|
routing.mode | 字符串(off/observe/auto/execute) | 责任路由模式:off 完全关闭;observe 只观察不执行;auto 由路由表决定;execute 总是执行 | auto |
routing.provider | 字符串 | 实际生成子代理时使用的 provider id | spawn |
routing.maxInputChars | 整数(≥256) | 每次路由决定时截取任务文本的最大字符数 | 12000 |
routing.configPath | 路径字符串 | 用户责任模型映射的持久化 JSON 路径 | $DSH_HOME/odai/routing.json |
routing.roles.{researcher,planner,executor,reviewer,frontend} | 对象 | 每个角色对应的 provider/model,可选 reasoningEffort/maxTokens | 未配置时由 odai_routing_config 工具写入 |
governance.additionalDeniedTools | 字符串数组 | 在内置黑名单之外再禁用的工具名 | [] |
governance.skillSource | 字符串(bundled/auto/user) | 技能来源优先级;bundled 锁定包内 skill,auto/user 由 odai_skill_source_config 切换 | bundled |
governance.skillConfigPath | 路径字符串 | 技能来源持久化文件 | $DSH_HOME/odai/source.json |
governance.evolutionRoot | 路径字符串 | 用户技能自演化叠加层根目录 | $DSH_HOME/odai/skill-evolution |
output.configPath | 路径字符串 | 输出形态持久化 JSON 路径 | $DSH_HOME/odai/output.json |
compaction.configPath | 路径字符串 | 压缩摘要模型持久化 JSON 路径 | $DSH_HOME/odai/compaction.json |
compaction.cacheRetention | 字符串(provider-default/short/long/none) | 压缩请求里 prompt-cache 留存策略 | provider-default |
memory.mode | 字符串(auto/off) | 语义记忆是否在每个 controller 步骤自动激活 | auto |
memory.storePath | 路径字符串 | 语义记忆持久化 JSON 路径 | $DSH_HOME/odai/memory/store.json |
memory.maxRetrieved | 整数(1–12) | 每个轮注入上下文的最大记忆条数 | 6 |
skillPath | 路径字符串 | 显式覆盖默认的 canonical skill 路径;不设置时使用 bundled skill | 由 ODAI_SKILL_PATH 或包内位置自动解析 |
配置项也可以不写在 cordis.patch.yml 里,而是由 odai_routing_config、odai_output_config、odai_compaction_config、odai_skill_source_config、odai_memory 这些工具在用户提出自然语言请求时自动持久化。
常见问题
Q: 安装后必须重启 DSH 会话才生效吗?
A: 需要。Plugin 是 profile 级 bundle,安装完后必须重启当前 DSH 进程、再用该 profile 开新会话才能拿到治理注入;当前会话仍按宿主默认行为运行。
Q: 装上以后每个简单问题都会被流程拖慢吗?
A: 不会。运行时会先做一道轻任务闸门:结果、动作、路径、授权、验证都已清楚且低风险时直接执行;只有前提可疑、范围冲突、跨层权衡或高风险副作用出现时才展开。
Q: 需要我手动指定规划或执行用的模型吗?
A: 不需要。两包都默认 routing.mode=auto,宿主默认模型就够完成的任务不会自作主张切换;只有用户用自然语言明确指定"规划用 provider/model,推理档 high"才会被持久化到 $DSH_HOME/odai/routing.json,下个用户轮生效。Odai 不会主动帮你选模型。
Q: 哪些状态会写入本地?
A: 路由映射、输出模式、压缩模型、技能来源、技能自演化内容分别写入 $DSH_HOME/odai/ 下的 routing.json、output.json、compaction.json、source.json、skill-evolution/;语义记忆写入 memory/store.json。这些目录由 Agent 与 Plugin 共享,卸载任何一个包时不会被自动清理。
Q: 安装 odai-dsh-plugin 后还需要装 odai-dsh-agent 吗?
A: 通常不需要。Plugin 已自带 canonical skill 与 DSH runtime,覆盖整个 profile;Agent 是按 session 选择 Odai preset 的独立形态。两者刻意共存时共用同一份快照,常规同时安装属冗余,只在用户明确想组合两种作用域时才需要。
Q: 升级或卸载前需要先停掉 DSH 吗?
A: 需要。Plugin 的 repair-sessions 子命令和 Agent 的 install/update/uninstall 都会主动确认 DSH 进程已停止;本地进程检查失败或发现仍在运行的 DSH 时直接拒绝。
Q: 经济模式(economy)的 token ceiling 一定能生效吗?
A: 不一定。运行时只把用户指定的 maxTokens 通过 DSH 透传给 provider,无法强制 provider 遵守:实际用量可能包含隐藏推理、超过请求值,或在拿到完整文本前结束。要严格核算必须用宿主返回的真实 usage 数据。
上手难度
进阶 — 需要理解 DSH 的 profile、Plugin 与 Agent 概念,以及 $DSH_HOME/odai/ 下多份 JSON 的含义;想自己写治理 skill 还得熟悉 skills/odai/ 下的 SKILL.md 与六份 references。普通用户用默认配置直接 /odai 即可,但调整路由、压缩或技能来源时要看懂配置项与持久化路径。
已知问题与限制
- 当持久化的 routing / output / compaction / memory 配置文件损坏或字段不合法时,运行时不会强行恢复,只会输出 warning 并退回宿主默认路由;若一个高影响路由因此缺失,控制器会被设为只读(fail closed)而不是假装成功(
dsh/runtime/src/index.mjs:556-557、673-680、706-714) compaction.cacheRetention设为short/long/none时仍是请求级建议;若上游 provider 不支持或选择忽略,DSH 仍按自身默认落地,无法强制(dsh/README.md:55)odai/cli是 provider-neutral 独立产品,不属于本次 DSH 集成;不要把它和odai-dsh-plugin、odai-dsh-agent混用(dsh/README.md:11)- Agent 安装器对
dsh版本是硬匹配,不支持>=范围;当前只接受dsh@0.1.0-rc.6,升级 DSH 必须同步刷新 Agent preset 与两个包的版本(dsh/agent/bin/odai-dsh-agent.mjs:52-63) - 同时安装 Plugin 与 Agent 时两者共用同一份 per-agent/per-turn 快照;prompt 治理和路由 role contract 不能各自选不同的 skill bundle(
README.md:94) - 用户语义记忆由 Plugin 与 Agent 共享,且 Agent 的 install/update/uninstall 与 Plugin 的 update 都不会管理或删除
$DSH_HOME/odai/memory/;卸载前需自行备份或清空(dsh/README.md:45) odai-repair-sessions在本地进程检查失败或检测到 DSH 仍在运行时直接拒绝,不留模糊地带;必须在 DSH 完全停止后才能跑(dsh/plugin/README.md:25-27)
English · 中文
odai
odai is a governance-powered general task-execution framework for AI agents.
It embeds governance into execution: align the real objective, facts, assumptions, authorization, risks, and acceptance; then choose the shortest sufficient path, combine the right capabilities, act, verify, and keep moving until the task is genuinely deliverable. It does not replace the model's judgment with a rigid workflow.
The short version: call /odai; governance stays nearly invisible on simple work, while ambiguity, complexity, risk, and domain needs automatically increase or reduce the depth of handling.
Why Use It
odai is for people who want agents to move with autonomy, but not with false confidence.
It helps an agent:
- ask only when the missing answer would change the goal, scope, authorization, acceptance, risk, or stop line
- verify what it can verify from files, commands, logs, tests, or project context before asking you
- keep lightweight tasks lightweight instead of turning every request into ceremony
- avoid claiming that something was tested, delegated, reviewed, or verified when it was not
- combine specialist skills and domain guidance only when the task needs them, instead of stuffing every rule into every turn
- reuse existing host or project memory, persisting only durable information with provenance, scope, and invalidation conditions
The Dao of odai
The user defines the task; evidence determines the route; methods adapt to circumstances; verification determines completion; boundaries determine where to stop—get the task done, without acting presumptuously.
This is not a collage of philosophical schools. It is one decision rule:
- Get the task done: advance the user's task to a verified, deliverable result, while surfacing counterexamples, risks, and a better route when they would change the outcome.
- Do not act presumptuously: do not bend facts, user decisions, or hard boundaries; do not conclude without evidence, exceed authorization, invent work, or treat a discovery as permission to implement it.
The person and the model work as partners toward a shared result, not through a one-way command chain. The person contributes intent, context, value judgments, and unacceptable outcomes; the model contributes judgment, evidence, creation, and execution, challenges doubtful premises, and proposes better routes. Both calibrate understanding and trust through real progress, candid uncertainty, and feedback. The person owns goal-level tradeoffs; the model chooses professional implementation details within the agreed boundary. Authorization is not blind obedience, and challenge is not a takeover.
odai is neither an echo of the user nor a reciter of rules. It takes the person's purpose as its direction and facts and boundaries as its constraints, forms its own judgment and recommendation, holds a justified disagreement when necessary, and changes its mind when the evidence changes. Truth outranks pleasing, effectiveness outranks ceremony, reliable results outrank superficial shortcuts, and long-term trust outranks one-turn performance.
The model's initiative is judged by net value. Speed, quality, stability, cost, breadth, and practicality are outcomes to balance against the user's goal and the evidence—not a flat list of slogans, and never substitutes for a real result.
Operating Standard
See clearly, hold steadily, strike accurately, land real results, defend what matters, and build for the long run.
Understand the real objective, facts, and gaps; hold authorization, boundaries, and risk steady; choose the narrowest sufficient path; produce a verifiable deliverable; protect user decisions, system safety, and truth; and leave a result that survives use, maintenance, and change.
Product Goal
Make agents faster, more accurate, better, steadier, cheaper, lighter, broader, more adaptive, more useful, and more practical. These are not independent process targets. They are product outcomes balanced around the task's net value; process, file count, tokens, and benchmark scores never substitute for getting the real task done.
30-Second Start
Install the unified entry point:
npx skills add https://github.com/orziz/odai --skill odai
Then invoke it with /odai. That is the normal form in clients that expose skills as slash commands:
/odai update the onboarding flow copy.
Goal: make it clearer for first-time users.
Materials: current app files and README.
Constraints: do not change behavior yet; give me the proposed copy and risks first.
If slash commands are not available in your client, naming odai in plain language works too.
You do not need to know the internal structure or choose a methodology. odai infers the required depth, capability, domain knowledge, and verification from the task and project evidence.
DeepSeek Harness packages
DSH users can install either integration independently:
# Apply Odai to every agent preset in one profile
dsh plugin --profile web add odai-dsh-plugin
# Install a selectable, session-scoped Odai Agent preset
npx odai-dsh-agent install
The Plugin command requires pnpm on PATH; the Agent installer currently requires dsh@0.1.0-rc.6. Each package already includes the canonical Odai skill and shared DSH runtime, and existing installations keep that bundled skill as the default. The Agent preserves every capability from the pinned DSH Standard preset and adds Odai as a scoped extension. Plugin needs neither a separate skill nor Agent; Agent needs neither a separate skill nor Plugin. Choose Plugin for profile-wide behavior or Agent for a selectable preset. Installing both is normally redundant and is only for a deliberate combination of those scopes. The existing provider-neutral odai-cli remains a separate product.
Both DSH packages default output to soft concise. Users can explicitly select normal output or the optional economy mode, which combines concise presentation with a user-adjustable provider output ceiling: it defaults to 500 when economy is requested without another value. The ceiling never changes child-agent, compaction, checkpoint, or internal context budgets and may be exceeded or ignored by the provider. See dsh/README.md for the complete three-mode contract.
A complete independently installed Odai skill can update faster than either DSH package without changing the default. The user must explicitly ask Odai to switch the skill source to auto or user; auto can select compatible project .dsh/.agents bundles and newer user installs, while user ignores project roots. An explicit deployment path remains highest priority. Plugin and Agent deliberately installed together share one per-agent/per-turn snapshot, so prompt governance and routing role contracts cannot select different bundles.
Neither DSH package chooses planner, executor, or reviewer models. Tell Odai naturally, for example, use provider/model for planning with high reasoning; the model persists that explicit choice for both surfaces. If a needed responsibility is still unconfigured, Odai names it and asks for the model instead of claiming that route ran.
See dsh/README.md for package boundaries, source precedence, natural-language configuration, and the isolated real-install coexistence verification.
Host Capability Routing
The user identifies who should own each responsibility once, or lets odai recommend a mapping from the host's real capability catalog. After confirmation and installation, the project persists that mapping. Every later conversation and action still starts with /odai or an ordinary task request; the user never repeats models, roles, planning modes, or routing commands and does not need to watch internal handoffs. When models change, update the mapping once in place.
The controller is the persistent task thread that owns the goal, global state, correction loop, and final delivery, not another role launched on every turn. Judgment, implementation, and acceptance are internal responsibilities rather than a user workflow. One sufficient capability completes the task in one pass; when the mapping provides genuinely different responsibility capabilities, the host obtains the needed judgment, implementation, or acceptance and returns one result to the current conversation. Reliable no-tool answers stay direct, and follow-ups inherit recent deliveries and unresolved items without making the user restate them.
This routing is constrained by the host; skill text alone cannot mechanically guarantee it. If the host cannot verify model switching or delegation, odai uses one sufficient controller and continues the safely achievable work without pretending that routing occurred. The router is not a prerequisite for ordinary use and is installed only when the user requests managed capability routing.
Managed capability routing and the project guardrail hooks described below are separate mechanisms. Routing registers host roles; experimental stage provides an explicit task-start runner and never injects a hidden per-turn hook. Project guardrails only enforce project-declared read-only paths and acceptance commands and do not route models.
Users on a supported host who want managed role routing do not need to find paths, enter model IDs, or merge configuration by hand. After installing the skill, say:
/odai install and verify capability routing for this project.
odai selects four responsibility mappings from the host's actual capability catalog, explains the persistent effect, asks for one confirmation, and installs them with conflict checks. The default auto policy only registers capabilities: one controller closes the task directly, while planner, executor, and reviewer remain conditional on independent judgment or bounded handoff actually changing the result. It adds no hidden per-turn preflight. Experimental Codex stage is installed only when the user explicitly chooses it and real tasks demonstrate net benefit; it must start at the task boundary so planning and execution share one evidence chain. Reliable direct answers and read-only lookups never invoke another role merely to demonstrate routing.
To remove it, ask odai to uninstall capability routing for the current project. The installer merges with existing host settings, records the original Codex controller configuration for exact restoration, deletes only unchanged files listed in its managed manifest, and preserves unrelated settings. Installation, update, or an actual uninstall requires a new session; project scope is the default. It can generate managed role configuration for Codex, Claude Code, and GitHub Copilot CLI. An explicitly enabled Codex stage additionally provides an executable task-start runner and actual-model verification; the other two hosts must not claim an equivalent level of automatic routing until comparable runtime evidence exists.
When stage is explicitly enabled, .codex/odai-run-routing.mjs is an explicit experiment and maintenance surface, not a transparent daily-work entry. Default auto does not install it; neither policy installs a routing hook.
How It Decides
odai continuously evaluates four dimensions:
- Complexity: direct action, a small amount of structure, staged execution, or durable task state and trusted memory.
- Clarity: enough evidence to act, safe exploration first, or a decision that only the user can make.
- Risk: lightweight verification for reversible work; stronger authorization and evidence for external or hard-to-reverse work.
- Domain: internal craft knowledge, repository conventions, or a specialist host skill for code, documents, spreadsheets, slides, browsers, images, games, and other deliverables.
Before loading any playbook, it applies a silent light-task gate. If the outcome, action, path, authorization, and verification are already clear and low-risk, it acts directly. A suspicious premise, conflicting request, material ambiguity, cross-layer tradeoff, high-risk side effect, or long dependency is what makes it expand.
Depth is not fixed at the start. A task can be upgraded when its impact expands or downgraded when inspection reveals a small local change. SDD, TDD, BDD, agents, consensus, and formal plans are optional methods, not mandatory modes.
Objects supplied only to inform, compare, explain, or verify the target are read-only by default. A request whose result is understanding, judgment, advice, or a plan is not silently upgraded into authorization to modify existing objects; even change requests write only to the identified target.
The point is not to slow the agent down. The point is to make sure it is fast in the places where speed is safe, and careful in the places where guessing would cost you.
Architecture Logic
user task
|
v
+---------------------------------------------+
| /odai -> lightweight adaptive kernel |
| understand -> choose next valuable action |
+---------------------+-----------------------+
|
+---------------------+-----------------------+
| | |
v v v
direct action internal capability host skill / tool
+ domain knowledge + project rules
| | |
+---------------------+-----------------------+
v
act -> verify -> deliver
|
new evidence updates the path
Only complex or long-running work loads durable state,
trusted memory, agent coordination, independent challenge, or consensus;
existing memory stays authoritative instead of being mirrored.
The framework owns the task from understanding through delivery. Six flat references provide only the boundary, craft, executable planning and durable handoff, verification, support, or external capability guidance needed at the moment; there is no separate orchestrator workflow or user-selected domain package.
odai's complete capability is not just its entry text. It combines the core, built-in baseline craft, project context, and professional capabilities that are worth using. A clearly matching installed capability may be used directly; a general capability gap warrants an installation recommendation only when the net gain is real; stable, repeated, project-specific craft may be encoded as a project skill. Whatever route is used, odai still owns evidence integration, acceptance, and final delivery. Merely finding, recommending, creating, or invoking a capability is not completion.
Internal Map
The internal structure is organized by responsibility, not by mandatory stages:
| Layer | Purpose |
|---|---|
| Kernel | Core principle, adaptive progression, minimum boundaries, and loading map |
dao.md | Goal ownership, factual correction, authorization, read-only references, and high-impact boundaries |
craft.md | Lightweight planning, implementation, design, UI and real-time interaction, writing, and review |
planning.md | Executable engineering plans, requirement coverage, work-package dependencies, durable handoffs, and recovery order |
verification.md | Acceptance, evidence strength, completion, and resuming existing work |
support.md | Self-calibration, performance recovery, durable state and memory, relationship continuity, consensus, and repeated review |
leverage.md | Capability escalation and delegation, external capability discovery, net-benefit decisions, installation, creation, composition, and agent collaboration |
Domain depth is inferred from the task instead of selected as a package. Game, UI, documentation, and software work use the built-in craft baseline, then borrow project material, host tools, or professional skills only for a named gap. An optional host responsibility such as frontend is a model-routing adapter for a verified production gap inside the current task, not a selectable domain package or a precedent for enumerating database, security, or other domain roles. Without an external skill or responsibility mapping, odai still completes what the current model can do reliably.
Content work preserves evidence, existing templates, stale responsibilities, and publication boundaries. Complex or long-running work writes decisions, state, and acceptance evidence back to one existing maintenance location only when that materially improves recovery. Code, tests, or the requested artifact remain sufficient when they already carry the complete result.
Good Prompts
Use the level of detail you actually have:
/odai handle this. Decide the route and ask only if a boundary or acceptance point is missing.
/odai review the current diff. Report findings first and do not modify files.
/odai refresh this repository README. Remove outdated screenshots and keep the install path clear.
/odai this task is user-facing. Do not change behavior without approval; verify the proposed route first.
Install Options
Most users only need the unified entry point:
npx skills add https://github.com/orziz/odai --skill odai
Other supported installs:
# Install every skill in this repository
npx skills add https://github.com/orziz/odai --all
# Install the slimmer branch
npx skills add https://github.com/orziz/odai#mini
# Install the older "one skill per ability" layout
npx skills add https://github.com/orziz/odai#old
Use old only if you still depend on the previous standalone skill layout or are comparing a migration.
Canonical source lives in skills/. Distribution is handled through the skills.sh install flow; this repository no longer keeps per-platform mirror outputs. See MAINTAINING.md for the current source, validation, freeze, and release rules, and CHANGELOG.md for frozen architecture changes.
Codex Pets
This repository includes two optional, complementary Codex v2 desktop pets rather than two simple recolors:
| Pet | Character | Personality | Role |
|---|---|---|---|
Dai (dai) | Black-and-teal operations officer | Calm, reliable, restrained | Moves the task forward, executes, verifies, and closes the work |
Odai (odai) | Silver-white and blue-violet mascot | Lively, friendly, curious | Keeps you company, reacts to progress, cheers you on, and celebrates completion |
Dai gets the work done; Odai makes the process feel accompanied. Each includes nine standard animations and 16 look directions. Installing the odai skill does not install either pet automatically.
See the separate character bibles for Dai and Odai.
From a cloned or downloaded copy, choose a pet and copy its two runtime files into the matching Codex pet directory.
Windows PowerShell (odai; replace both occurrences with dai for the black version):
$petName = "odai"
$petDir = Join-Path $env:USERPROFILE ".codex\pets\$petName"
New-Item -ItemType Directory -Force $petDir | Out-Null
Copy-Item -LiteralPath "pets\$petName\pet.json","pets\$petName\spritesheet.webp" -Destination $petDir -Force
macOS or Linux:
pet_name="odai" # use "dai" for the black version
mkdir -p "$HOME/.codex/pets/$pet_name"
cp "pets/$pet_name/pet.json" "pets/$pet_name/spritesheet.webp" "$HOME/.codex/pets/$pet_name/"
Then open Codex Settings → Pets, refresh the list, and select dai or odai. You can also open the pet picker with /pet. See the dai package README or odai package README for previews and format details.
Optional Hook Guardrails
The skill supplies judgment; hooks only turn already-explicit project boundaries into mechanical guardrails. They are not installed or enabled by default and do not change odai's main flow. Once a project defines .odai/hooks.json, they can protect explicit read-only paths and run explicitly declared acceptance commands that match the current change. With no policy file, they are silent no-ops.
These are the only per-turn hooks managed by odai. The capability-routing installer does not install hooks and cannot substitute for project guardrails.
The repository keeps one dependency-free runtime and generates native host adapters on demand instead of maintaining six platform mirrors:
node skills/odai/scripts/build-hooks.mjs --host all --out /tmp/odai-hooks
Replace all with codex, claude, copilot, gemini, grok, or kimi when only one adapter is needed. Each output contains an ADAPTER.json describing its install form. Start from skills/odai/assets/hooks-policy.example.json, adapt it to project evidence, and place the result at <project>/.odai/hooks.json.
| Host | Pre-write read-only protection | Declared acceptance before closure |
|---|---|---|
| Codex | PreToolUse | Stop |
| Claude Code | PreToolUse | Stop |
| GitHub Copilot | preToolUse | agentStop |
| Gemini CLI | BeforeTool | AfterAgent |
| Grok Build | PreToolUse | — |
| Kimi Code CLI | PreToolUse | Stop |
Grok Build currently exposes PreToolUse as the blocking boundary, so its adapter does not pretend that Stop validation is enforceable. The runtime checks structured write tools and project-declared commands only. It does not parse arbitrary shell writes or infer user intent, target files, or test strategy. Hooks are a lightweight fuse alongside host permissions, sandboxing, and human confirmation—not a complete security boundary. Review the generated adapter and .odai/hooks.json before enabling them.
Evaluation
The current results cover 19 realistic full-plan tasks and a 13-task paired A/B subset. Only two cases are explicit low-risk controls. The rest present natural symptoms, opinions, or broad requests; the decisive facts live in project code, logs, briefs, diffs, task state, and runbooks. Fingerprints preserve exact reproducibility; unrelated routing assets or maintenance edits do not invalidate an entire result table when the prompt, fixture, model configuration, scoring semantics, and case-relevant skill behavior remain equivalent. Gemini 3.7 and DeepSeek V4 Pro (DSH) ran under the cross-platform odai-canary-isolation/v1 contract; the other published rows predate that contract and are retained as historical capability evidence.
Each result first receives a 0-4 completion score, then the predefined case weight is applied. The full plan is worth 144 points and the A/B subset 96. Direct, judgment, complex, and boundary work are reported separately, while severe scope, production-risk, and false-verification violations have hard score caps. A perfect treatment score alone is not evidence of value; it must be read against the same model's control result and cost.
| Runner | full on | A/B on | A/B off | gain | A/B runner tokens on / off |
|---|---|---|---|---|---|
| GPT-5.6-sol / high | 144/144 | 96/96 | 80/96 | +16 | 396,899 / 317,761 (+24.9%) |
| Claude Opus 5 | 144/144 | 96/96 | 77/96 | +19 | 2,273,558 / 1,937,782 (+17.3%) |
| Grok 4.6 / default high | 144/144 | 96/96 | 67/96 | +29 | 2,236,506 / 1,285,461 (+74.0%) |
| Grok 4.5 | 144/144 | 96/96 | 69/96 | +27 | 1,579,533 / 1,054,670 (+49.8%) |
| Gemini 3.7 Flash High | 134/144 | 88/96 | 72/96 | +16 | 1,813,203 / 1,580,475 (+14.7%) |
| Gemini 3.6 Flash High | 126/144 | 82/96 | 67/96 | +15 | 1,381,447 / 2,235,193 (-38.2%) |
| Kimi K3 | 144/144 | 96/96 | 75/96 | +21 | 2,192,056 / 1,632,057 (+34.3%) |
| DeepSeek V4 Pro / max (DSH) | 144/144 | 96/96 | 63/96 | +33 | 2,131,373 / 1,652,030 (+29.0%) |
| DeepSeek V4 Flash | 144/144 | 96/96 | 61/96 | +35 | 5,341,138 / 3,975,731 (+34.3%) |
All nine runners produced a positive paired gain. Every runner except the two Gemini versions reached full on scores in both the full suite and A/B subset. Eight runners used more tokens with odai, while Gemini 3.6 used 38.2% fewer, so both quality gains and cost changes remain model-dependent—not unconditional improvement or token savings.
See docs/evaluation.md for the current contract, docs/evaluation-results.md for model full-suite/A-B scores and token details, and docs/routing-results.md for optional host-routing quality, role usage, latency, and cost experiments.
Stars and PRs are welcome.