一键导入
dispatching-parallel-agents-codex
Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Systematic 4-phase debugging with Codex-backed root cause investigation. Use only when the user explicitly asks for the Codex-backed debugging workflow.
Use when you have a spec or requirements for a multi-step task, before touching code. Codex-backed variant.
Request a high-signal Codex-backed review of a diff or task result. Use when completing tasks, implementing major features, or before merging. Codex-backed variant.
Complete development work with Codex-backed branch analysis and structured finish options. Use only when the user explicitly asks for the Codex-backed branch finishing workflow.
Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation
Execute an implementation plan by dispatching Codex-backed implementer and reviewer agents while Claude keeps spec-compliance control. Codex-backed variant.
| name | dispatching-parallel-agents-codex |
| description | Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies |
| disable-model-invocation | true |
When you have multiple unrelated tasks (different subsystems, different bugs), working them sequentially wastes time. Each thread is independent and can happen in parallel.
Core principle: Dispatch one codex_implement per independent problem domain. Let them work concurrently.
digraph when_to_use {
"Multiple independent tasks?" [shape=diamond];
"Are they independent?" [shape=diamond];
"Single codex_implement handles all" [shape=box];
"One codex_implement per domain" [shape=box];
"Can they run without shared state?" [shape=diamond];
"Sequential codex_implement" [shape=box];
"Parallel dispatch" [shape=box];
"Multiple independent tasks?" -> "Are they independent?" [label="yes"];
"Are they independent?" -> "Single codex_implement handles all" [label="no - related"];
"Are they independent?" -> "Can they run without shared state?" [label="yes"];
"Can they run without shared state?" -> "Parallel dispatch" [label="yes"];
"Can they run without shared state?" -> "Sequential codex_implement" [label="no - shared state"];
}
Use when:
Don't use when:
Group tasks by what's being changed:
scripts/tests/fixtures/schemas/Each domain is independent — Thread A doesn't touch Thread B's files.
Each codex_implement call gets:
Call multiple codex_implement tools in a single message so they run concurrently:
{
"tool": "codex_implement",
"arguments": {
"taskId": "parallel-A",
"prompt": "Fix the 3 failing tests in tests/adapter/codex-run.test.mjs. These are timeout-related. Root cause and fix only — do not touch other test files.",
"workspaceRoot": "/absolute/path/to/your/repo"
}
}
{
"tool": "codex_implement",
"arguments": {
"taskId": "parallel-B",
"prompt": "Fix the schema mismatch in schemas/implementer-result.schema.json. The 'tests' field is missing from the required array. Do not touch other schemas.",
"workspaceRoot": "/absolute/path/to/your/repo"
}
}
{
"tool": "codex_implement",
"arguments": {
"taskId": "parallel-C",
"prompt": "Update the fixture in tests/fixtures/sample-result.jsonl to match the new implementer-result schema. Only touch that fixture file.",
"workspaceRoot": "/absolute/path/to/your/repo"
}
}
When all threads return, each response includes a sessionId — capture it for follow-up:
codex_resume with the returned taskId and sessionId if any thread needs follow-upGood prompts are:
Bad:
"Fix all the tests" ← agent gets lost
"Fix the race condition" ← agent doesn't know where
Good:
"Fix the 3 failing tests in tests/adapter/codex-run.test.mjs.
Tests: [list test names + error messages].
Root cause is likely X. Fix by Y.
Do NOT change production code.
Return: root cause found and what you changed."
Too broad: Agent gets lost in unrelated code. No constraints: Agent refactors everything. Vague output: You don't know what changed. Overlapping scope: Threads edit same files, creating conflicts.
Related failures: Investigate together, fixing one might fix others.
Need full context: Understanding requires seeing the whole system.
Exploratory debugging: You don't know what's broken yet — use codex_debug first.
Shared state: Threads would interfere (editing same files).
npm testcodex_resume with the appropriate taskId and sessionId