본문으로 건너뛰기
Skillpedia
자동화11k · #11738

taskflow

하는 일

이 스킬은 여러 백그라운드 작업에 걸치지만 여전히 하나의 소유자에 속하는 긴 작업을 AI가 관리하도록 합니다. 백그라운드 작업을 하나의 작업으로 추적하고, 재개하고, 보고받고 싶은 사람들을 위한 스킬입니다.

사용하는 경우

  • ✓여러 백그라운드 작업이 필요하지만 하나의 작업으로 보여야 할 때.
  • ✓작업이 다음으로 가기 전에 답변이나 다른 작업을 기다려야 할 때.
  • ✓재시작 후에도 긴 작업이 살아남아 깔끔하게 보고해야 할 때.

스킬 링크

https://github.com/spinabot/brigade/blob/main/skills/taskflow/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/spinabot/brigade/blob/main/skills/taskflow/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 주간 지표를 여러 단계로 모으는 백그라운드 작업을 실행하고, 끝나면 업데이트를 한 번 보내 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

AI는 현재 단계, 적은 양의 저장된 상태, 대기 조건을 추적하는 흐름 기록을 하나 만듭니다. 각 백그라운드 작업을 그 흐름에 연결해, 진행 상황과 완료 여부를 한곳에서 확인할 수 있게 합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

TaskFlow

Use TaskFlow when a job needs to outlive one prompt or one detached run, but you still want one owner session, one return context, and one place to inspect or resume the work.

When to use it

  • Multi-step background work with one owner
  • Work that waits on detached ACP or subagent tasks
  • Jobs that may need to emit one clear update back to the owner
  • Jobs that need small persisted state between steps
  • Plugin or tool work that must survive restarts and revision conflicts cleanly

What TaskFlow owns

  • flow identity
  • owner session and requester origin
  • currentStep, stateJson, and waitJson
  • linked child tasks and their parent flow id
  • finish, fail, cancel, waiting, and blocked state
  • revision tracking for conflict-safe mutations

It does not own branching or business logic. Put that in Lobster, acpx, or the calling code.

Current runtime shape

Canonical plugin/runtime entrypoint:

  • api.runtime.tasks.flow
  • api.runtime.taskFlow still exists as an alias, but api.runtime.tasks.flow is the canonical shape

Binding:

  • api.runtime.tasks.flow.fromToolContext(ctx) when you already have trusted tool context with sessionKey
  • api.runtime.tasks.flow.bindSession({ sessionKey, requesterOrigin }) when your binding layer already resolved the session and delivery context

Managed-flow lifecycle:

  1. createManaged(...)
  2. runTask(...)
  3. setWaiting(...) when waiting on a person or an external system
  4. resume(...) when work can continue
  5. finish(...) or fail(...)
  6. requestCancel(...) or cancel(...) when the whole job should stop

Design constraints

  • Use managed TaskFlows when your code owns the orchestration.
  • One-task mirrored flows are created by core runtime for detached ACP/subagent work; this skill is mainly about managed flows.
  • Treat stateJson as the persisted state bag. There is no separate setFlowOutput or appendFlowOutput API.
  • Every mutating method after creation is revision-checked. Carry forward the latest flow.revision after each successful mutation.
  • runTask(...) links the child task to the flow. Use it instead of manually creating detached tasks when you want parent orchestration.

Example shape

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,
});

Keep conditionals above the runtime

Use the flow runtime for state and task linkage. Keep decisions in the authoring layer:

  • business → post to Slack and wait
  • personal → notify the owner now
  • later → append to an end-of-day summary bucket

Operational pattern

  • Store only the minimum state needed to resume.
  • Put human-readable wait reasons in blockedSummary or structured wait metadata in waitJson.
  • Use getTaskSummary(flowId) when the orchestrator needs a compact health view of child work.
  • Use requestCancel(...) when a caller wants the flow to stop scheduling immediately.
  • Use cancel(...) when you also want active linked child tasks cancelled.

Examples

  • See skills/taskflow/examples/inbox-triage.lobster
  • See skills/taskflow/examples/pr-intake.lobster
  • See `skills/taskflow-inbox-t
자주 묻는 질문

작업의 논리를 스킬이 정하나요?

아닙니다. 분기는 호출하는 코드나 별도의 워크플로 도구가 정하며, 이 스킬은 작업을 추적합니다.

재시작 후에는 어떻게 되나요?

흐름이 안정적으로 저장되므로, 작업은 처음부터 다시 시작하는 대신 이어서 재개할 수 있습니다.

최종 업데이트는 누가 받나요?

흐름은 작업을 시작한 원래 소유자 세션에 결과를 보고합니다.

상세 정보

작성자의 원본 설명

Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.

repo: spinabot/brigade

인기도

GitHub 스타
11k
순위
#11738
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬