parallel-execution
Skill4 starsChanged 4 days agoMITView on GitHub
Run a codex-flow backlog faster by executing independent tasks concurrently — compute dependency/file-disjoint waves from TASKS.md, give each parallel task its own git worktree (codex-mcp serializes per cwd but parallelizes across cwds), run a Claude subagent per worktree, then merge and integration-review each wave. Use by default when task-waves reports width greater than 1; proceed without asking for waves of up to 3 concurrent tasks and ask only before a wave exceeds 3 because of simultaneous quota cost.
11 other projects use a version of this.
Adopted by
Most recently taken up by
- intelligentcode-ai/skillstheir own version, first seen Nov 15, 2026
- andreymudri/claude-teammatestheir own version, first seen Nov 2, 2026
- andreymudri/fleetmatestheir own version, first seen Nov 2, 2026
- NoobyGains/godmodetheir own version, first seen Nov 1, 2026
- kimasplund/thinkbetter-skillstheir own version, first seen Oct 25, 2026
- garri333/Skillstheir own version, first seen Oct 11, 2026
Used with
Projects with it also use writing-skills.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
OpenAISkillwriting-skills
Use when creating new skills, editing existing skills, or verifying skills work before deployment
Also in 3 projects that use this
Other versions11 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 11
- CloudAI-X/claude-workflow★ 1.4ksame name
- CloudAI-X/claude-workflow-v2★ 1.4ksame name
- CloudAI-X/opencode-workflow★ 275same name
- NoobyGains/godmode★ 140same name
- andreymudri/claude-teammates★ 3same name
- andreymudri/fleetmates★ 3same name
- beeltec/skills★ 2same name
- cheukswiss/etdxm★ 2same name
- garri333/Skills★ 1same name
- intelligentcode-ai/skills★ 1same name
1 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository76 other files it gives its agents.
- AGENTS.mdAGENTS.md
- accounting-bookkeepingSkill
- agent-context-persistenceSkill
- asoSkill
- brainstorm-argumentationSkill
- brainstorm-debateSkill
- brainstorm-lensesSkill
- causal-inferenceSkill
- context-disciplineSkill
- creative-briefSkill
- customer-support-opsSkill
- data-quality-checksSkill
- design-fundamentalsSkill
- ecommerce-operationsSkill
- event-taxonomySkill
- exec-coding-standardsSkill
- exec-cppSkill
- exec-csharpSkill
- exec-deliverableSkill
- exec-github-actionsSkill
- exec-goSkill
- exec-jvmSkill
- exec-phpSkill
- exec-pythonSkill
- exec-rubySkill
- exec-rustSkill
- exec-self-testingSkill
- exec-swiftSkill
- exec-typescriptSkill
- executor-fallbackSkill
- exec-visualizationSkill
- fast-pathSkill
- final-reviewSkill
- financial-auditSkill
- hr-recruitingSkill
- influencer-strategySkill
- interview-ask-backSkill
- interview-elicitationSkill
- jev-assistSkill
- json-data-wranglingSkill
- legal-contract-basicsSkill
- localization-copySkill
- manufacturing-ops-planningSkill
- marketing-attributionSkill
- media-planningSkill
- okr-planningSkill
- pack-game-analyticsSkill
- performance-marketingSkill
- personal-financeSkill
- plan-architectureSkill
- plan-backlogSkill
- plan-research-firstSkill
- preflightSkill
- profile-contentSkill
- profile-designSkill
- profile-pilotSkill
- profile-planSkill
- real-estate-analysisSkill
- review-conformanceSkill
- review-dualSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
22 rules. 0 are common, 12 are distinctive, and 10 are very specific to this project.
0
Common
Most of the 10 edited versions we read keep these.
12
Distinctive
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
Always run the wave tool below during Phase 4.
- Distinctive: line 29
When a wave exceeds 3 concurrent tasks, ask whether to run at that width or lower the cap before spawning.
- Distinctive: line 39
If the helper is not found, STOP and tell the user to reinstall the codex-flow plugin (its scripts/ directory is required).
- Very specific: line 56
Before wave 1, run git worktree add --detach <tmp> HEAD, then git worktree remove --force <tmp>.
- Very specific: line 65
Create isolated worktrees serially, never with concurrent git worktree add calls.
- Distinctive: line 76
After creating each worktree, the coordinator MUST copy the untracked control files into it:
- Very specific: line 86
If either command exits non-zero, surface the error and do NOT dispatch the subagent.
- Very specific: line 87
If generation reports mandatory slice content exceeds tokenBudget, split the oversized task in the backlog and recompute the waves before …
- Distinctive: line 89
Treat these copies as coordinator-owned context: subagents read them but do not include them in task commits.
- Distinctive: line 103
After the serial worktree setup, control-file copies, and coordinator dispatch records finish, launch the subagents concurrently in a …
- Distinctive: line 114
After review, each subagent returns a structured handoff containing: task id.
- Very specific: line 121
After review passes, each subagent MUST commit its task changes on the worktree branch as wip(codex-flow): T<n> <title>, regardless of the …
- Very specific: line 128
Before merging each worktree, the coordinator diffs the worktree's actual changed files against the task's declared Files:.
- Very specific: line 138
Before merging, the coordinator verifies the task branch is ahead of its branch-point base (git rev-list --count <base>..<branch> must be …
- Distinctive: line 144
After merging the whole wave, run a wave integration review: full test suite on the merged result + a quick end-to-end probe.
- Very specific: line 147
After each wave, first set taskStage handoff with node "${CLAUDE_PLUGIN_ROOT}/scripts/flow-state.mjs" set taskStage handoff, then the …
- Distinctive: line 162
After the last wave: whole-feature review + full suite + end-to-end verification (same as sequential Phase 5 step 8), then summarize.
- Distinctive: line 167
Never parallelize tasks that share a file — the wave tool already prevents this.
- Distinctive: line 168
If a subagent's task fails after 3 review rounds, quarantine it: keep the rest of the wave, report the failure, and ask the user before …
- Very specific: line 170
If a merge conflict is non-trivial, first record it durably with node "${CLAUDE_PLUGIN_ROOT}/scripts/flow-state.mjs" set taskStage …
- Very specific: line 174
Never spawn more than 10 subagents at once — the wave tool already caps each wave at 10 (--max <n> to lower it) and flows the rest into the …
- Distinctive: line 177
Keep parallel mode ON by default when Step 1 shows width > 1.
“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Parallel Execution (default when wave width > 1)
Helpers: required — task-waves.mjs, flow-state.mjs, context-slice.mjs, worktree-setup.mjs, requirements-coverage.mjs (helper rule: missing → STOP and tell the user to reinstall the codex-flow plugin; non-zero exit → surface the error and STOP).
codex-mcp serializes runs per cwd (to prevent file/git races) but runs different cwds in
parallel. So real parallelism = one git worktree per concurrent task, each driven by its own
Claude subagent calling codex_execute into that worktree.
Control-file ownership
The coordinator is the SOLE writer for every .codex-flow/* file, including TASKS.md, PLAN.md,
STATE.md, REQUIREMENTS.md, report directories, IMPROVEMENTS.md, and notes. Worktree subagents treat
those durable control-file copies as read-only inputs. They may regenerate derived context slices
inside their own worktree copies only; every durable update flows through the structured handoff
to the coordinator.
Default-on policy
- Always run the wave tool below during Phase 4. When it reports width > 1, use parallel mode by default if the project is a git repo, its tracked baseline is clean, and the user has not opted out.
- Proceed without asking for waves of ≤3 concurrent tasks. Show the user the wave plan, then start the wave.
- When a wave exceeds 3 concurrent tasks, ask whether to run at that width or lower the cap before spawning; parallel execution burns N× simultaneous quota.
- Stay sequential when the tool reports "fully sequential", the user opted out, the project is not a git repo, the tracked baseline cannot be made clean, or the worktree canary fails.
Step 1 — Compute waves
node "${CLAUDE_PLUGIN_ROOT}/scripts/task-waves.mjs" .codex-flow/TASKS.md
This helper and the context-slice.mjs call in Step 2 are both fail-closed.
If the helper is not found, STOP and tell the user to reinstall the codex-flow plugin (its scripts/ directory is required); if it is present but exits non-zero, surface the error to the user and STOP. Never edit control files by hand.
A wave is a set of tasks that can run at once: every task's dependencies are satisfied by
earlier waves, and no two tasks in the wave touch the same file (Files: field). Tasks with no
declared files run alone (unknown blast radius). The tool prints each wave and its width; a wave
of width 1 just runs like normal Phase 4.
Wave quality is only as good as the backlog metadata: accurate per-task Files: sets (from PLAN.md's
Component → files map) and fixed Contracts are what make concurrent tasks genuinely
independent. If tasks were sliced with vague file lists, fix the backlog before parallelizing —
don't parallelize on guesses.
Show the wave plan to the user before spawning anything. For waves of width ≤3, this is a status update, not an approval gate.
Step 2 — Per wave: spawn a subagent + worktree per task
Before wave 1, run git worktree add --detach <tmp> HEAD, then git worktree remove --force <tmp>. If the canary fails, set executionMode to sequential (worktrees unavailable: <error>) with node "${CLAUDE_PLUGIN_ROOT}/scripts/flow-state.mjs" set executionMode "sequential (worktrees unavailable: <error>)" and run sequentially; never discover this mid-wave.
Hard precondition: parallel mode requires a clean tracked baseline, with every accepted project
change the tasks depend on committed at the branch point. If Phase 0 accepted a dirty baseline,
commit the required changes and stash unrelated residue before continuing, or stay sequential.
The untracked .codex-flow control files are copied separately below.
For each task in the wave (width > 1):
- Create isolated worktrees serially, never with concurrent
git worktree addcalls. Cloud- synced filesystems such as OneDrive can fail concurrent creation withmmap failed. Use theAgenttool withisolation: "worktree"(orEnterWorktree). Each worktree is a distinctcwd. Branch point depends on the wave:- Wave 1: branch from the CURRENT integration branch HEAD, which includes the Phase-2
docs(agents)commit. - Wave N (N>1): branch from the CURRENT integration branch HEAD — i.e. only after wave N−1 has been merged and its wave integration review/tests passed (Step 3). Branching later waves off the baseline would run them on stale code missing earlier waves' merged output. The Phase 0 baseline ref is kept for audit, rollback, and the final-review diff only — never as a worktree branch point.
- Wave 1: branch from the CURRENT integration branch HEAD, which includes the Phase-2
After creating each worktree, the coordinator MUST copy the untracked control files into it:
node "${CLAUDE_PLUGIN_ROOT}/scripts/context-slice.mjs" --task T<n> node "${CLAUDE_PLUGIN_ROOT}/scripts/worktree-setup.mjs" --worktree <worktree> --task T<n>Generate the task's
.codex-flow/CONTEXT-T<n>.mdimmediately before copying it alongside PLAN.md and TASKS.md. When the task's.codex-flow/SKILLS-T<n>.mdsidecar exists, copy it into the worktree alongside the context slice. If either command exits non-zero, surface the error and do NOT dispatch the subagent. If generation reportsmandatory slice content exceeds tokenBudget, split the oversized task in the backlog and recompute the waves before continuing; never raise the slice budget. Treat these copies as coordinator-owned context: subagents read them but do not include them in task commits; the coordinator updates the integration copies in Step 3.- In each subagent, run the Phase 4 execution mechanics for its ONE task: embed the standards +
the task's
Skills:blocks, callcodex_executewith that worktree ascwd, pickmodelby task complexity, and save thesessionId. Skip every control-file write prescribed by Phase 4: no TASKS.md, STATE.md, report, ledger, or Decision-log writes. - At dispatch time, before launching the batch, the coordinator marks every wave task
in-progress, appends its pending-to-in-progress transition (both vianode "${CLAUDE_PLUGIN_ROOT}/scripts/flow-state.mjs" task T<n> in-progress), and writes- Session: launching (base: <short sha>, worktree: <path>, branch: <name>)using that worktree's branch-point base sha, path, and branch. Parallel-mode STATE.md convention:node "${CLAUDE_PLUGIN_ROOT}/scripts/flow-state.mjs" set wave <n>names the wave andcurrentTaskstays-(several tasks run at once); the wave's stage sequence isexecuting(whole wave) →handoff(Step 3.8) →idle; per-taskreviewingis not used in parallel mode. - After the serial worktree setup, control-file copies, and coordinator dispatch records finish, launch the subagents concurrently in a single batch.
Because each cwd differs, the per-workspace concurrency guard allows all of them at once.
Step 3 — Per wave: review, then merge
- Each subagent runs the Phase 5 review mechanics (conformance → quality → security) inside its worktree; a task that does not pass escalates as a blocker. Skip every control-file write that Phase 5 prescribes: no TASKS.md, STATE.md, report, ledger, or Decision-log writes. A subagent may regenerate derived slices inside its worktree copy only.
- After review, each subagent returns a structured handoff containing: task id; sessionId; actual
files changed; checks run with results; review findings and resolutions; a proposed Decision-log
block; and proposed improvement entries. The handoff proposes control-file content but never
edits the durable worktree copies; all durable updates flow through this handoff to the
coordinator. IMMEDIATELY when each handoff arrives, before any merge or wave integration review,
the coordinator replaces that task's
launchingSession line with its real sessionId while preserving the base, worktree path, and branch. Do not wait for the rest of the wave. - After review passes, each subagent MUST commit its task changes on the worktree branch as
wip(codex-flow): T<n> <title>, regardless of the Phase-3 checkpoint-commit choice. This commit is required to transport the work back and can be squashed at delivery; exclude the copied.codex-flowcontrol files. Only then does the subagent report the branch ready to merge.- Task commits MUST stage explicit paths (never
git add -A) because coordinator-owned worktree artifacts — thenode_modulessymlink and copied.codex-flowcontrol files — can escape gitignore rules. A symlink namednode_modulesis not matched bynode_modules/.
- Task commits MUST stage explicit paths (never
- Before merging each worktree, the coordinator diffs the worktree's actual changed files against
the task's declared
Files:. Any expansion — a changed file outside that declaration, excluding generated lockfiles explicitly listed as shared — stops the wave. As the FIRST step of this backlog-mutating transaction, runnode "${CLAUDE_PLUGIN_ROOT}/scripts/flow-state.mjs" plan-drift. Only then update the task'sFiles:in TASKS.md, re-runnode "${CLAUDE_PLUGIN_ROOT}/scripts/requirements-coverage.mjs" --requirements .codex-flow/REQUIREMENTS.md --tasks .codex-flow/TASKS.mdplus theplan-backlogbacklog sanity checks, and get user re-approval. Only after re-approval, runnode "${CLAUDE_PLUGIN_ROOT}/scripts/flow-state.mjs" approve backlogthennode "${CLAUDE_PLUGIN_ROOT}/scripts/flow-state.mjs" advanceto restore execution. Then RE-RUN the task's conformance → quality → security review over the EXPANDEDFiles:scope, using a freshcodex_reviewor a Claude pass, before the branch may merge. The security review is mandatory when the expansion touches auth, input, queries, files, or secrets. - Before merging, the coordinator verifies the task branch is ahead of its branch-point base
(
git rev-list --count <base>..<branch>must be greater than zero). A zero-commit branch is a failed task, not a branch to merge. - The coordinator merges each passed, verified worktree branch back into the integration branch in task order. Resolve conflicts here — they should be rare because the wave is file-disjoint, but dependency-driven edits to shared files across waves can still collide.
- After merging the whole wave, run a wave integration review: full test suite on the merged result + a quick end-to-end probe. Branches never saw each other, so a green-in-isolation task can still break in combination — this pass is mandatory, not optional.
- After each wave, first set
taskStage handoffwithnode "${CLAUDE_PLUGIN_ROOT}/scripts/flow-state.mjs" set taskStage handoff, then the coordinator serially applies the remaining structured handoffs: Decision-log appends, report entries, and IMP-id allocation in IMPROVEMENTS.md. Serial IMP-id allocation prevents duplicate ids. For each passed task, append one schema block (seeplan-architecture) and write its report entries. Append one wave-integration event block using that skill's event schema. Only after every required handoff and event write succeeds, make each task'sStatus: donetransition as the last durable task write vianode "${CLAUDE_PLUGIN_ROOT}/scripts/flow-state.mjs" task T<n> done, then settaskStage idle. Followcontext-disciplineto declare the safe wave-boundary compaction point, then compute the next wave (dependencies of later tasks are now satisfied). The next wave's worktrees branch from the integration branch HEAD as it stands now — post-merge, post-review — so they build on this wave's output.
Step 4 — Final integration
After the last wave: whole-feature review + full suite + end-to-end verification (same as sequential Phase 5 step 8), then summarize. Offer to squash the per-task/per-wave commits.
Rules & failure handling
- Never parallelize tasks that share a file — the wave tool already prevents this; do not override.
- If a subagent's task fails after 3 review rounds, quarantine it: keep the rest of the wave, report the failure, and ask the user before retrying (quota is not free).
- If a merge conflict is non-trivial, first record it durably with
node "${CLAUDE_PLUGIN_ROOT}/scripts/flow-state.mjs" set taskStage merge-conflict, then stop and surface it — do not let a subagent force-resolve another task's code. A resume that findstaskStage: merge-conflictsurfaces the conflict to the user and STOPs. - Never spawn more than 10 subagents at once — the wave tool already caps each wave at 10
(
--max <n>to lower it) and flows the rest into the next wave, so a very wide backlog is split into consecutive ≤10 waves. Lower the cap when quota or review load is tight. - Keep parallel mode ON by default when Step 1 shows width > 1. Waves of width ≤3 need no opt-in; ask only before running a wave at width >3. Stay sequential for the exceptions in the Default-on policy.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

