Skip to content
Back to skills

Dynamic Workflows

ASecurity

Create or run Pi JavaScript workflows with coordinated subagents. Use for requested multi-agent workflow orchestration.

  • 10 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 23, 2026
ai-agentsjavascripttypescriptgojavaapi

Works with

  • api

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 23, 2026

npx -y skills add shekohex/dotai --skill dynamic-workflows --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Dynamic Workflows?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Dynamic Workflows
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/shekohex-dynamic-workflows/badge)](https://www.skillsdirectory.com/skills/shekohex-dynamic-workflows)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: dynamic-workflows
description: Create or run Pi JavaScript workflows with coordinated subagents. Use for requested multi-agent workflow orchestration.
---

# 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.

## 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()`, `Math.random()`, or `new Date()`
- `parallel()` takes **functions**, not promises: `parallel(items.map(item => () => agent(...)))`
- Every workflow must call `agent()` at least once
- Use `{ label: 'short name' }` on every `agent()` call
- Give every `agent()` prompt a concrete return contract. Text agents return final text verbatim; if the script will parse JSON or fields, prefer `schema`.

## Choose details as needed

- Read [references/API.md](references/API.md) when authoring or changing tool parameters, schemas, agent options, modes, resume behavior, or failure handling.
- Read [references/PATTERNS.md](references/PATTERNS.md) when choosing orchestration topology. Do not load all patterns for a saved workflow invocation.

Give each agent a bounded outcome and return contract. Isolate concurrent edits and keep dependent work sequential. Handle failed or missing branch results explicitly before claiming workflow success.

Completion means the requested workflow result is inspected and its acceptance criteria are met. Starting a background run is a launch result, not proof that its work completed. Continue handling results when the user requested completion or monitoring.

Files in this skill

  • SKILL.md2.7 KB
  • references/API.md10.1 KB
  • references/PATTERNS.md7.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.