Pular para o conteúdo principal
Z

codexskill

zhangasdfr/codexskill

Adds a Codex switch under the chat input: with it on, a session hands coding requests to the local Codex CLI, which writes the implementation prompt and reviews the result, while dsh-baton runs the work in a Harness session and returns the changed files, test results and a requirement checklist. Its HTTP routes have no DSH access check, so a web page open in your browser could call them.

Instalar

dsh plugin --profile web add github:zhangasdfr/codexskill

README

codexskill — 让 Codex 动脑,DeepSeek Harness 动手

给 DeepSeek Harness 桌面版加一个 Codex 开关:在输入框下方点亮它,之后这个会话里发的编码需求就交给 Codex 负责理解与验收——Codex 写好实现提示词,通过 dsh-baton 派给 Harness 子会话执行,跑完再核对改动文件、测试结果和逐条需求,报告回到当前对话。

你写需求  →  Codex(动脑:理解、写 prompt、验收)
                     │ dsh_send / dsh_wait
                     ▼
              DeepSeek Harness 子会话(动手:改代码、跑测试)
                     │
                     ▼
              报告回到原会话(改动文件 / 测试 / 需求对照)
  • 输入框底部多一个 Codex chip,就在「工作区内修改」右边;点亮即生效,下一条消息就走委派。
  • 开关按会话隔离,刷新页面不丢;重启 Harness 后回到关闭。
  • 关闭时插件对模型完全透明:不注入提示词、不调用 Codex。
  • 顺带注册一个 codex-delegate 技能,模型可以按需查用法和排错表。

安装

仓库是公开的,谁都能 git clone;但往仓库推送要仓库主人的 GitHub 凭据(GCM 登录一次即可)。

一键(Windows 桌面版)

git clone https://github.com/zhangasdfr/codexskill.git; cd codexskill; powershell -ExecutionPolicy Bypass -File .\install.ps1

一键(Linux / macOS)

git clone https://github.com/zhangasdfr/codexskill.git && cd codexskill && bash install.sh

脚本会:

  1. 把插件复制到 %USERPROFILE%\.dsh\profiles\desktop\plugins\dsh-codex-mode;
  2. 在 profile 的 node_modules 里建一个 junction(不用跑 pnpm);
  3. 往 %USERPROFILE%\.dsh\profiles\desktop\package.json 里补 dependencies 和 dsh.profile.bundles;
  4. 如果还没有 ~/.codex/unattended.config.toml,写一份 approval_policy = "never" 的无人值守 profile;
  5. 检查 Codex CLI 和 dsh-baton-host,缺什么就提示你补什么,最后告诉你重启 Harness。

装完重启一次 DeepSeek Harness(插件组合只在启动时读取)。重启后输入框下方就会出现 Codex。

手动 / 让 AI 帮你装

把本仓库目录作为包交给官方 plugin_manager 工具:action: install_bundle,target 传仓库的绝对路径。新装可以热加载,不用重启。

或者手工三步:复制到 ~/.dsh/profiles/desktop/plugins/dsh-codex-mode → package.json 的 dependencies 加 "dsh-codex-mode": "file:./plugins/dsh-codex-mode"、dsh.profile.bundles 追加 "dsh-codex-mode" → 重启 Harness。

卸载:powershell -ExecutionPolicy Bypass -File .\uninstall.ps1。

装好后插件会额外注册一个 codex-delegate 技能:以后在本会话里直接问「Codex 开关怎么用 / 为什么没生效 / 怎么让 Codex 动脑」时,模型会自动读这份技能(skills/codex-delegate/SKILL.md),不用你手动交代。

前置条件

需要说明
DeepSeek Harness 桌面版已登录,且至少启动过一次(生成 ~/.dsh/profiles/desktop)
Codex CLInpm i -g @openai/codex,codex --version 能跑通;额度按 ~/.codex/config.toml 里的 provider 走
无人值守 profile~/.codex/unattended.config.toml:approval_policy = "never"(安装脚本会补)
dsh-baton-host 插件在 Harness 插件市场里启用即可,它负责把 Codex 的 dsh_send 接到本机 Harness

用法

  1. 输入框下方点亮 Codex。
  2. 正常写需求发出去,例如「把登录页改成手机号验证码登录,跑通现有测试」。
  3. 本会话的模型会调用 codex_delegate;Codex 派活、等待、验收,最后把三段式报告带回来:改动文件、测试/校验结果、逐条需求对照。

配置

插件 patch(cordis.patch.yml)里的 config 可以覆盖默认值:

键默认说明
codexScript%APPDATA%\npm\node_modules\@openai\codex\bin\codex.jsCodex CLI 入口
nodePath当前跑 Harness 的 node用来启动上面的入口
profileunattendedcodex exec -p <profile>,对应 ~/.codex/<profile>.config.toml
timeoutMs3600000单次委派上限,也是 codex_delegate 的 timeoutMs

排错

现象原因 / 处理
没有 Codex chip没重启 Harness;或 profile package.json 缺 dsh-codex-mode;看 Harness 设置里的插件列表有没有加载失败
有 chip 但不走 Codexchip 只对「当前会话」生效,且状态在宿主内存里,重启后要重新点亮
codex_delegate 报找不到 Codex CLI改 cordis.patch.yml 的 config.codexScript,指向真实的 codex.js
报 dsh_send 不存在dsh-baton-host 没装/没启用;装好后重启 Harness,再新开 Codex 会话
报告写「需要人在 Harness 界面点审批」Harness 侧弹了 UI 审批(needs_input: harness-ui),MCP 无法代答;去 Harness 窗口点,或让任务留在工作区内
一直 timed_out任务太大,拆小;或调大 timeoutMs

开发

npm test      # 离线测试:假 ctx,不碰网络,不调 Codex
npm run e2e   # 端到端:真的启动 Codex,经 dsh-baton 派给 Harness(约 1 分钟)

文件:

  • lib/index.js — 宿主半:会话开关、/__dsh-codex/state 路由、codex_delegate 工具、按会话注入的提示词段、技能注册。
  • lib/client.js — 浏览器半:conversation.input.left 槽里的 Codex chip。
  • cordis.patch.yml — 往 profile 组合里插入 codex-mode 一行。
  • skills/codex-delegate/SKILL.md — 模型按需读的操作手册。
  • install.ps1 / uninstall.ps1 — Windows 一键装/卸。

License

MIT

Plugins relacionados