creating-workflows

A guide for creating reusable JavaScript workflows that coordinate several helper agents through steps, loops, parallel tasks, and summaries.

In plain words
What is it for?
Use it for recurring research, review, processing, or verification pipelines that need several agent calls.
Why use it?
It provides a fixed structure for repeatable multi-step work instead of rebuilding the orchestration each time.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/itmisx/deepx-code/creating-workflows
Any agent
npx skills add itmisx/deepx-code --skill creating-workflows
Clone the repo
git clone --depth 1 https://github.com/itmisx/deepx-code

Made for: Claude Code, Codex.

Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,992 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00058 $0.03992
Opus 5 $0.00029 $0.01996
Sonnet 5 $0.00012 $0.00798
Haiku 4.5 $0.00006 $0.00399

Measured yesterday against content hash dd2cee4aeb8d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

creating-workflows scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skill/skills/creating-workflows/SKILL.md · 228 lines

How it starts

The opening of the file, as written. The whole thing — 228 lines — stays where its author put it; the contents beside it link to each section on GitHub.

创建 workflow

deepx 的 workflow 是一段 JavaScript 脚本,用固定流程编排多个子 agent:脚本控制流程(循环、扇出、汇总),每个 agent() 调用做一次真正的 LLM 工作。脚本在 QuickJS 沙箱里跑,只能通过下列全局函数触达外界。

何时用

  • 多视角审查、扇出研究、流水线处理、对抗式验证、循环到无新增——这类固定可复用、会重复跑的多步编排。
  • 一次性的简单任务别用 workflow,直接做。

脚本格式(务必照此)

export const meta = {
  name: "my-flow",              // 必须等于文件名(不含后缀 .mjs),kebab-case
  description: "一句话说明这个 workflow 做什么",
  phases: [                     // 可选,用于进度展示
    { title: "Collect", detail: "收集信息" },
    { title: "Report",  detail: "汇总成报告" },
  ],
};

export default async function main(args) {   // 入口必须是 default 导出的 async 函数
  phase("Collect");
  const data = await agent("收集关于 X 的信息", { label: "收集信息", model: "flash" });

  phase("Report");
  // 汇总/出报告这步用 pro(更稳),收集那步用默认 flash。label 用任务描述、跟随用户语言。
  return await agent("基于以下内容写报告:\n" + data, { label: "写报告", model: "pro" });
}

规则:

  • 第一段(去注释后)必须是 export const meta = {...},且 meta.name 等于文件名。
  • 名字只能小写字母、数字、连字符(kebab-case)。
  • 入口必须是 export default async function main(args)

全局 API

  • agent(prompt, opts?) → Promise:跑一个子 agent,resolve 出它的文本结果。 opts:

    • label:进度显示名(单行显示在步骤里)。写成简短的任务描述(如「正确性审查」/「collect changes」),让用户一眼看懂这步在干嘛;用与用户请求相同的语言(用户用中文提需求就用中文 label,英文就英文)。别用 collector / step1 这种没信息量的英文 ID
    • model:"flash"(默认,快、便宜,适合收集/检索/简单审查这类轻活)或 "pro"(更强,适合汇总合并、复杂推理、写最终报告这类重活)。不写就是 flash。
    • phase:归属阶段(配合 phase())。
    • schema:JSON Schema,要结构化结果时用,resolve 出已解析的对象。
    // 轻活:用 flash(省略 model 也是 flash)。label 写成任务描述、跟随用户语言。
    const data = await agent("收集 X 的资料", { label: "收集资料", model: "flash" });
    
    // 重活(汇总/出报告):显式 model: "pro"
    const report = await agent("把上面资料合并成 markdown 报告:\n" + data, {
      label: "写报告",
      model: "pro",
    });
    
    // 要结构化结果:加 schema(resolve 出已解析对象,不是字符串)
    const picks = await agent("列出 3 条改进建议", {
      label: "列改进建议",
      model: "pro",
      schema: {
        type: "object",
        required: ["items"],
        properties: {
          items: { type: "array", items: { type: "string" } },
        },
      },
    });
    // picks.items 是数组
    

Read the full file on GitHub · 228 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 228 lines · 58 tokens per session scan A dd2cee4aeb8d

Subscribe to this mod's changes

creating-workflows is a skill published in the GitHub repository itmisx/deepx-code (383 stars, last pushed 7d ago), licensed MIT. It adds 58 tokens to every session and 3,992 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.