Skip to content

J-XZ/delegate_codex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Delegate Codex Skills

English | 中文

English

A small set of Codex skills for supervising weaker code-editing agents.

The workflow is:

delegate-plan
  -> worker edits/tests
  -> delegate-review
  -> worker continues if needed
  -> delegate-review
  -> delegate-commit

Skills

delegate-plan(委派·任务规划)

Use this at the start of a delegated coding task.

It creates:

/tmp/PLAN_<task_suffix>.md
/tmp/work_<task_suffix>.md

Both files are written in English. The chat reply includes a Chinese translation for review and an English Worker Execution Command block for a new worker session.

delegate-review(委派·成果审查)

Use this after the worker has completed a round of edits.

It reads:

/tmp/PLAN_<task_suffix>.md
/tmp/WORKER_REPORT_<task_suffix>.md
/tmp/<task_suffix>/

It verifies the repository diff, reports, and test artifacts. If more worker action is needed, it writes the next English prompt to:

/tmp/work_<task_suffix>.md

The chat reply includes a Chinese translation and an English Worker Execution Command when more work is needed. If no further work is needed, it replies exactly:

无需修改

delegate-commit(委派·整理提交)

Use this only when you explicitly want a commit.

It reads suffixed /tmp handoff files for context only, deletes multi-round delegation test artifacts under /tmp, cleans obvious repository temporary files, checks git status/diff/submodules, then commits with a Chinese git commit -m message.

It never writes files under /tmp. It never runs git push.

File Protocol

Every task uses a task suffix to support concurrent work:

/tmp/PLAN_<task_suffix>.md
/tmp/work_<task_suffix>.md
/tmp/WORKER_REPORT_<task_suffix>.md
/tmp/<task_suffix>/

Examples:

/tmp/PLAN_trace_e2e.md
/tmp/work_trace_e2e.md
/tmp/WORKER_REPORT_trace_e2e.md
/tmp/trace_e2e/

If a worker must run tests, scripts, benchmarks, trace generation, or e2e jobs, all logs and result artifacts must be written under /tmp/<task_suffix>/. The exact paths must be recorded in the plan or work file so the review skill can verify them later.

Installation

Install the skills into the user-level Codex skill directory:

$HOME/.agents/skills

Run:

chmod +x install.sh
./install.sh

See INSTALL.md for install options.

Then restart Codex if needed and check:

/skills

All three skills are configured with:

policy:
  allow_implicit_invocation: false

Use explicit invocation:

$delegate-plan
$delegate-review
$delegate-commit

Worker Handoff

After delegate-plan or delegate-review (when more work is needed), the chat reply ends with an English Worker Execution Command block. Copy that block into a new worker agent session in the target repository.

Typical flow:

1. $delegate-plan        -> review Chinese translation + copy English Worker Execution Command
2. new worker session    -> paste the English command, worker edits/tests
3. $delegate-review      -> review results; copy next English command if needed
4. repeat 2-3 until 无需修改
5. $delegate-commit      -> clean and commit

Example worker command shape (actual suffix and repo path are filled in by the skill):

task_suffix=trace_e2e

You are the worker agent. Read and execute in order:
1. /tmp/PLAN_trace_e2e.md
2. /tmp/work_trace_e2e.md
3. Relevant AGENTS.md and project docs in /path/to/repo

Fresh-read rule (mandatory before any edit or test):
- Use your Read tool to load the current on-disk contents of every path above and every repo file you will touch.
- Do not rely on conversation memory, prior-session summaries, or cached understanding.

Rules:
- Implement and test per /tmp/work_trace_e2e.md only.
- Never write /tmp/PLAN_trace_e2e.md or /tmp/work_trace_e2e.md.
- Write your English report to /tmp/WORKER_REPORT_trace_e2e.md.
- Put test logs and artifacts under /tmp/trace_e2e/ and list exact paths in the report.
- Use git status and git diff only; do not git add, commit, or push.
- Report honest per-item status: Done / Partial / Blocked / Not Started.
cd /path/to/repo && task_suffix=trace_e2e

Example

Planning:

$delegate-plan

task_suffix=trace_e2e
Task:
Add an e2e trace runner and tests.

Review:

$delegate-review

task_suffix=trace_e2e
Review the worker changes and test results.

Commit:

$delegate-commit

task_suffix=trace_e2e
Clean useless temporary files and commit current changes with a Chinese git commit -m summary.

Safety

  • Planning and review skills must not commit.
  • Commit skill must not write under /tmp or push.
  • Worker agents must not write PLAN or work files.
  • Worker agents must re-read handoff files and project docs from disk (Read tool) before acting; do not reuse conversation memory.
  • Worker agents must write reports and test artifacts to suffixed /tmp paths.
  • Submodule dirtiness must be checked before commit.
  • Temporary files should be deleted only when their purpose is clear.

中文说明

这是一组用于委派监督较弱代码编辑 agent 的 Codex skills(delegate-*)。

整体流程是:

delegate-plan
  -> worker 修改和测试
  -> delegate-review
  -> 如有必要,worker 继续修改
  -> delegate-review
  -> delegate-commit

Skills

delegate-plan(委派·任务规划)

用于任务第一轮规划。

它会创建:

/tmp/PLAN_<task_suffix>.md
/tmp/work_<task_suffix>.md

这两个文件都使用英文。对话回复包含中文翻译供审阅,以及英文 Worker Execution Command(可直接复制到 worker 会话)。

delegate-review(委派·成果审查)

用于 worker 完成一轮修改之后。

它会读取:

/tmp/PLAN_<task_suffix>.md
/tmp/WORKER_REPORT_<task_suffix>.md
/tmp/<task_suffix>/

它会校验仓库 diff、worker 报告和测试产物。如果还需要继续修改,它会把下一轮英文 worker prompt 写入:

/tmp/work_<task_suffix>.md

若还需继续修改,对话回复包含中文翻译和英文 Worker Execution Command。如果不需要继续修改,它只返回:

无需修改

delegate-commit(委派·整理提交)

只在你明确要求提交代码时使用。

它只读取 /tmp 下的委派交接文件作上下文,删除多轮测试产生的 /tmp 临时产物,清理仓库内明显临时文件,检查 git status、diff 和子模块状态,然后用中文 git commit -m 提交。

它不在 /tmp 下写入任何文件,也永远不执行 git push

文件协议

每个任务都使用一个 task suffix,以支持并发任务:

/tmp/PLAN_<task_suffix>.md
/tmp/work_<task_suffix>.md
/tmp/WORKER_REPORT_<task_suffix>.md
/tmp/<task_suffix>/

示例:

/tmp/PLAN_trace_e2e.md
/tmp/work_trace_e2e.md
/tmp/WORKER_REPORT_trace_e2e.md
/tmp/trace_e2e/

如果 worker 需要执行测试、脚本、benchmark、trace 生成或 e2e 任务,所有日志和结果产物都必须写入 /tmp/<task_suffix>/。具体路径必须记录在 plan 或 work 文件中,方便 review skill 后续独立校验。

安装

安装到用户级 Codex skill 目录:

$HOME/.agents/skills

运行:

chmod +x install.sh
./install.sh

安装选项见 INSTALL.md

必要时重启 Codex,然后检查:

/skills

三个 skill 都设置为:

policy:
  allow_implicit_invocation: false

所以需要显式调用:

$delegate-plan
$delegate-review
$delegate-commit

工作者交接

delegate-plandelegate-review(仍需继续时)会在对话末尾输出英文 Worker Execution Command。复制该块到目标仓库的新 worker 会话即可执行。

典型流程:

1. $delegate-plan        -> 审阅中文翻译 + 复制英文 Worker Execution Command
2. 新建 worker 会话      -> 粘贴命令,worker 修改/测试
3. $delegate-review      -> 审查结果;如需继续则复制下一轮命令
4. 重复 2-3 直到返回 无需修改
5. $delegate-commit      -> 清理并提交

示例

规划:

$delegate-plan

task_suffix=trace_e2e
Task:
Add an e2e trace runner and tests.

审查:

$delegate-review

task_suffix=trace_e2e
Review the worker changes and test results.

提交:

$delegate-commit

task_suffix=trace_e2e
Clean useless temporary files and commit current changes with a Chinese git commit -m summary.

安全约束

  • 规划和审查 skills 禁止提交。
  • 提交 skill 禁止写 /tmp,禁止 push。
  • worker agent 禁止写 PLAN 和 work 文件。
  • worker agent 必须用 Read 工具从磁盘重读交接文件与项目文档,不得复用对话记忆。
  • worker agent 必须把报告和测试产物写入带 suffix 的 /tmp 路径。
  • 提交前必须检查子模块脏状态。
  • 只删除可以确认用途的临时文件。

About

A small set of Codex skills for supervising weaker code-editing agents.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages