Logo Workflow

Workflow

Cộng đồng
mweinbach
workflow

Tạo và chạy quy trình làm việc đa tác nhân có tính xác định — một tập lệnh JavaScript phân nhánh, chạy theo chuỗi, lặp và đánh giá kết quả qua nhiều tác nhân con. Dùng khi công việc có thể chia thành nhiều phần tương tự (kiểm tra mọi tệp đã thay đổi, nghiên cứu N chủ đề, chuyển đổi M vị trí gọi), cần xác minh đối kháng hoặc hội đồng đánh giá, hay khi người dùng yêu cầu “dùng quy trình làm việc”, “phân nhánh cho các tác nhân” hoặc làm thật toàn diện. Không dùng cho một nhiệm vụ đơn lẻ được giao cho tác nhân khác — spawnAgent tiết kiệm hơn.

Tổng quan

Nhà phát hànhmweinbach
Kho mãagent-coworker
Tên kỹ năngworkflow
Sao
156
Bản fork
14
Tệp đi kèm
Chỉ có hướng dẫn
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Hướng dẫn có đủ mọi thứ cần thiết

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được mweinbach công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Workflow trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/mweinbach/agent-coworker/tree/main/skills/workflow
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/mweinbach/agent-coworker.git /tmp/agent-coworker
mkdir -p .claude/skills
cp -r /tmp/agent-coworker/skills/workflow .claude/skills/workflow
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Workflow trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Workflow ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Workflow với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Workflows

A workflow is a script you write that orchestrates child agents in real code. The harness runs it in a sandbox and drives AgentControl from it.

The patterns below are available orchestration techniques, not mandatory review rounds. Respect the user's requested scope and task-specific review limits. Use additional discovery rounds for explicitly exhaustive work or when new evidence warrants them; ordinary PR feedback handling does not require discovery until dry.

Explicit user instructions override this skill's defaults within higher-priority instructions and enforced tool boundaries. Infer routine reversible details and finish the authorized workflow. If a requirement genuinely blocks progress, name this SKILL.md, quote the instruction, and explain the concrete decision needed. Keep handoffs and final results concise and readable.

When this is worth it

Reach for a workflow when the work is wide (many similar units) or needs structure (verify each finding independently, judge N candidates, loop until nothing new turns up). One workflow call replaces dozens of spawnAgent / waitForAgent calls and keeps their transcripts out of your context.

Do not use it for a single delegated task. spawnAgent is one call and has no sandbox to reason about.

Delegate independent units when it saves time or improves quality. Give each child context, constraints, and a concrete output; avoid overlapping edits and duplicate investigation. Use only agent roles and model overrides exposed by the harness. If delegation is unavailable, continue directly where possible and report any material coverage gap instead of repeatedly retrying the same failed route.

Reusable workflows

Call { action: "list" } to discover bundled and saved workflows. Run one by name:

json
{
  "name": "deep-research",
  "args": {
    "query": "Compare two migration approaches",
    "model": "provider:model-id",
    "verificationModel": "provider:stronger-model-id"
  }
}

Save a validated definition for the current project or every project:

json
{
  "action": "save",
  "name": "review-changes",
  "scope": "project",
  "script": "export const meta = ..."
}

Project workflows live in .cowork/workflows/; global workflows live in ~/.cowork/workflows/; bundled workflows ship with Cowork. Resolution order is project, global, bundled. A name is lowercase kebab-case and must match meta.name. Saving compiles and inspects metadata but does not run child agents. Existing files require an explicit overwrite: true.

The bundled deep-research workflow plans bounded questions, gathers structured source-backed claims, independently verifies every claim, and synthesizes only claims that survive. It reports failed shards, dropped claims, and uncertainties as coverage limitations and marks the result partial when coverage is incomplete. Use it for provider-agnostic deep research through the ordinary workflow harness: args.query is required, maxQuestions defaults to 5 and accepts 2–6, and maxClaimsPerQuestion defaults to 4 and accepts 1–4. Invalid depth arguments are rejected before any child agents spawn so bounded coverage is explicit rather than silently capped. Use args.model for the default child model, with optional plannerModel, researchModel, verificationModel, and synthesisModel phase overrides. Omit model args to inherit normal session/default routing.

The contract

Two exports, zero imports. Host functions arrive as the argument to the default export:

ts
export const meta = {
  name: "review-diff",
  description: "Review each changed file, then verify every finding.",
  phases: ["review", "verify"],
};

export default async function run({ agent, parallel, pipeline, phase, log, args, budget }) {
  phase("review");
  const findings = await pipeline(
    args.files,
    (file) => agent(`Review ${file} for correctness bugs.`, {
      label: `review:${file}`, phase: "review", agentType: "explorer",
      schema: {
        type: "object",
        properties: {
          bugs: {
            type: "array",
            items: {
              type: "object",
              properties: { line: { type: "number" }, claim: { type: "string" } },
              required: ["line", "claim"], additionalProperties: false,
            },
          },
        },
        required: ["bugs"], additionalProperties: false,
      },
    }),
    (review, file) => parallel(review.bugs.map((bug) => () =>
      agent(`Try to REFUTE this claim about ${file}:${bug.line}: ${bug.claim}`, {
        label: `verify:${file}:${bug.line}`, phase: "verify", onError: "null",
        schema: {
          type: "object",
          properties: { refuted: { type: "boolean" }, why: { type: "string" } },
          required: ["refuted", "why"], additionalProperties: false,
        },
      }).then((verdict) => ({ ...bug, file, verdict })))),
  );

  const real = compact(findings.flat()).filter((f) => f.verdict && !f.verdict.refuted);
  log(`${real.length} findings survived verification`);
  return { findings: real };
}

API

agent(prompt, opts?)One child agent. Returns final text, or a validated object when opts.schema is set.
parallel(thunks)Barrier — awaits all. A rejected thunk yields null.
pipeline(items, ...stages)Per-item stages, no barrier between them. Stages get (prev, originalItem, index).
judge(candidate, opts)n independent judges; aggregate: majority/unanimous/meanScore/worst.
compact(items)Drop nulls.
phase(title), log(msg)Progress. Titles must be in meta.phases.
args, budgetFrozen tool input; { total, spent(), remaining() } in USD.

agent() options: label, phase, schema, model, effort, agentType (default/explorer/research/worker/reviewer, or a profile ref), targetPaths, isolation + briefing, onError, timeoutMs.

Default to pipeline, not parallel

pipeline has no barrier between stages: item 2 can reach stage 3 while item 5 is still in stage 1. Wall-clock is the slowest single chain, not the sum of per-stage maxima.

A barrier is only correct when a stage genuinely needs every prior result at once — deduping across the whole set, or exiting early when the total is zero. It is not justified by "I need to flatten first" (do that inside a stage) or "the stages feel separate" (that is what pipeline models).

If you write const a = await parallel(...); const b = a.flat(); await parallel(b...) and the middle line has no cross-item dependency, it should have been a pipeline.

Patterns worth knowing

Adversarial verify. Ask verifiers to refute, not to confirm. Kill a finding when a majority refute it. This is what stops plausible-but-wrong results.

Perspective-diverse verify. When something can fail in more than one way, give each verifier a distinct lens (correctness, security, performance, does-it-repro) instead of N identical ones. Diversity catches what redundancy cannot.

Judge panel. Generate N independent attempts from different angles, score them, then synthesize from the winner while grafting the best ideas from the rest. Beats one-attempt-iterated when the solution space is wide.

Loop-until-dry. For explicitly requested exhaustive, unknown-size discovery, keep going until K consecutive rounds surface nothing new. Dedupe against everything seen, not against what was confirmed — otherwise rejected items reappear every round and it never converges.

ts
const seen = new Set(); const confirmed = []; let dry = 0;
while (dry < 2) {
  const fresh = compact(await parallel(FINDERS.map((f) => () => agent(f))))
    .flatMap((r) => r.items).filter((i) => !seen.has(key(i)));
  if (!fresh.length) { dry++; continue; }
  dry = 0; fresh.forEach((i) => seen.add(key(i)));
  confirmed.push(...fresh);
}

Budget-scaled depth. while (budget.total && budget.remaining() > 50_000) { ... }. Guard on budget.total — with no ceiling set, remaining() is Infinity.

No silent caps. If you bound coverage (top-N, sampling, no retry), log() what was dropped. Silent truncation reads as "covered everything" when it did not.

Rules the sandbox enforces

  • No imports, no require, no eval. Everything is the default export's argument.
  • meta must be a pure literal — no variables, calls, or interpolation.
  • Date.now(), new Date() and Math.random() throw. They would break run resume. new Date(0) and the rest of Math work. Derive variation from args or the stage index instead.
  • onError defaults to "fail" — the promise rejects and you handle it. Use "null" to opt into null-coalescing, then compact().

Iterating

A script that does not compile comes back as { ok: false, issues } — fix it and call again, no spend. Use dryRun: true to see the whole call graph and fan-out count before spending anything.

Use action: "save" after the definition compiles when a reusable saved workflow is requested. An inline { script } remains best for one-off orchestration.

If a run fails partway, pass resumeFromRunId with the previous run id: every call that is byte-for-byte identical replays from the journal for free, and only what actually changed re-runs.

Scale to the ask

"Find any bugs" → a few finders, single-vote verify. "Audit this thoroughly" or "be comprehensive" → a larger finder pool, 3–5 vote adversarial verification, and a synthesis stage. Lean toward thoroughness for review/audit/research, and toward brevity for quick checks.

Once the requested coverage and required checks pass, deliver the result. Repeat or expand verification only for new changes, failures, or unresolved concerns. Do not add tests that only mirror reversible, low-impact implementation details.

Câu hỏi thường gặp

Kỹ năng AI Workflow làm được gì?

Tạo và chạy quy trình làm việc đa tác nhân có tính xác định — một tập lệnh JavaScript phân nhánh, chạy theo chuỗi, lặp và đánh giá kết quả qua nhiều tác nhân con. Dùng khi công việc có thể chia thành nhiều phần tương tự (kiểm tra mọi tệp đã thay đổi, nghiên cứu N chủ đề, chuyển đổi M vị trí gọi), cần xác minh đối kháng hoặc hội đồng đánh giá, hay khi người dùng yêu cầu “dùng quy trình làm việc”, “phân nhánh cho các tác nhân” hoặc làm thật toàn diện. Không dùng cho một nhiệm vụ đơn lẻ được giao cho tác nhân khác — spawnAgent tiết kiệm hơn.

Vì sao nên dùng Workflow trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Workflow là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Workflow trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/mweinbach/agent-coworker/tree/main/skills/workflow. TypingMind đọc tệp SKILL.md rồi cài đặt kỹ năng để bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Workflow?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Workflow với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Workflow với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Workflow có miễn phí không?

Kỹ năng này được mweinbach phát hành trên GitHub. Hãy xem điều khoản giấy phép trong kho mã. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇