Decompose complex work into independent parallel sub-agents with no write overlap, synthesize or consume a `WORKGRAPH.md` execution artifact, and launch describe-style worker briefs before review. Use before spawning multiple agents for multi-file, multi-domain, or naturally parallel tasks.
Decompose a task into sub-agents that run fully in parallel with zero conflicts.
Autonomous: analyze → load or synthesize WORKGRAPH.md → launch
describe-style node briefs → Codex review → commit → report. No approval
gates.
Start with a stable first progress message such as:
Using \divide-and-conquer` to map the ready frontier, write a temp `WORKGRAPH.md` when needed, and launch conflict-free workers.`
Shared cross-skill rules live in references/orchestration-contract.md. Use that file for worker ownership, background-task collection, and detached review handoff semantics.
Temp workgraph synthesis and describe-style worker briefs live in references/workgraph-synthesis.md.
Modes customize decomposition for specific projects — split boundaries, agent preferences, repo structure, naming conventions, and validation commands. Stored in (gitignored, never committed).
modes/Each mode is a markdown file: modes/{project-name}.md. It contains project-specific configuration: where the natural split boundaries are, what agent types to prefer, what gpt-5.4 reasoning strategy to prefer, what commands to run for validation, and how to label agents.
.md files in modes/ (if directory exists)cwd_match field — a path prefix to match against cwdmodes/ doesn't exist, use generic decomposition (no project-specific config)Copy references/mode-template.md to modes/{project-name}.md and fill in split boundaries, agent preferences, and validation commands for your project. When a user runs the skill with no matching mode, offer to create one.
Modes are gitignored — they contain project-specific paths and preferences that should not be committed to the skill repo.
Know what each type can and cannot do:
| Type | Can Read | Can Write | Can Bash | Sees Conversation | Best For |
|---|---|---|---|---|---|
| Explore | Yes | No | No | No | Research, codebase exploration — inherently safe |
| general-purpose | Yes | Yes | Yes | Yes | Implementation, complex multi-step work |
| Bash | No | No | Yes | No | Running commands, builds, tests, git operations |
| Plan | Yes | No | No | No | Designing implementation approaches |
Key implications:
gpt-5.4 Only)gpt-5.4 for every explicit model selection in this skill. Do not fall back to older gpt-5.x-codex variants or provider-specific tier names.medium only for clearly bounded work, default to high, and use xhigh for reviews, ambiguity, or high-risk changes.high over medium, and xhigh over high, when the task is borderline.gpt-5.4. Otherwise set it explicitly.Read the conversation to understand:
Use a workgraph when any of these are true:
If the work collapses to one concern or a strict dependency chain, do not force a graph just to satisfy the ritual.
If the split itself is unclear, use ask-cascade on the first blocking
strategic fork before inventing nodes or launching agents.
WORKGRAPH.mdBefore inventing a split, check whether the repo or plan directory already has a
durable WORKGRAPH.md execution artifact.
If a durable WORKGRAPH.md exists:
python3 ~/.claude/skills/divide-and-conquer/scripts/workgraph_ready.py --file <path-to-WORKGRAPH.md>ready_nodes and waves as the default split proposalwrites ownership from the workgraph even if the user asked broadlyIf no durable WORKGRAPH.md exists and parallelism is still relevant:
mktemp -d "${TMPDIR:-/tmp}/dac-workgraph-XXXXXX"WORKGRAPH.md inside that directory using the canonical node contract
from references/workgraph-synthesis.mdworkgraph_ready.py against the temp file and treat the
resulting ready frontier as the launch planThe temp graph is a scratch execution artifact, not a second plan document.
Find natural seams where work can be divided. Good boundaries:
Scope agents by concern, not by file list. "Handle authentication changes"
is better than "Modify src/auth.ts". The agent discovers which files are
relevant; you verify no overlap in the conflict check. When WORKGRAPH.md
exists, the node's concern and writes fields become the starting point for
that split.
If you cannot express a node with concrete done_when and validate_cmds, the
node is not ready to launch. Tighten it first instead of delegating vague work.
For each proposed agent pair, confirm:
depends_on, not hidden in prompt proseIf any check fails, merge those agents or restructure the split.
See references/decomposition-patterns.md for safe/unsafe patterns and the full checklist.
This is autonomous — do NOT ask for approval between planning and launching. Output the plan for transparency, then launch immediately in the same response.
describe RulesUse describe only when a node is still fuzzy, not as mandatory ceremony for
every worker.
When a ready node still has fuzzy done_when, validate_cmds, or non-goals:
describe pass or fresh review to tighten the node contractask-cascadeWORKGRAPH.mdworkgraph_ready.py before launching workersEvery launched worker, especially write agents, gets the workgraph path and the specific node it owns. Use a compact describe-style brief:
Workgraph: <path-to-WORKGRAPH.md> (durable | temp)
Node: <WG-001> - <title>
Concern: <concern>
Depends on: <ids already satisfied, or None>
Writes: <expected paths/globs, or None>
Underlying ask: <plain-language user outcome for this node>
Done when:
- <binary completion check>
Validate:
- <command>
Risk gate:
- none | <what must be confirmed first>
Non-goals:
- <explicitly out of scope items>
If anything above is ambiguous enough that you would guess, stop and return the
single smallest ask-cascade question or a proposed WORKGRAPH edit instead of
coding past it.
This is the default launch contract even when you do not run the full
describe skill for that node.
Print the decomposition as a numbered list. For each agent:
## Agent [N]: [Short Label]
**Workgraph**: <path> (`durable` | `temp`)
**Node**: <WG-00N> | None
**Type**: Explore | general-purpose | Bash
**Model**: `gpt-5.4` + `medium|high|xhigh` (`high` default; round up when unsure)
**Background**: true if non-blocking, false if results needed before next step
**Concern**: [Domain/goal this agent owns — scope by concern, not file list]
**Task**: [Goal-focused instructions. Include the describe-style node brief in the launch prompt.]
**Writes**: [Expected files — verified for no overlap, but agent discovers actual files needed. "None" for Explore/Bash types.]
Then the Conflict Check:
## Conflict Check
- Write overlap: None | [list conflicts]
- Data dependencies: None | [list dependencies]
- Workgraph frontier: [ready nodes / waves used for this launch]
- Type safety: [Confirm write-agents are general-purpose, research-agents are Explore]
- Verdict: Ready to launch | Needs restructuring
If verdict is "Needs restructuring", fix the split before continuing. Otherwise, proceed immediately.
All parallel agents MUST be launched in the same message as the plan output above. Do not wait for user confirmation. The conflict check IS the safety gate.
All worker prompts must reference the same WORKGRAPH.md path plus the
specific node ID they own. Agents that depend on prior results must be launched
sequentially in a follow-up message.
Once all agents complete, read each agent's output. Do NOT manually review, fix, or verify — that's the Codex reviewer's job (Step 7).
Save the original task description and workgraph path — the reviewer needs both.
After all agents return, launch a Codex review via the codex-tmux utility skill. See ~/.claude/skills/codex-tmux/SKILL.md for the full tmux protocol details.
You are the REVIEW AGENT for a divide-and-conquer parallel execution.
Multiple sub-agents just completed work in this repository. Your job:
1. Understand what was requested:
Task: <original task description>
Workgraph: <path-to-WORKGRAPH.md or null>
2. Review what was done:
- If a workgraph exists, read it first to understand node intent and ownership
- Run `git status` and `git diff` to see all changes
- Read modified files to understand the changes
- Assess whether the changes correctly and completely address the task
3. Fix issues:
- If you find bugs, incomplete work, or inconsistencies, fix them
- If tests exist and are relevant, run them: fix failures
- If linting/type-checking is configured, run it: fix errors
- Do NOT add unnecessary improvements beyond what the task requires
4. Commit:
- If there are uncommitted changes (from agents or your fixes), stage and commit
- Use a clear commit message summarizing what was accomplished
- Format: "feat: <what was done>" or "fix: <what was fixed>"
- If nothing was changed (no git modifications), skip the commit
5. Report:
After committing (or determining no commit needed), print EXACTLY this
block at the end of your output (the orchestrator parses it):
```json
{
"commit_hash": "<hash or null if no commit>",
"summary": "<1-2 sentence summary of what was done and any fixes applied>",
"files_changed": <number of files changed>,
"status": "success"
}
If you encounter an unrecoverable error, use status "error" with a summary explaining what went wrong.
Guardrails:
#### 7b. Launch the Reviewer
```bash
python3 ~/.claude/skills/codex-tmux/scripts/run.py launch \
--task "<review prompt from 7a>" \
--cd "<repo working directory>" \
--model gpt-5.4 \
--reasoning-effort xhigh \
--prefix dac-review
Parse the wait_command from the launch output:
# run_in_background: true, timeout: 600000
tmux wait-for <signal_channel> && cat <result_file>
Agents completed. Codex review running in: dac-review-20260220-143022
Watch live: tmux a -t dac-review-20260220-143022
Status: python3 ~/.claude/skills/codex-tmux/scripts/run.py status --session dac-review-20260220-143022
The conversation can continue normally or end here — the background waiter handles both.
If the conversation is still alive, periodically check the runtime's background task handle or the detached review session result:
python3 ~/.claude/skills/codex-tmux/scripts/run.py result \
--session <session-name>
When the result is available (via background task or manual check):
git -C <repo> show --stat <commit_hash> # files changed summary
Report:
Codex reviewed and committed: <commit_hash_short>
<commit_message>
Files changed:
<git show --stat output>
Done. No files modified (work involved external operations).
Review session: <session_name>
Codex review failed. Agent work is in the repo but uncommitted.
Inspect: tmux a -t <session-name>
WORKGRAPH.md exists, start from its ready frontier. Do not freelance a broader split unless the workgraph is obviously stale or wrong.WORKGRAPH.md exists and parallelism is relevant, synthesize a temp one first. Use the same node contract and parser flow.done_when, validate_cmds, and non-goals explicitly.describe only for fuzzy nodes. If the node contract is already concrete, launch directly.ask-cascade only for the first blocking strategic ambiguity. Do not spray the user with tactical questions before the branch is set.gpt-5.4 whenever you set a model explicitly — do not drop back to older model families or provider-specific tiers inside this skill.high — use medium only for clearly bounded work and xhigh for reviews/ambiguity; when in doubt, choose the next higher tier.run_in_background: true for agents whose results aren't needed before the next step.