ワンクリックで
codex-delegate
把长代码库任务委托给本机 Codex CLI 后台执行。当用户说用 codex skill、codexskill、codex delegate、委托 codex、后台 codex、阻塞 codex exec、subagent 跑 codex 时使用。
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
把长代码库任务委托给本机 Codex CLI 后台执行。当用户说用 codex skill、codexskill、codex delegate、委托 codex、后台 codex、阻塞 codex exec、subagent 跑 codex 时使用。
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
说明并执行 Akashic 插件安装、加载、启停、配置、MCP、skill、生命周期与 manifest 管理。
随机抽检 default memory 的长期记忆,回溯 source_ref 原始上下文,识别疑似脏记忆并向用户汇报证据。
当此刻想反复进行的活动还没有合适 skill,或近期多轮行为显露出可发展的兴趣时,在 Drift 工作区创建或更新一个可再次选择的活动。
创建或更新由插件程序化声明的主动信息源 MCP server,并完成本地验证。
创建或改写 akashic-bot 技能(SKILL.md)。当用户要求新建技能、适配现有技能到当前格式、或修改技能内容时使用。
Summarize or extract text/transcripts from URLs, podcasts, and local files (great fallback for “transcribe this YouTube/video”).
| name | codex-delegate |
| description | 把长代码库任务委托给本机 Codex CLI 后台执行。当用户说用 codex skill、codexskill、codex delegate、委托 codex、后台 codex、阻塞 codex exec、subagent 跑 codex 时使用。 |
| metadata | {"akashic":{"always":false,"requires":{"bins":["codex"]}}} |
把一个可以独立完成的长任务交给后台 subagent;subagent 内部用 shell 同步阻塞等待 codex exec 完成,最后由后台 subagent 把结果带回主会话。
┌─ 主会话
│ ├─ shell(command -v codex && codex --version, auto_promote=false)
│ └─ spawn(run_in_background=true, profile="scripting" 或 "general")
│ └─ 后台 subagent
│ ├─ write_file(<task_dir>/prompt.txt)
│ ├─ shell(auto_promote=false)
│ │ └─ codex exec --cd <repo> --output-last-message <task_dir>/codex-result.md - < <task_dir>/prompt.txt
│ │ └─ 阻塞等待完成
│ ├─ read_file(<task_dir>/codex-result.md)
│ └─ read_file(<task_dir>/codex-session.txt)
└─ subagent 完成后回灌结果
codex 是否存在:调用 shell(command="command -v codex && codex --version", auto_promote=false)。如果失败,直接告诉用户本机没有可用 Codex CLI,不要 spawn。不要把这个检查下放给 subagent。list_dir、read_file、shell find/grep 探索该仓库;只把 repo 路径和任务目标原样传给 spawn。代码库探索由 Codex delegate 完成。spawn(run_in_background=true),不要在主会话里直接跑长时间 codex exec。profile 选 scripting;如果任务还需要联网调研,选 general。shell 时必须设置 auto_promote=false,不要设置 run_in_background=true。auto_promote=false 且不传 timeout 时,shell 会默认同步等待 21600 秒;只有需要更短硬截止时才显式传 timeout。codex exec 要用 --cd <repo> 指定工作目录,避免依赖 shell 的 cd 状态。codex exec --cd <repo> - < prompt.txt 读取,避免 shell 引号、换行和特殊字符破坏 prompt。codex exec 加 --output-last-message <task_dir>/codex-result.md,完成后读这个文件作为主要结果;不要从 /tmp/akashic-shell-*.log 里 grep 或 tail 输出。<task_dir>/codex-run.log,因为 session id: ... 在 stderr 里。codex-run.log 提取 session id,写入 <task_dir>/codex-session.txt,并在回复里告诉主会话这个 session id。<task_dir>;不要写 /tmp,也不要依赖 /tmp/akashic-shell-*.log。外层:
shell(
command="command -v codex && codex --version",
description="检查 codex",
auto_promote=false
)
spawn(
task="用户给出的 repo 路径是 /path/to/repo;用户目标是:<原样概括用户目标>。不要让主 agent 先探索这个仓库,不要使用主 agent 预选的文件列表;Codex CLI 必须把 /path/to/repo 当作完整代码库,自行发现入口、目录和相关文件。在当前 subagent 任务目录写入 prompt.txt,然后用 shell 阻塞执行 codex exec --cd /path/to/repo --output-last-message <当前任务目录>/codex-result.md - < <当前任务目录>/prompt.txt,并用 2>&1 | tee <当前任务目录>/codex-run.log 保存完整日志。shell 必须设置 auto_promote=false,不要 run_in_background,不要写 /tmp,不要读取 /tmp/akashic-shell 日志。完成后读取 codex-result.md,总结结果;从 codex-run.log 提取 session id 写入 codex-session.txt 并带回。",
label="codex delegate",
profile="scripting",
run_in_background=true
)
subagent 内层:
shell(
command="bash -lc 'set -o pipefail; codex exec --cd /path/to/repo --output-last-message /path/to/task_dir/codex-result.md - < /path/to/task_dir/prompt.txt 2>&1 | tee /path/to/task_dir/codex-run.log; sed -n \"s/^session id: //p\" /path/to/task_dir/codex-run.log | tail -1 > /path/to/task_dir/codex-session.txt'",
description="阻塞 codex",
auto_promote=false
)
完成后:
read_file(path="/path/to/task_dir/codex-result.md")
read_file(path="/path/to/task_dir/codex-session.txt")
需要续聊同一个 Codex 会话时:
codex exec resume <session_id> --output-last-message /path/to/task_dir/codex-result-2.md - < /path/to/task_dir/prompt-2.txt
codex exec 命令末尾加 &、nohup、disown,也不要用 shell 后台化包装。task_output 等 shell 后台结果;这个技能要求 shell 前台阻塞,等待完整结果后再返回。codex exec --cd <repo> '<任务说明>',但默认优先用 stdin 文件形态。--last 只适合人工临时使用;自动化续聊必须传明确的 <session_id>,避免串到别的 Codex 会话。bash -lc,也可以分两步执行:先跑 codex exec ... 2>&1 | tee codex-run.log,再用 sed 从 codex-run.log 提取 session id。write_file 因路径限制失败,说明路径没用当前 subagent 任务目录;修正为 <task_dir>/prompt.txt,不要改用 shell 写 /tmp。