Communityコーディング&開発github.com

TaskFlow

複数のステップからなるバックグラウンドジョブを、1つの所有者セッション、状態、待機、子タスクを持つ耐久性のあるTaskFlowジョブとして調整します。

TaskFlow とは?

TaskFlowは、AIエージェントや開発ツール向けのスキルであり、単一のプロンプトやデタッチされた実行を超えて存続する必要があるジョブを調整するためのものです。 このスキルを使用すると、1つのオーナーセッション、1つのリターンコンテキスト、および作業の検査や再開が可能な1つの場所を維持しながら、マルチステップのバックグラウンドワークを管理できます。 主な機能には、フローID、オーナーセッション、currentStep、stateJson、waitJsonなどの状態管理、リンクされた子タスクの作成、リビジョントラッキングによる競合を起こさないミューテーションのサポートが含まれます。 これは、Claude Code、Cursor、CodexなどのAIエージェントのコンテキストで動作するように設計されており、管理フローとミラーリングフローの両方をサポートし、プラグインやツールワークが再起動やリビジョンの競合をクリーンに乗り越えられるようにします。 状態管理と子タスクのリンクにランタイムAPI(api.runtime.tasks.flow)を利用し、分岐やビジネスロジックは高レイヤーに委ねることで、クリーンな関心の分離を実現します。

対応✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/clawdbot/clawdbot/tree/main/skills/taskflow

Installed? Explore more コーディング&開発 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

TaskFlow は何をしますか?

TaskFlowは、ジョブが1つのプロンプトや1つのデタッチされた実行を超えて存続する必要がある場合に使用しますが、それでも1つのオーナーセッション、1つのリターンコンテキスト、および作業を検査または再開するための1つの場所を維持したい場合に最適です。

いつ使用するか

  • 1人のオーナーによるマルチステップのバックグラウンドワーク
  • デタッチされたACPまたはサブエージェントタスクを待機する作業
  • オーナーに1つの明確な更新を発行する必要がある可能性のあるジョブ
  • ステップ間で小さな永続化された状態を必要とするジョブ
  • 再起動やリビジョンの競合をクリーンに乗り越える必要があるプラグインまたはツールワーク

TaskFlowが所有するもの

  • フローID
  • オーナーセッションとリクエスタオリジン
  • currentStep、stateJson、waitJson
  • リンクされた子タスクとその親フローID
  • 終了、失敗、キャンセル、待機中、ブロック中の状態
  • 競合を起こさないミューテーションのためのリビジョントラッキング

分岐やビジネスロジックは所有しません。それらはLobster、acpx、または呼び出し元のコードに任せてください。

現在のランタイム形状

正規のプラグイン/ランタイムエントリポイント:

  • api.runtime.tasks.flow
  • api.runtime.taskFlow はエイリアスとして引き続き存在しますが、api.runtime.tasks.flow が正規の形状です

バインディング:

  • api.runtime.tasks.flow.fromToolContext(ctx) : すでに信頼できる sessionKey を持つツールコンテキストがある場合
  • api.runtime.tasks.flow.bindSession({ sessionKey, requesterOrigin }) : バインディングレイヤーがすでにセッションと配信コンテキストを解決している場合

管理フローのライフサイクル:

  1. createManaged(...)
  2. runTask(...)
  3. setWaiting(...) : 人または外部システムを待機する場合
  4. resume(...) : 作業を続行できる場合
  5. finish(...) または fail(...)
  6. requestCancel(...) または cancel(...) : ジョブ全体を停止する必要がある場合

設計上の制約

  • コードがオーケストレーションを所有している場合は、管理 TaskFlow を使用してください。
  • ミラーリングフローは、デタッチされたACP/サブエージェント作業のためにコアランタイムによって作成されます。このスキルは主に管理フローに関するものです。
  • stateJson を永続化された状態バッグとして扱ってください。個別の setFlowOutput や appendFlowOutput API はありません。
  • 作成後のすべてのミューテーションメソッドはリビジョンチェックされます。各ミューテーションが成功した後、最新の flow.revision を引き継いでください。
  • runTask(...) は子タスクをフローにリンクします。親のオーケストレーションが必要な場合、手動でデタッチされたタスクを作成する代わりにこれを使用してください。

形状の例

const taskFlow = api.runtime.tasks.flow.fromToolContext(ctx);

const created = taskFlow.createManaged({
  controllerId: "my-plugin/inbox-triage",
  goal: "triage inbox",
  currentStep: "classify",
  stateJson: {
    businessThreads: [],
    personalItems: [],
    eodSummary: [],
  },
});

const classify = taskFlow.runTask({
  flowId: created.flowId,
  runtime: "acp",
  childSessionKey: "agent:main:subagent:classifier",
  runId: "inbox-classify-1",
  task: "Classify inbox messages",
  status: "running",
  startedAt: Date.now(),
  lastEventAt: Date.now(),
});

if (!classify.created) {
  throw new Error(classify.reason);
}

const waiting = taskFlow.setWaiting({
  flowId: created.flowId,
  expectedRevision: created.revision,
  currentStep: "await_business_reply",
  stateJson: {
    businessThreads: ["slack:thread-1"],
    personalItems: [],
    eodSummary: [],
  },
  waitJson: {
    kind: "reply",
    channel: "slack",
    threadKey: "slack:thread-1",
  },
});

if (!waiting.applied) {
  throw new Error(waiting.code);
}

const resumed = taskFlow.resume({
  flowId: waiting.flow.flowId,
  expectedRevision: waiting.flow.revision,
  status: "running",
  currentStep: "finalize",
  stateJson: waiting.flow.stateJson,
});

if (!resumed.applied) {
  throw new Error(resumed.code);
}

taskFlow.finish({
  flowId: resumed.flow.flowId,
  expectedRevision: resumed.flow.revision,
  stateJson: resumed.flow.stateJson,
});

条件分岐はランタイムの上に置く

状態とタスクのリンクにはフローランタイムを使用します。決定はオーサリングレイヤーに残してください:

  • business -> Slackに投稿して待機
  • personal -> 今すぐオーナーに通知
  • later -> 1日の終わりのサマリーバケットに追加

運用パターン

  • 再開に必要な最小限の状態のみを保存します。
  • 人間が読める待機理由は blockedSummary に、構造化された待機メタデータは waitJson に格納します。
  • オーケストレーターが子作業のコンパクトな健全性ビューを必要とする場合は、getTaskSummary(flowId) を使用します。
  • 呼び出し元がフローのスケジューリングを直ちに停止させたい場合は、requestCancel(...) を使用します。
  • アクティブなリンクされた子タスクもキャンセルしたい場合は、cancel(...) を使用します。

例

  • skills/taskflow/examples/inbox-triage.lobster を参照
  • skills/taskflow/examples/pr-intake.lobster を参照
  • 具体的なルーティングパターンについては skills/taskflow-inbox-triage/SKILL.md を参照

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

1password

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

acp-router

Route plain-language requests for Claude Code, Cursor, Copilot, OpenClaw ACP, OpenCode, Gemini CLI, Grok Build, Qwen, Kiro, Kimi, iFlow, Factory Droid, Kilocode, or explicit ACP harness work into either OpenClaw ACP runtime sessions or direct acpx-driven sessions ("telephone game" flow). For coding-agent thread requests, read this skill first, then use only `sessions_spawn` for thread creation. Codex chat binding defaults to the native Codex app-server plugin unless ACP is explicit or background spawn needs ACP.

add-model-provider

Add and live-prove a model provider with non-interactive config one-liners, without exposing credentials.

agent-transcript

Requested GitHub PR/issue agent transcripts: redact, trim, preview, and insert safely.

apple-notes

Create, view, edit, delete, search, move, or export Apple Notes via the memo CLI on macOS.

apple-reminders

List, add, edit, complete, or delete Apple Reminders and reminder lists via remindctl.

auto-qa

Run OpenClaw-wide autonomous QA and live/stress campaigns across independent subsystem lanes, with verified fixes and a resumable evidence report.

autoreview

Structured code review through the shared OpenClaw agent-skills installation.

bear-notes

Create, search, and manage Bear notes via grizzly CLI.

blacksmith-testbox

Run Blacksmith Testbox for CI-parity checks, secrets, hosted services, migrations, or builds local cannot reproduce.

block-kit

Use proactively for structured or interactive Slack replies, and when asked to author or validate native Slack Block Kit JSON.

blogwatcher

Monitor blogs and RSS/Atom feeds for updates using the blogwatcher CLI.

blucli

BluOS CLI (blu) for discovery, playback, grouping, and volume.

bluebubbles

Send and manage iMessages via BlueBubbles, including attachments, tapbacks, edits, replies, and groups.

browser-automation

Use when controlling web pages with the OpenClaw browser tool, especially multi-step flows, login checks, tab management, or recovery from stale refs/timeouts.

camsnap

Capture frames or clips from RTSP/ONVIF cameras and local webcams, including USB pan/tilt/zoom control.

canvas

Present HTML on connected OpenClaw node canvases, navigate/eval/snapshot, and debug canvas host URLs.

channel-message-flows

Use when running QA Lab channel message flow evidence.

clawdtributor

Clawtributor PRs here, last week or another window: discover conversation refs, recheck GitHub, rank by impact.

clawhub

Search ClawHub for plugins by default, or skills when explicitly requested; install, verify, update, uninstall, publish, or sync skills.

関連スキル