dynamic-workflows
Skill này làm gì
Skill này cho phép AI chạy một quy trình tùy chỉnh cho các tác vụ rộng và kéo dài, như đợt kiểm toán lớn hoặc nghiên cứu, trong đó nhiều agent riêng biệt mỗi agent xử lý một phần. Nó dành cho người có công việc quá lớn để gói gọn trong một cuộc trò chuyện.
Khi nào nên dùng
- ✓Khi bạn cần kiểm toán hoặc rà soát nhiều file, bản ghi hoặc hệ thống.
- ✓Khi tác vụ đủ lớn đến mức một cuộc trò chuyện đơn lẻ sẽ làm mất dấu các chi tiết.
- ✓Khi bạn muốn nhiều agent thử các ý tưởng cạnh tranh nhau trước khi bạn chọn một.
Liên kết skill
https://github.com/PostHog/posthog/blob/master/packages/agent/packages/harness/src/extensions/orchestration/skills/dynamic-workflows/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Kiểm tra tất cả bài viết trợ giúp của chúng tôi xem có thông tin giá cũ không, và cho tôi một bản tóm tắt ngắn về những gì cần sửa.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
AI viết một script nhỏ để khởi động nhiều agent tập trung, mỗi agent có ngữ cảnh mới. Script sắp xếp kết quả, kiểm tra xem có cần thêm công việc không, và chỉ trả lại cho bạn một bản tóm tắt ngắn.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
subagentparallel 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:
- Final outcome: what compact value must the workflow return?
- Work units: what list will the script iterate over?
- Evidence: what must each worker cite or return?
- Rubric: what makes an item pass, fail, rank higher, or require another pass?
- Coverage: how will the result prove that every required item was processed?
- Failure policy: which failures may become
null, and which must stop the workflow? - 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
Câu hỏi thường gặp
Điều này có hữu ích cho tác vụ nhỏ không?
Không. Nhiều agent tốn nhiều thời gian và nhiều token hơn, nên chỉ dùng cho công việc rộng hoặc có cấu trúc cao.
Tôi có thấy toàn bộ kết quả của mỗi agent không?
Không. Chỉ bản tóm tắt cuối cùng quay lại cuộc trò chuyện của bạn, dù tiến độ và nhật ký vẫn hiển thị trong lệnh gọi công cụ.
Quy trình có tự kiểm tra kết quả của nó không?
Có. Nó có thể dùng một agent riêng, không tạo ra kết quả đó, để kiểm tra lại.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 41k
- Vị trí xếp hạng
- #6822
- Giấy phép
- —
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
depot-ci
41kGiúp agent của bạn thiết lập và chạy quy trình Depot CI, một lựa chọn thay thế GitHub Actions, gồm chuyển các quy trình hiện có và đọc nhật ký chạy.
depot-container-builds
41kGiúp agent của bạn build image Docker trên các builder từ xa của Depot, gồm image đa nền tảng, đẩy lên registry và sửa lỗi build.
depot-github-runners
41kGiúp agent của bạn chuyển các job GitHub Actions sang runner do Depot quản lý, chọn kích thước và nhãn runner, và xử lý lỗi thiết lập runner.
editing-agents-md
41kGiúp agent của bạn quyết định một quy tắc nên nằm trong file AGENTS.md hay CLAUDE.md, và viết sao cho quy tắc được tuân thủ mà file không bị phình to.
Skill tương tự
add-model-provider
394kGiúp agent của bạn kết nối nhà cung cấp mô hình AI mới với OpenClaw bằng lệnh an toàn, giữ API key khỏi văn bản thuần và chạy thử.
acp-router
394kGiúp agent của bạn gửi một tác vụ đến trợ lý lập trình như Claude Code hoặc Cursor qua OpenClaw, để công việc chạy ngay trong công cụ đó.
browser-automation
394kHướng dẫn agent của bạn điều khiển trang web từng bước, gồm đăng nhập, tab và cách khôi phục khi trang ngừng phản hồi.