AI Agent Dynamic Workflows skill
Design a multi-agent workflow for a complex task when the user requests dynamic orchestration.
by DannyMac180·MIT license·★ 535 Stars on the repo·GitHub ↗
npx degit DannyMac180/skills/codex-dynamic-workflows#main ~/.claude/skills/codex-dynamic-workflowsChecked ·commit main
Files of AI Agent Dynamic Workflows
Show the full text191 lines
AI Agent Dynamic Workflows
Use this skill to turn a large task into a supervised AI-agent workflow: draft an orchestration artifact, enter goal mode when sustained execution is requested, delegate disjoint work to subagents when available, integrate results, verify the outcome, and save reusable workflow artifacts.
This skill works in agents that support skills. Do not claim that a local script can call subagent tools unless the current environment exposes such a runner. When no programmable runner exists, create a human-readable orchestration script and operate it through the available agent tools.
Decision Rule
Use this skill when the user requests dynamic orchestration. Task complexity, risk, or parallel tracks alone do not activate it. Within an authorized workflow, choose only delegation that contributes a concrete independent result.
Operating Contract
When using this skill:
- Restate the goal and success criteria.
- Create or update a workflow artifact before delegating.
- Check authorization for consequential actions against the boundaries below; do not ask again for an action already authorized within scope.
- Create a goal only when explicitly requested by the user or system/developer instructions; ordinary multi-turn work does not authorize goal creation.
- Split work into disjoint packets with clear ownership.
- Spawn subagents only when the current environment allows it and the user has authorized delegated or parallel agent work.
- If no subagent runner is available, perform independent passes locally and label them as parent work, not subagent results.
- Integrate results explicitly; do not paste raw subagent dumps as the final answer.
- Verify with checks matched to the task's blast radius.
- Save reusable artifacts only when they will help future work.
Workflow Artifacts
Prefer creating a local run directory:
.workflow/<slug>/
|-- plan.md
|-- state.json
|-- orchestration.md
|-- packets/
|-- results/
`-- final-report.md
Use scripts/new_workflow.py to scaffold this structure:
python3 /path/to/codex-dynamic-workflows/scripts/new_workflow.py "Task title"
Keep plan.md human-readable. Use state.json for status, packet IDs, approval state, and verification state. Use orchestration.md as the executable mental model: the sequence the agent will follow, the branching rules, and the packet prompts.
Orchestration Plan
Draft a concise plan with:
Goal:
Success criteria:
Current context:
Constraints:
Risks:
Approval required:
Workflow artifact path:
Work packets:
Integration policy:
Verification:
Reusable artifacts:
Do not over-plan obvious work. The plan should be detailed enough to guide delegation and verification, not a substitute for execution.
Approval Gates
Obtain missing authorization before consequential actions: publishing or sending to a named destination, production mutations, destructive deletion or history rewriting, credential/account/security changes, or materially costly workloads. Existing explicit authorization persists within its scope. A generic request to implement does not authorize unrelated external actions.
Authorized local edits, including replacing file contents as part of the requested change, and relevant disposable-fixture checks may proceed. Prepare the concrete result before asking for any missing authorization. Continue independent preparation and repair while a consequential action awaits approval.
Use risk-gates.md when the action's authorization is unclear.
Goal Mode
Create a goal only when explicitly requested by the user or system/developer instructions and supported by the current tool contract. A request to run a workflow, work for several turns, or continue implementation is not by itself a request to create a tracked goal. Keep any authorized goal's full objective intact.
Work Packets
Each packet must be self-contained:
Packet ID:
Objective:
Context:
Files / sources:
Ownership:
Do:
Do not:
Expected output:
Verification:
Prefer packets with disjoint ownership:
- codebase discovery
- dependency or API research
- implementation slice
- tests and fixtures
- docs and examples
- UX or product review
- security or risk review
- final verification
For code-edit packets, assign non-overlapping files or modules. Tell workers they are not alone in the codebase, must not revert others' edits, and must adapt to concurrent changes.
Subagents
When a subagent runner is available:
- Spawn only concrete, bounded, materially useful subtasks.
- Keep immediate blocking work local.
- Delegate sidecar work that can run while the main agent makes progress.
- Avoid duplicate work across agents.
- Ask workers to edit directly only when their write scope is disjoint and clear.
- Wait for subagents only when their result is needed for the next critical-path step.
When no subagent runner is available:
- Perform isolated packet passes locally and label them as parent work.
- Read only packet-relevant files during each pass.
- Write packet notes under
results/. - Integrate only after packet outputs are separate.
Integration
After packets complete, synthesize:
Accepted:
Rejected:
Conflicts:
Decisions:
Final changes:
Remaining risks:
Resolve conflicts explicitly. If two packets disagree, inspect the authoritative source before choosing.
Use scripts/collect_results.py to produce an integration checklist from result files:
python3 /path/to/codex-dynamic-workflows/scripts/collect_results.py .workflow/<slug>
Verification
Run the narrowest reliable checks first, then broaden as risk warrants:
- unit tests for touched code
- typecheck or lint
- build
- browser or UI smoke test
- script dry run
- source citation check
- migration dry run
- manual checklist for non-code work
Use scripts/verify_workflow.py to check workflow artifact completeness:
python3 /path/to/codex-dynamic-workflows/scripts/verify_workflow.py .workflow/<slug>
Report skipped checks honestly. Do not treat a workflow as complete until the evidence proves the original success criteria.
Reusable Recipes
When a run produces a useful pattern, save a concise recipe in a project-appropriate location, such as .workflow/recipes/<name>.md or a repo docs folder. Include:
- trigger
- plan shape
- packet list
- verification checklist
- known risks
Do not save transcripts, secrets, bulky logs, credentials, or sensitive personal details.
References
- Read
references/plan-schema.mdwhen a machine-readable workflow plan is useful. - Read
references/risk-gates.mdbefore risky or ambiguous operations. - Read
references/validation-examples.mdwhen forward-testing or improving this skill.
| 1 | |
| 2 | name codex-dynamic-workflows |
| 3 | description "Design a multi-agent workflow for a complex task when the user requests dynamic orchestration." |
| 4 | |
| 5 | |
| 6 | # AI Agent Dynamic Workflows |
| 7 | |
| 8 | Use this skill to turn a large task into a supervised AI-agent workflow: draft an orchestration artifact, enter goal mode when sustained execution is requested, delegate disjoint work to subagents when available, integrate results, verify the outcome, and save reusable workflow artifacts. |
| 9 | |
| 10 | This skill works in agents that support skills. Do not claim that a local script can call subagent tools unless the current environment exposes such a runner. When no programmable runner exists, create a human-readable orchestration script and operate it through the available agent tools. |
| 11 | |
| 12 | ## Decision Rule |
| 13 | |
| 14 | Use this skill when the user requests dynamic orchestration. Task complexity, risk, or parallel tracks alone do not activate it. Within an authorized workflow, choose only delegation that contributes a concrete independent result. |
| 15 | |
| 16 | ## Operating Contract |
| 17 | |
| 18 | When using this skill: |
| 19 | |
| 20 | Restate the goal and success criteria. |
| 21 | Create or update a workflow artifact before delegating. |
| 22 | Check authorization for consequential actions against the boundaries below; do not ask again for an action already authorized within scope. |
| 23 | Create a goal only when explicitly requested by the user or system/developer instructions; ordinary multi-turn work does not authorize goal creation. |
| 24 | Split work into disjoint packets with clear ownership. |
| 25 | Spawn subagents only when the current environment allows it and the user has authorized delegated or parallel agent work. |
| 26 | If no subagent runner is available, perform independent passes locally and label them as parent work, not subagent results. |
| 27 | Integrate results explicitly; do not paste raw subagent dumps as the final answer. |
| 28 | Verify with checks matched to the task's blast radius. |
| 29 | Save reusable artifacts only when they will help future work. |
| 30 | |
| 31 | ## Workflow Artifacts |
| 32 | |
| 33 | Prefer creating a local run directory: |
| 34 | |
| 35 | |
| 36 | .workflow/<slug>/ |
| 37 | |-- plan.md |
| 38 | |-- state.json |
| 39 | |-- orchestration.md |
| 40 | |-- packets/ |
| 41 | |-- results/ |
| 42 | `-- final-report.md |
| 43 | |
| 44 | |
| 45 | Use `scripts/new_workflow.py` to scaffold this structure: |
| 46 | |
| 47 | |
| 48 | python3 /path/to/codex-dynamic-workflows/scripts/new_workflow.py "Task title" |
| 49 | |
| 50 | |
| 51 | Keep `plan.md` human-readable. Use `state.json` for status, packet IDs, approval state, and verification state. Use `orchestration.md` as the executable mental model: the sequence the agent will follow, the branching rules, and the packet prompts. |
| 52 | |
| 53 | ## Orchestration Plan |
| 54 | |
| 55 | Draft a concise plan with: |
| 56 | |
| 57 | |
| 58 | Goal: |
| 59 | Success criteria: |
| 60 | Current context: |
| 61 | Constraints: |
| 62 | Risks: |
| 63 | Approval required: |
| 64 | Workflow artifact path: |
| 65 | Work packets: |
| 66 | Integration policy: |
| 67 | Verification: |
| 68 | Reusable artifacts: |
| 69 | |
| 70 | |
| 71 | Do not over-plan obvious work. The plan should be detailed enough to guide delegation and verification, not a substitute for execution. |
| 72 | |
| 73 | ## Approval Gates |
| 74 | |
| 75 | Obtain missing authorization before consequential actions: publishing or sending to a named destination, production mutations, destructive deletion or history rewriting, credential/account/security changes, or materially costly workloads. Existing explicit authorization persists within its scope. A generic request to implement does not authorize unrelated external actions. |
| 76 | |
| 77 | Authorized local edits, including replacing file contents as part of the requested change, and relevant disposable-fixture checks may proceed. Prepare the concrete result before asking for any missing authorization. Continue independent preparation and repair while a consequential action awaits approval. |
| 78 | |
| 79 | Use [risk-gates.md] when the action's authorization is unclear. |
| 80 | |
| 81 | ## Goal Mode |
| 82 | |
| 83 | Create a goal only when explicitly requested by the user or system/developer instructions and supported by the current tool contract. A request to run a workflow, work for several turns, or continue implementation is not by itself a request to create a tracked goal. Keep any authorized goal's full objective intact. |
| 84 | |
| 85 | ## Work Packets |
| 86 | |
| 87 | Each packet must be self-contained: |
| 88 | |
| 89 | |
| 90 | Packet ID: |
| 91 | Objective: |
| 92 | Context: |
| 93 | Files / sources: |
| 94 | Ownership: |
| 95 | Do: |
| 96 | Do not: |
| 97 | Expected output: |
| 98 | Verification: |
| 99 | |
| 100 | |
| 101 | Prefer packets with disjoint ownership: |
| 102 | |
| 103 | codebase discovery |
| 104 | dependency or API research |
| 105 | implementation slice |
| 106 | tests and fixtures |
| 107 | docs and examples |
| 108 | UX or product review |
| 109 | security or risk review |
| 110 | final verification |
| 111 | |
| 112 | For code-edit packets, assign non-overlapping files or modules. Tell workers they are not alone in the codebase, must not revert others' edits, and must adapt to concurrent changes. |
| 113 | |
| 114 | ## Subagents |
| 115 | |
| 116 | When a subagent runner is available: |
| 117 | |
| 118 | Spawn only concrete, bounded, materially useful subtasks. |
| 119 | Keep immediate blocking work local. |
| 120 | Delegate sidecar work that can run while the main agent makes progress. |
| 121 | Avoid duplicate work across agents. |
| 122 | Ask workers to edit directly only when their write scope is disjoint and clear. |
| 123 | Wait for subagents only when their result is needed for the next critical-path step. |
| 124 | |
| 125 | When no subagent runner is available: |
| 126 | |
| 127 | Perform isolated packet passes locally and label them as parent work. |
| 128 | Read only packet-relevant files during each pass. |
| 129 | Write packet notes under `results/`. |
| 130 | Integrate only after packet outputs are separate. |
| 131 | |
| 132 | ## Integration |
| 133 | |
| 134 | After packets complete, synthesize: |
| 135 | |
| 136 | |
| 137 | Accepted: |
| 138 | Rejected: |
| 139 | Conflicts: |
| 140 | Decisions: |
| 141 | Final changes: |
| 142 | Remaining risks: |
| 143 | |
| 144 | |
| 145 | Resolve conflicts explicitly. If two packets disagree, inspect the authoritative source before choosing. |
| 146 | |
| 147 | Use `scripts/collect_results.py` to produce an integration checklist from result files: |
| 148 | |
| 149 | |
| 150 | python3 /path/to/codex-dynamic-workflows/scripts/collect_results.py .workflow/<slug> |
| 151 | |
| 152 | |
| 153 | ## Verification |
| 154 | |
| 155 | Run the narrowest reliable checks first, then broaden as risk warrants: |
| 156 | |
| 157 | unit tests for touched code |
| 158 | typecheck or lint |
| 159 | build |
| 160 | browser or UI smoke test |
| 161 | script dry run |
| 162 | source citation check |
| 163 | migration dry run |
| 164 | manual checklist for non-code work |
| 165 | |
| 166 | Use `scripts/verify_workflow.py` to check workflow artifact completeness: |
| 167 | |
| 168 | |
| 169 | python3 /path/to/codex-dynamic-workflows/scripts/verify_workflow.py .workflow/<slug> |
| 170 | |
| 171 | |
| 172 | Report skipped checks honestly. Do not treat a workflow as complete until the evidence proves the original success criteria. |
| 173 | |
| 174 | ## Reusable Recipes |
| 175 | |
| 176 | When a run produces a useful pattern, save a concise recipe in a project-appropriate location, such as `.workflow/recipes/<name>.md` or a repo docs folder. Include: |
| 177 | |
| 178 | trigger |
| 179 | plan shape |
| 180 | packet list |
| 181 | verification checklist |
| 182 | known risks |
| 183 | |
| 184 | Do not save transcripts, secrets, bulky logs, credentials, or sensitive personal details. |
| 185 | |
| 186 | ## References |
| 187 | |
| 188 | Read `references/plan-schema.md` when a machine-readable workflow plan is useful. |
| 189 | Read `references/risk-gates.md` before risky or ambiguous operations. |
| 190 | Read `references/validation-examples.md` when forward-testing or improving this skill. |
| 191 |
Discussion
Browse more free Claude skills.