Agent Skillsspinabot/brigade › taskflow-inbox-triage

taskflow-inbox-triage

GitHub

展示TaskFlow收件箱分拣模式,根据意图分流消息:商务类发Slack并等待回复,个人类立即通知,其余汇总至日终摘要。提供状态管理、等待机制及运行时调用的完整代码示例。

skills/taskflow-inbox-triage/SKILL.md spinabot/brigade

Trigger Scenarios

需要按意图分类处理邮件或消息 实现异步等待外部回复后继续流程 构建基于TaskFlow的消息分拣工作流

Install

npx skills add spinabot/brigade --skill taskflow-inbox-triage -g -y
More Options

Use without installing

npx skills use spinabot/brigade@taskflow-inbox-triage

指定 Agent (Claude Code)

npx skills add spinabot/brigade --skill taskflow-inbox-triage -a claude-code -g -y

安装 repo 全部 skill

npx skills add spinabot/brigade --all -g -y

预览 repo 内 skill

npx skills add spinabot/brigade --list

SKILL.md

Frontmatter
{
    "name": "taskflow-inbox-triage",
    "metadata": {
        "brigade": {
            "emoji": "📥"
        }
    },
    "description": "Example TaskFlow authoring pattern for inbox triage. Use when messages need different treatment based on intent, with some routes notifying immediately, some waiting on outside answers, and others rolling into a later summary."
}

TaskFlow inbox triage

This is a concrete example of how to think about TaskFlow without turning the core runtime into a DSL.

Goal

Triage inbox items with one owner flow:

  • business → post to Slack and wait for reply
  • personal → notify the owner now
  • everything else → keep for end-of-day summary

Pattern

  1. Create one flow for the inbox batch.
  2. Run one detached task to classify new items.
  3. Persist the routing state in stateJson.
  4. Move to waiting only when an outside reply is required.
  5. Resume the flow when classification or human input completes.
  6. Finish when the batch has been routed.

Suggested stateJson shape

{
  "businessThreads": [],
  "personalItems": [],
  "eodSummary": []
}

Suggested waitJson when blocked on Slack:

{
  "kind": "reply",
  "channel": "slack",
  "threadKey": "slack:thread-1"
}

Minimal runtime calls

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 child = taskFlow.runTask({
  flowId: created.flowId,
  runtime: "acp",
  childSessionKey: "agent:main:subagent:classifier",
  task: "Classify inbox messages",
  status: "running",
  startedAt: Date.now(),
  lastEventAt: Date.now(),
});

if (!child.created) {
  throw new Error(child.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: "route_items",
  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,
});

Related example

  • skills/taskflow/examples/inbox-triage.lobster

Version History

  • db99206 Current 2026-07-05 11:00

Same Skill Collection

skills/1password/SKILL.md
skills/apple-notes/SKILL.md
skills/apple-reminders/SKILL.md
skills/bear-notes/SKILL.md
skills/blogwatcher/SKILL.md
skills/blucli/SKILL.md
skills/bluebubbles/SKILL.md
skills/canvas/SKILL.md
skills/discord/SKILL.md
skills/docx/SKILL.md
skills/eightctl/SKILL.md
skills/gemini/SKILL.md
skills/gh-issues/SKILL.md
skills/gifgrep/SKILL.md
skills/git-commit/SKILL.md
skills/github/SKILL.md
skills/gog/SKILL.md
skills/goplaces/SKILL.md
skills/healthcheck/SKILL.md
skills/himalaya/SKILL.md
skills/hyperframes/SKILL.md
skills/imsg/SKILL.md
skills/lead-scout/SKILL.md
skills/mcporter/SKILL.md
skills/model-usage/SKILL.md
skills/nano-pdf/SKILL.md
skills/node-connect/SKILL.md
skills/notion/SKILL.md
skills/oauth-setup/SKILL.md
skills/obsidian/SKILL.md
skills/openai-whisper-api/SKILL.md
skills/openai-whisper/SKILL.md
skills/openhue/SKILL.md
skills/oracle/SKILL.md
skills/ordercli/SKILL.md
skills/pdf/SKILL.md
skills/peekaboo/SKILL.md
skills/session-logs/SKILL.md
skills/share-skills/SKILL.md
skills/sherpa-onnx-tts/SKILL.md
skills/slack/SKILL.md
skills/songsee/SKILL.md
skills/sonoscli/SKILL.md
skills/spotify-player/SKILL.md
skills/summarize/SKILL.md
skills/taskflow/SKILL.md
skills/things-mac/SKILL.md
skills/tmux/SKILL.md
skills/trello/SKILL.md
skills/video-frames/SKILL.md
skills/voice-call/SKILL.md
skills/wacli/SKILL.md
skills/weather/SKILL.md
skills/xlsx/SKILL.md
skills/xurl/SKILL.md
skills/camsnap/SKILL.md
skills/coding-agent/SKILL.md
skills/sag/SKILL.md
skills/skill-creator/SKILL.md

Metadata

Files
0
Version
3a48cfb
Hash
88ad538c
Indexed
2026-07-05 11:00

Home - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-16 17:54
浙ICP备14020137号-1 $Map of visitor$