dynamic-workflowslisted
Install: claude install-skill shekohex/dotai
# Dynamic Workflows
The `workflow` tool runs a JavaScript harness that spawns and coordinates subagents via `agent()`, `parallel()`, and `pipeline()`. Each subagent gets its own context window and focused goal, combating agentic laziness, self-preferential bias, and goal drift.
## Quick Start
If the `workflow` tool is not available, ask the user to run `/workflow on` to enable it. Then call the tool with exactly one script source:
- `script`: raw JavaScript inline
- `scriptFile`: absolute path to a JavaScript workflow file
Prefer `scriptFile` when a workflow file already exists; do not rewrite it inline.
Inline `script` example:
```javascript
export const meta = {
name: "verify_claims",
description: "Verify every factual claim in a document",
phases: [{ title: "Extract" }, { title: "Verify" }, { title: "Report" }],
};
phase("Extract");
const claims = await agent("List every factual claim...", {
label: "extract claims",
schema: {
type: "object",
properties: { claims: { type: "array", items: { type: "string" } } },
required: ["claims"],
},
});
phase("Verify");
const verified = await parallel(
claims.claims.map(
(c, i) => () => agent("Verify this claim against the codebase: " + c, { label: "verify " + i }),
),
);
phase("Report");
return { claims: claims.claims, verified };
```
Rules:
- First statement must be `export const meta = { name, description, phases }`
- Plain JavaScript only — no TypeScript, imports, `require()`, `Date.now()`,