agentleFS
Dmatut7Dmatut7/codex-flow/codex-skill/SKILL.md

dynamic-workflow

Skill9 starsChanged 5 months agoMITView on GitHub

Use when the user asks to run a "动态工作流" / "dynamic workflow", or describes a complex multi-step task, a bug investigation, or work that should be split and run in parallel ("拆开并行跑", "parallel analysis", "并行排查", "complex multi-step task"). This skill turns Codex into an orchestrator: it generates a temporary workflow, runs many Codex sub-agents in parallel with resume + journaling via the `codex-flow` engine, and summarizes the result — instead of doing everything in one linear turn. Do NOT use for a single trivial question or a one-step edit; just answer those directly.

  • Reads credentials
  • Installs packages

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. eygelias/Hermes-Custom-Skills★ 0same name

    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 repository3 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use a dynamic workflow when the task is multi-step, parallelizable, or repeated over many items, e.g.:

    line 14
  2. Distinctive:

    If it's a single trivial question or one tiny edit, just answer/do it directly — do not spin up a workflow.

    line 20
  3. Very specific:

    Preflight if needed: If this is the first workflow in the project or the CLI availability is unclear, run codex-flow doctor.

    line 24
  4. Distinctive:

    Restate the goal in one line: If the input material or output shape is genuinely missing, ask at most ONE necessary question.

    line 26
  5. Very specific:

    Membership, not API key: Default backend is codex-sdk (the logged-in Codex/ChatGPT account).

    line 43
  6. Very specific:

    Sandbox: Read-only/analysis sub-agents: sandbox: "read-only".

    line 44

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Dynamic Workflow

You are the natural-language driver for the codex-flow workflow engine. When this skill triggers, you turn the user's request into a small workflow that fans work out across parallel Codex sub-agents, runs it, and reports a summary. The user should NEVER have to hand-write a workflow file or remember commands.

When to actually use it

Use a dynamic workflow when the task is multi-step, parallelizable, or repeated over many items, e.g.:

  • "排查这个 bug" over several files/hypotheses
  • "review/analyze these N things" (one sub-agent per thing, in parallel)
  • "do X then verify X for each item" (a per-item pipeline)
  • anything long enough that resume-after-interrupt matters

If it's a single trivial question or one tiny edit, just answer/do it directly — do not spin up a workflow.

Steps

  1. Preflight if needed. If this is the first workflow in the project or the CLI availability is unclear, run codex-flow doctor. If codex-flow is missing, tell the user to install it with npm install -g codex-flow and stop. If npm is unavailable, use npm install -g github:Dmatut7/codex-flow as a fallback.
  2. Restate the goal in one line. If the input material or output shape is genuinely missing, ask at most ONE necessary question. Otherwise infer and proceed.
  3. Generate a workflow file at .codex-flow/generated/<slug>.workflow.ts (create dirs as needed). Follow references/engine-api.md EXACTLY:
    • export default async function workflow(ctx) { ... }
    • Import-free: no import lines. Use plain JSON Schema objects for structured output (NOT zod), because the file runs from the user's project where extra deps may not exist.
    • Express the work with ctx.parallel (independent fan-out), ctx.pipeline (per-item multi-stage), ctx.phase, ctx.agent, ctx.log. One ctx.agent(...) call = one sub-task. Don't write one giant single-agent prompt that bypasses the engine.
  4. Run it (this uses the user's Codex/ChatGPT membership login — no API key needed):
    codex-flow run .codex-flow/generated/<slug>.workflow.ts
    Journal is written to .codex-flow/journal/<slug>.jsonl automatically. If the run is interrupted, the same command resumes and replays completed work for free.
  5. Summarize for the user: the result, what each parallel branch found, the journal path, and the one-line rerun command. Do NOT paste the whole generated script unless asked.

Hard rules

  • Membership, not API key. Default backend is codex-sdk (the logged-in Codex/ChatGPT account). Never tell the user to set OPENAI_API_KEY unless they explicitly ask for the openai-responses backend.
  • Sandbox. Read-only/analysis sub-agents: sandbox: "read-only". Sub-agents that must edit real files: sandbox: "workspace-write" AND cwd: process.cwd(). Two parallel writable agents must NOT share the same cwd (the engine throws if they do) — give each a distinct directory or keep writes sequential.
  • Current project is the workspace. codex-flow run already runs in the user's project directory; read-only agents need no cwd.
  • On failure, read the error and fix only the generated workflow (e.g. a bad prompt or schema). Do not try to modify the codex-flow engine itself.

See references/engine-api.md for the exact API and a copy-paste template. Installed setup/troubleshooting reference: references/setup.md.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.