跳到正文
Skillpedia
智能体41k · #6822

dynamic-workflows

它能做什么

本技能让 AI 为大范围、长时间的任务运行自定义工作流,例如大型审计或研究,由许多独立的智能体各自负责一部分。适合工作量超出单次对话能力范围的人。

适用场景

  • ✓当你需要对大量文件、记录或系统进行审计或审查时。
  • ✓当任务规模大到单次对话可能会遗漏细节的时候。
  • ✓当你希望多个智能体先尝试不同的方案,再由你选择一个的时候。

技能链接

https://github.com/PostHog/posthog/blob/master/packages/agent/packages/harness/src/extensions/orchestration/skills/dynamic-workflows/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/PostHog/posthog/blob/master/packages/agent/packages/harness/src/extensions/orchestration/skills/dynamic-workflows/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请检查我们所有的帮助文章中是否有过时的价格信息,并给我一份简短的摘要,说明需要修改什么。”

每周 5 个新技能,1 分钟读完。

工作原理

AI 会编写一个小脚本,启动许多专注的智能体,每个智能体都使用全新的上下文。脚本会对结果进行整理,检查是否需要更多工作,最后只向你返回一份简短的摘要。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Dynamic workflows

The workflow tool runs a JavaScript program that coordinates isolated subagents. Use the program as a task-specific harness: JavaScript owns iteration, routing, barriers, and completion checks, while each agent() call handles one focused unit of work in a fresh context window.

Only the script's return value enters the parent context. Intermediate results stay inside the workflow, while structured progress and logs remain visible in the tool call. End broad workflows with a compact synthesis instead of returning every worker transcript.

This separation is useful when one long conversation would make it hard to remain complete, impartial, or faithful to the original goal. It is not a default for ordinary work. More agents mean more latency and token use.

Decide whether a workflow earns its cost

Use a workflow when at least one of these is true:

  • Breadth: the task covers many independent files, records, systems, claims, or alternatives.
  • Structure: the work needs explicit stages, routing, aggregation, or a completion condition.
  • Independent judgment: a result should be challenged by an agent that did not produce it.
  • Competing approaches: several agents should attempt the same problem before a separate judge chooses.
  • Unknown work size: the task should repeat until no unresolved items or new findings remain.
  • Context isolation: each unit benefits from a clean context that contains only its evidence and rubric.

Good requests include:

  • Audit every ingestion stage for one invariant, then verify each reported violation.
  • Form independent explanations for a production symptom and try to disprove each one.
  • Generate several migration plans, compare their risks, and return one tested recommendation.
  • Classify a large issue backlog, deduplicate related reports, and prepare actions for confirmed groups.
  • Check every factual statement in a technical report against primary evidence.
  • Apply the same independent change across disjoint packages, then review the combined diff.

Do not use a workflow for:

  • One question, one investigation, or one edit.
  • One or two independent delegations. Use subagent parallel mode instead.
  • Work where nearly all parent conversation context is essential.
  • Several writers that would edit the same files or shared state concurrently.
  • A routine task where direct execution is cheaper and easier to verify.

Define success before writing JavaScript

Write down these decisions first:

  1. Final outcome: what compact value must the workflow return?
  2. Work units: what list will the script iterate over?
  3. Evidence: what must each worker cite or return?
  4. Rubric: what makes an item pass, fail, rank higher, or require another pass?
  5. Coverage: how will the result prove that every required item was processed?
  6. Failure policy: which failures may become null, and which must stop the workflow?
  7. Write boundaries: which agents may edit, and can their files overlap?

Keep these decisions in JavaScript variables, schemas, and stop conditions. Do not rely on one agent to remember the whole plan across a large run.

Choose an orchestration pattern

Patterns compose. Use the smallest combination that creates a reliable feedback loop.

Classify and act

Use one agent to assign each item to a small set of categories, then route each category to a specialized prompt or agent.

Use it for mixed backlogs, heterogeneous files, and requests where not every item needs the same treatment. Keep classification structured and include an unknown route. Do not force uncertain items into a confident category.

Fan out and synthesize

Map independent items to agents, wait for all results, then give a bounded set of structured outputs to one synthesis agent.

Use it for broad audits, research, and repeated checks. The synthesis step is a barrier: it runs only after the fan-out settles. Return coverage and failures with the synthesis so missing work stays visible.

Adversarial verification

Separate production from judgment. A worker proposes a finding or change; another agent checks it against an explicit rubric and evidence.

Use it when false positives, unsupported claims, or self-review bias would be costly. A verifier must receive the original requirement and evidence, not only the worker's conclusion.

Generate and filter

Ask several agents for candidates, normalize and deduplicate them, then use a

常见问题

这对小任务有用吗?

没有用。许多智能体需要更多时间和更多 token,因此只适用于大范围或高度结构化的工作。

我会看到每个智能体的完整输出吗?

不会。只有最终摘要会返回到对话中,但进度和日志仍可在工具调用中查看。

工作流能检查自己的发现吗?

可以。它可以使用一个未参与产生结果的独立智能体来对其进行质疑。

详情

作者的原始描述

Designs and runs task-specific JavaScript harnesses with the `workflow` tool. Use for broad, long-running, highly structured, or adversarial work that benefits from many isolated agents: exhaustive audits, root-cause investigations, research, large triage queues, competing proposals, repeated verification, and independent changes across disjoint files. Covers decomposition patterns, agent and model routing, structured handoffs, failure handling, and the workflow runtime API.

repo: PostHog/posthog

热度

GitHub 星标
41k
排名
#6822
许可证
—
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能