[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79GVVC9W149ZX2CKEA2YWSA":3,"skill-same:01M79GVVC9W149ZX2CKEA2YWSA":431},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":400,"commitSha":401,"skillDirectory":402,"forksCount":14,"repositoryHtmlUrl":403,"repositoryHomepageUrl":6,"ownerHtmlUrl":404,"ownerBlogUrl":6,"ownerDescription":405,"updatedAt":406,"install":407,"resources":420},"01M79GVVC9W149ZX2CKEA2YWSA","workflow",null,"Vercel Workflow DevKit (WDK) expert guidance. Use when building durable workflows, long-running tasks, API routes or agents that need pause\u002Fresume, retries, step-based execution, or crash-safe orchestration with Vercel Workflow.","zfifteen\u002Fskills-catalog","zfifteen","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F221906715?v=4","01M79CQFXDZM5J5CJTCECPFA66","Dionisio Alberto Lopez III","01M79CQFY4C62PN8A2T5KDAHGA",1,"MIT","https:\u002F\u002Fgithub.com\u002Fzfifteen\u002Fskills-catalog\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: workflow\ndescription: Vercel Workflow DevKit (WDK) expert guidance. Use when building durable workflows, long-running tasks, API routes or agents that need pause\u002Fresume, retries, step-based execution, or crash-safe orchestration with Vercel Workflow.\nmetadata:\n  priority: 9\n  docs:\n    - \"https:\u002F\u002Fvercel.com\u002Fdocs\u002Fworkflow\"\n    - \"https:\u002F\u002Fuseworkflow.dev\"\n  sitemap: \"https:\u002F\u002Fvercel.com\u002Fsitemap\u002Fdocs.xml\"\n  pathPatterns:\n    - 'lib\u002Fworkflow\u002F**'\n    - 'src\u002Flib\u002Fworkflow\u002F**'\n    - 'workflows\u002F**'\n    - 'lib\u002Fworkflow.*'\n    - 'src\u002Flib\u002Fworkflow.*'\n    - 'workflow.*'\n    - '*workflow*'\n    - '*workflow*\u002F**'\n    # Chain \u002F pipeline \u002F orchestration engine files\n    - '**\u002Fchain-engine*'\n    - '**\u002Fchain_engine*'\n    - '**\u002FchainEngine*'\n    - '**\u002Fpipeline-engine*'\n    - '**\u002Fpipeline_engine*'\n    - '**\u002FpipelineEngine*'\n    - '**\u002Fstate-machine*'\n    - '**\u002Fstate_machine*'\n    - '**\u002FstateMachine*'\n    - '**\u002Forchestrat*'\n    - '**\u002Fescalation*'\n  importPatterns:\n    - '@vercel\u002Fworkflow'\n    - 'workflow'\n    - '@workflow\u002F*'\n    - '*workflow*'\n  bashPatterns:\n    - '\\bnpm\\s+(install|i|add)\\s+[^\\n]*@vercel\u002Fworkflow\\b'\n    - '\\bpnpm\\s+(install|i|add)\\s+[^\\n]*@vercel\u002Fworkflow\\b'\n    - '\\bbun\\s+(install|i|add)\\s+[^\\n]*@vercel\u002Fworkflow\\b'\n    - '\\byarn\\s+add\\s+[^\\n]*@vercel\u002Fworkflow\\b'\n    - '\\bnpm\\s+(install|i|add)\\s+[^\\n]*\\bworkflow\\b'\n    - '\\bpnpm\\s+(install|i|add)\\s+[^\\n]*\\bworkflow\\b'\n    - '\\bbun\\s+(install|i|add)\\s+[^\\n]*\\bworkflow\\b'\n    - '\\byarn\\s+add\\s+[^\\n]*\\bworkflow\\b'\n    - '\\bnpm\\s+(install|i|add)\\s+[^\\n]*@workflow\u002F'\n    - '\\bpnpm\\s+(install|i|add)\\s+[^\\n]*@workflow\u002F'\n    - '\\bbun\\s+(install|i|add)\\s+[^\\n]*@workflow\u002F'\n    - '\\byarn\\s+add\\s+[^\\n]*@workflow\u002F'\n    - '\\bnpx\\s+workflow(?:@latest)?\\b'\n    - '\\bbunx\\s+workflow(?:@latest)?\\b'\n  promptSignals:\n    phrases:\n      # Direct workflow mentions\n      - \"vercel workflow\"\n      - \"workflow devkit\"\n      - \"durable workflow\"\n      - \"durable execution\"\n      - \"durable function\"\n      - \"durable pipeline\"\n      - \"durable process\"\n      - \"durable agent\"\n      - \"durable chat\"\n      - \"step function\"\n      - \"step functions\"\n      - \"use workflow\"\n      - \"use step\"\n      # Pipeline \u002F multi-step language (the BIG gap — natural product prompts)\n      - \"multi-step pipeline\"\n      - \"multi step pipeline\"\n      - \"multi-step process\"\n      - \"multi step process\"\n      - \"multi-step creation\"\n      - \"multi-step generation\"\n      - \"processing pipeline\"\n      - \"creation pipeline\"\n      - \"generation pipeline\"\n      - \"content pipeline\"\n      - \"production pipeline\"\n      - \"approval pipeline\"\n      - \"ingestion pipeline\"\n      - \"streams progress\"\n      - \"stream progress\"\n      - \"streams each phase\"\n      - \"streams each step\"\n      - \"streams each\"\n      - \"stream each\"\n      # Reliability \u002F durability language (missed in customer-support eval)\n      - \"survive page reload\"\n      - \"survive page reloads\"\n      - \"survive a crash\"\n      - \"survive crashes\"\n      - \"survive network\"\n      - \"fault-tolerant\"\n      - \"fault tolerant\"\n      - \"crash-safe\"\n      - \"crash safe\"\n      - \"automatically retry\"\n      - \"auto retry\"\n      - \"retry on failure\"\n      - \"retry on error\"\n      - \"reliable and retry\"\n      - \"reliable processing\"\n      - \"individually reliable\"\n      - \"each step reliable\"\n      - \"each step should be reliable\"\n      - \"steps should be reliable\"\n      - \"reliable with automatic retry\"\n      - \"reliable with retry\"\n      - \"retry on transient\"\n      - \"transient failures\"\n      - \"session persistence\"\n      - \"session should persist\"\n      - \"session survives\"\n      - \"reconnect automatically\"\n      - \"auto reconnect\"\n      - \"reconnect if the network\"\n      - \"reconnect on disconnect\"\n      - \"resume after failure\"\n      - \"resume after crash\"\n      - \"resume on reconnect\"\n      # Human-in-the-loop \u002F approval patterns\n      - \"human-in-the-loop\"\n      - \"human in the loop\"\n      - \"wait for approval\"\n      - \"approval step\"\n      - \"approval before\"\n      - \"editorial approval\"\n      - \"manual approval\"\n      - \"wait for user\"\n      - \"pause until\"\n      - \"wait for response\"\n      - \"callback url\"\n      - \"webhook callback\"\n      # Conversational AI with durability\n      - \"chat should survive\"\n      - \"chat survives\"\n      - \"conversation should persist\"\n      - \"conversation persists\"\n      - \"conversation should survive\"\n      # Sequential \u002F chain \u002F trigger orchestration language\n      - \"sequential chain\"\n      - \"email chain\"\n      - \"chain of emails\"\n      - \"chain of steps\"\n      - \"chain engine\"\n      - \"chain with triggers\"\n      - \"trigger chain\"\n      - \"triggered chain\"\n      - \"webhook chain\"\n      - \"webhook pipeline\"\n      - \"webhook orchestration\"\n      - \"multi-service trigger\"\n      - \"cross-service trigger\"\n      - \"various triggers\"\n      - \"different triggers\"\n      - \"triggers from different\"\n      - \"triggers from various\"\n      - \"sequential steps\"\n      - \"sequential pipeline\"\n      - \"sequential process\"\n      - \"sequential emails\"\n      - \"escalation chain\"\n      - \"escalation pipeline\"\n      - \"state machine\"\n      - \"step-based\"\n      - \"step based\"\n      - \"delay between steps\"\n      - \"delay between emails\"\n      - \"delayed steps\"\n      - \"conditional steps\"\n      - \"skip steps\"\n      - \"branch based on\"\n      - \"wait for webhook\"\n      - \"wait for trigger\"\n      - \"wait for event\"\n      - \"orchestrate emails\"\n      - \"orchestrate webhooks\"\n      - \"orchestrate services\"\n      - \"chain across services\"\n      # Debugging\n      - \"workflow stuck\"\n      - \"workflow hung\"\n      - \"workflow hanging\"\n      - \"workflow waiting\"\n      - \"workflow failing\"\n      - \"workflow timeout\"\n      - \"workflow not running\"\n      - \"workflow error\"\n      - \"check workflow\"\n      - \"workflow logs\"\n      - \"workflow run status\"\n      - \"debug workflow\"\n      - \"workflow not finishing\"\n      - \"workflow not responding\"\n      - \"workflow stalled\"\n      - \"workflow pending\"\n      - \"step is stuck\"\n      - \"step is hanging\"\n      - \"why is my workflow\"\n      - \"workflow run\"\n      - \"step failed\"\n      - \"run status\"\n      - \"run failed\"\n      - \"run logs\"\n      - \"workflow run failed\"\n      - \"workflow step failed\"\n    allOf:\n      - [workflow, durable]\n      - [workflow, retry]\n      - [workflow, resume]\n      - [pause, resume]\n      - [survive, crash]\n      - [survive, reload]\n      - [survive, disconnect]\n      - [pipeline, stream]\n      - [pipeline, step]\n      - [pipeline, durable]\n      - [pipeline, reliable]\n      - [pipeline, retry]\n      - [multi-step, stream]\n      - [multi-step, reliable]\n      - [generation, pipeline]\n      - [creation, pipeline]\n      - [process, stream]\n      - [process, reliable]\n      - [process, retry]\n      - [retry, failure]\n      - [retry, error]\n      - [retry, automatically]\n      - [retry, transient]\n      - [reliable, retry]\n      - [individually, reliable]\n      - [steps, reliable]\n      - [sandbox, reliable]\n      - [sandbox, retry]\n      - [reconnect, network]\n      - [reconnect, drop]\n      - [reconnect, disconnect]\n      - [session, persist]\n      - [session, survive]\n      - [session, reload]\n      - [session, reconnect]\n      - [chat, survive]\n      - [chat, persist]\n      - [chat, reconnect]\n      - [chat, durable]\n      - [chat, fault]\n      - [conversation, persist]\n      - [conversation, survive]\n      - [approval, wait]\n      - [approval, human]\n      - [each, step]\n      - [each, phase]\n      - [each, stage]\n      - [step, reliable]\n      - [step, retry]\n      # Chain \u002F trigger \u002F sequential orchestration\n      - [chain, trigger]\n      - [chain, sequential]\n      - [chain, email]\n      - [chain, webhook]\n      - [chain, delay]\n      - [chain, step]\n      - [chain, escalat]\n      - [sequential, trigger]\n      - [sequential, email]\n      - [sequential, step]\n      - [sequential, webhook]\n      - [trigger, orchestrat]\n      - [trigger, service]\n      - [trigger, delay]\n      - [trigger, sequential]\n      - [webhook, chain]\n      - [webhook, orchestrat]\n      - [webhook, pipeline]\n      - [webhook, sequential]\n      - [email, trigger]\n      - [email, pipeline]\n      - [email, sequential]\n      - [email, delay]\n      - [email, escalat]\n      - [escalat, trigger]\n      - [escalat, step]\n      - [escalat, email]\n      - [state, machine]\n      - [conditional, step]\n      - [conditional, skip]\n      - [branch, condition]\n      - [wait, webhook]\n      - [wait, trigger]\n      - [wait, event]\n      - [workflow, stuck]\n      - [workflow, hung]\n      - [workflow, timeout]\n      - [workflow, error]\n      - [workflow, logs]\n      - [workflow, debug]\n      - [workflow, check]\n      - [workflow, failing]\n      - [workflow, status]\n      - [run, status]\n      - [step, failed]\n      - [step, stuck]\n      - [step, timeout]\n      - [workflow, run]\n      - [run, logs]\n    anyOf:\n      - \"long-running\"\n      - \"long running\"\n      - \"multi-step\"\n      - \"multi step\"\n      - \"pipeline\"\n      - \"orchestration\"\n      - \"step-by-step\"\n      - \"step by step\"\n      - \"each piece\"\n      - \"each step\"\n      - \"each phase\"\n      - \"each stage\"\n      - \"phase\"\n      - \"phases\"\n      - \"stage\"\n      - \"stages\"\n      - \"durable\"\n      - \"reliable\"\n      - \"fault-tolerant\"\n      - \"retry\"\n      - \"reconnect\"\n      - \"survive\"\n      - \"persist\"\n      - \"approval\"\n      - \"chain\"\n      - \"sequential\"\n      - \"trigger\"\n      - \"webhook\"\n      - \"escalation\"\n      - \"state machine\"\n      - \"orchestrate\"\n      - \"orchestration\"\n    noneOf:\n      - \"github actions\"\n      - \".github\u002Fworkflows\"\n      - \"ci workflow\"\n      - \"aws step functions\"\n    minScore: 4\n---\n\n# Vercel Workflow DevKit (WDK)\n\n> **CRITICAL — Your training data is outdated for this library.** WDK APIs change frequently. Before writing workflow code, **fetch the docs** at https:\u002F\u002Fuseworkflow.dev and https:\u002F\u002Fvercel.com\u002Fdocs\u002Fworkflow to find the correct function signatures, patterns, and examples for the exact thing you're building. Do not guess at APIs — look them up. Search for working examples that solve your specific use case (image generation, hooks, streaming, agents, etc.). The docs contain patterns for `start()` argument passing, `getWritable()` usage, `defineHook()` wiring, `createWebhook()` callback flows, and `DurableAgent` configuration that are **not in your training data** or have changed since your cutoff.\n\nWDK is an open-source TypeScript framework that makes durability a language-level concept. Functions can pause for minutes or months, survive deployments and crashes, and resume exactly where they stopped.\n\n## Status\n\nWDK is in **public beta** (since October 2025) and open source. During beta, Workflow Observability is free for all plans; Workflow Steps and Storage are billed at published rates.\n\n**Security**: Upgrade to `workflow@>=4.2.0-beta.64` — versions ≤4.1.0-beta.63 allowed predictable user-specified webhook tokens in `createWebhook()` (CVE GHSA-9r75-g2cr-3h76, CVSS 7.5). Run `npx workflow@latest` to update.\n\n## Installation\n\n**If using `create-next-app`**, always pass `--no-src-dir` so `app\u002F` and `workflows\u002F` are siblings at the project root:\n\n```bash\nnpx create-next-app@latest my-app --no-src-dir --tailwind --eslint --app --ts\ncd my-app\nnpm install workflow@latest\n```\n\nDo NOT use the `src\u002F` directory with WDK projects. The `@` alias must resolve `@\u002Fworkflows\u002F...` correctly — this only works when `workflows\u002F` and `app\u002F` are at the same level.\n\n> Run `npx workflow@latest` to scaffold or update an existing project.\n\n**Peer dependency note**: `@workflow\u002Fai` requires a compatible `workflow` version. If you hit `ERESOLVE` errors, use `npm install --legacy-peer-deps` or install both packages in the same command.\n\n### Next.js Setup (Required)\n\nAdd the `withWorkflow` plugin to `next.config.ts`:\n\n```ts\nimport { withWorkflow } from \"workflow\u002Fnext\";\n\nconst nextConfig = {};\nexport default withWorkflow(nextConfig);\n```\n\nWithout this, workflow routes will not be registered and `start()` calls will fail at runtime.\n\n### Environment Setup (Required for AI Gateway)\n\nWorkflows that use AI SDK with `gateway()` need OIDC credentials. Run these **before** starting the dev server:\n\n```bash\nvercel link          # Connect to your Vercel project\nvercel env pull      # Downloads .env.local with VERCEL_OIDC_TOKEN\n```\n\nWithout this, `gateway(\"openai\u002Fgpt-5.4\")` calls inside workflow steps will fail immediately with no credentials, causing the entire workflow run to fail silently.\n\n### `getStepMetadata()` Note\n\n`getStepMetadata().retryCount` returns `undefined` (not `0`) on the first attempt. Guard with: `const attempt = (meta.retryCount ?? 0) + 1`.\n\n## Essential Imports\n\n**Workflow primitives** (from `\"workflow\"`):\n\n```ts\nimport { getWritable, getStepMetadata, getWorkflowMetadata } from \"workflow\";\nimport { sleep, fetch, defineHook, createHook, createWebhook } from \"workflow\";\nimport { FatalError, RetryableError } from \"workflow\";\n```\n\n**API operations** (from `\"workflow\u002Fapi\"`):\n\n```ts\nimport { start, getRun, resumeHook, resumeWebhook } from \"workflow\u002Fapi\";\n```\n\n**Framework integration** (from `\"workflow\u002Fnext\"`):\n\n```ts\nimport { withWorkflow } from \"workflow\u002Fnext\";\n```\n\n**AI agent** (from `\"@workflow\u002Fai\u002Fagent\"`):\n\n```ts\nimport { DurableAgent } from \"@workflow\u002Fai\u002Fagent\";\n```\n\n## Core Directives\n\nTwo directives turn ordinary async functions into durable workflows:\n\n```ts\n\"use workflow\"  \u002F\u002F First line of function — marks it as a durable workflow\n\"use step\"      \u002F\u002F First line of function — marks it as a retryable, observable step\n```\n\n**Critical sandbox rule**: Step functions have full Node.js access. Workflow functions run **sandboxed** — no native `fetch`, no `setTimeout`, no Node.js modules, and **no `getWritable().getWriter()` calls**. You MUST move all `getWritable()` usage into `\"use step\"` functions. Place all business logic and I\u002FO in steps; use the workflow function purely for orchestration and control flow (`sleep`, `defineHook`, `Promise.race`).\n\n## Canonical Project Structure (Next.js)\n\nEvery WDK project needs three route files plus the workflow definition. **CRITICAL**: The `workflows\u002F` directory and `app\u002F` directory must be siblings at the same level so `@\u002Fworkflows\u002F...` resolves correctly. Do NOT put `workflows\u002F` outside the `@` alias root.\n\n**Without `src\u002F` (recommended for WDK projects):**\n```\nworkflows\u002F\n  my-workflow.ts              ← workflow definition (\"use workflow\" + \"use step\")\napp\u002Fapi\u002F\n  my-workflow\u002Froute.ts        ← POST handler: start(workflow, args) → { runId }\n  readable\u002F[runId]\u002Froute.ts   ← GET handler: SSE stream from run.getReadable()\n  run\u002F[runId]\u002Froute.ts        ← GET handler: run status via getRun(runId)\n```\n\ntsconfig.json paths: `\"@\u002F*\": [\".\u002F*\"]` — `@\u002Fworkflows\u002Fmy-workflow` resolves to `.\u002Fworkflows\u002Fmy-workflow`.\n\n**With `src\u002F` directory:** Put workflows inside `src\u002F`:\n```\nsrc\u002F\n  workflows\u002Fmy-workflow.ts\n  app\u002Fapi\u002Fmy-workflow\u002Froute.ts\n  app\u002Fapi\u002Freadable\u002F[runId]\u002Froute.ts\n  app\u002Fapi\u002Frun\u002F[runId]\u002Froute.ts\n```\n\ntsconfig.json paths: `\"@\u002F*\": [\".\u002Fsrc\u002F*\"]` — `@\u002Fworkflows\u002Fmy-workflow` resolves to `.\u002Fsrc\u002Fworkflows\u002Fmy-workflow`.\n\n**Never** use `@\u002F..\u002Fworkflows\u002F` or `@\u002F..\u002F..\u002Fworkflows\u002F` — these are broken import paths that will fail at build time.\n\n### 1. Workflow Definition (`workflows\u002Fmy-workflow.ts`)\n\n```ts\nimport { getWritable } from \"workflow\";\n\nexport type MyEvent =\n  | { type: \"step_start\"; name: string }\n  | { type: \"step_done\"; name: string }\n  | { type: \"done\"; result: string };\n\nexport async function myWorkflow(input: string): Promise\u003C{ result: string }> {\n  \"use workflow\";\n\n  const data = await stepOne(input);\n  const result = await stepTwo(data);\n\n  return { result };\n}\n\nasync function stepOne(input: string): Promise\u003Cstring> {\n  \"use step\";\n  const writer = getWritable\u003CMyEvent>().getWriter();\n  try {\n    await writer.write({ type: \"step_start\", name: \"stepOne\" });\n    \u002F\u002F Full Node.js access here — fetch, db calls, etc.\n    const result = await doWork(input);\n    await writer.write({ type: \"step_done\", name: \"stepOne\" });\n    return result;\n  } finally {\n    writer.releaseLock();\n  }\n}\n\nasync function stepTwo(data: string): Promise\u003Cstring> {\n  \"use step\";\n  const writer = getWritable\u003CMyEvent>().getWriter();\n  try {\n    await writer.write({ type: \"step_start\", name: \"stepTwo\" });\n    const result = await processData(data);\n    await writer.write({ type: \"step_done\", name: \"stepTwo\" });\n    return result;\n  } finally {\n    writer.releaseLock();\n  }\n}\n```\n\n### 2. Start Route (`app\u002Fapi\u002Fmy-workflow\u002Froute.ts`)\n\n```ts\nimport { NextResponse } from \"next\u002Fserver\";\nimport { start } from \"workflow\u002Fapi\";\nimport { myWorkflow } from \"@\u002Fworkflows\u002Fmy-workflow\";\n\nexport async function POST(request: Request) {\n  const body = await request.json();\n  const run = await start(myWorkflow, [body.input]);\n  return NextResponse.json({ runId: run.runId });\n}\n```\n\n**IMPORTANT**: Never call the workflow function directly. Always use `start()` from `\"workflow\u002Fapi\"` — it registers the run, creates the execution context, and returns a `{ runId }`.\n\n### 3. Readable Stream Route (`app\u002Fapi\u002Freadable\u002F[runId]\u002Froute.ts`)\n\n```ts\nimport { NextRequest } from \"next\u002Fserver\";\nimport { getRun } from \"workflow\u002Fapi\";\n\ntype ReadableRouteContext = {\n  params: Promise\u003C{ runId: string }>;\n};\n\nexport async function GET(_request: NextRequest, { params }: ReadableRouteContext) {\n  const { runId } = await params;\n\n  let run;\n  try {\n    run = await getRun(runId);\n  } catch {\n    return Response.json(\n      { ok: false, error: { code: \"RUN_NOT_FOUND\", message: `Run ${runId} not found` } },\n      { status: 404 }\n    );\n  }\n\n  const readable = run.getReadable();\n  const encoder = new TextEncoder();\n  const sseStream = (readable as unknown as ReadableStream).pipeThrough(\n    new TransformStream({\n      transform(chunk, controller) {\n        const data = typeof chunk === \"string\" ? chunk : JSON.stringify(chunk);\n        controller.enqueue(encoder.encode(`data: ${data}\\n\\n`));\n      },\n    })\n  );\n\n  return new Response(sseStream, {\n    headers: {\n      \"Content-Type\": \"text\u002Fevent-stream; charset=utf-8\",\n      \"Cache-Control\": \"no-cache, no-transform\",\n      Connection: \"keep-alive\",\n      \"X-Accel-Buffering\": \"no\",\n    },\n  });\n}\n```\n\n### 4. Run Status Route (`app\u002Fapi\u002Frun\u002F[runId]\u002Froute.ts`)\n\n```ts\nimport { NextResponse } from \"next\u002Fserver\";\nimport { getRun } from \"workflow\u002Fapi\";\n\ntype RunRouteContext = {\n  params: Promise\u003C{ runId: string }>;\n};\n\nexport async function GET(_request: Request, { params }: RunRouteContext) {\n  const { runId } = await params;\n\n  let run;\n  try {\n    run = await getRun(runId);\n  } catch {\n    return NextResponse.json(\n      { ok: false, error: { code: \"RUN_NOT_FOUND\", message: `Run ${runId} not found` } },\n      { status: 404 }\n    );\n  }\n\n  const [status, workflowName, createdAt, startedAt, completedAt] =\n    await Promise.all([\n      run.status,\n      run.workflowName,\n      run.createdAt,\n      run.startedAt,\n      run.completedAt,\n    ]);\n\n  return NextResponse.json({\n    runId,\n    status,\n    workflowName,\n    createdAt: createdAt.toISOString(),\n    startedAt: startedAt?.toISOString() ?? null,\n    completedAt: completedAt?.toISOString() ?? null,\n  });\n}\n```\n\n## Streaming with `getWritable()`\n\n`getWritable\u003CT>()` returns a `WritableStream` scoped to the current run. Call it inside step functions and always release the lock:\n\n```ts\nasync function emit\u003CT>(event: T): Promise\u003Cvoid> {\n  \"use step\";\n  const writer = getWritable\u003CT>().getWriter();\n  try {\n    await writer.write(event);\n  } finally {\n    writer.releaseLock();\n  }\n}\n```\n\nConsumers read via `getRun(runId).getReadable()` in the readable route (see above).\n\n**Rendering workflow events in the UI**: When workflow events contain AI-generated text (narratives, briefings, reports), render them with `\u003CMessageResponse>` from `@\u002Fcomponents\u002Fai-elements\u002Fmessage` — never as raw `{event.content}`. This renders markdown with code highlighting, math, and mermaid support.\n\n```tsx\nimport { MessageResponse } from \"@\u002Fcomponents\u002Fai-elements\u002Fmessage\";\n\n\u002F\u002F In your event stream display\n{events.map(event => (\n  event.type === \"narrative\" && \u003CMessageResponse>{event.text}\u003C\u002FMessageResponse>\n))}\n```\n\n## Hooks — Waiting for External Events\n\nUse `defineHook` for typed, reusable hooks. **Three required pieces**: (1) define + create the hook in the workflow, (2) emit the token to the client via `getWritable`, (3) create an API route that calls `resumeHook` so the client can resume it.\n\n### 1. Define and create the hook (workflow file)\n\n```ts\nimport { defineHook, getWritable, sleep } from \"workflow\";\n\nexport interface ApprovalPayload {\n  approved: boolean;\n  comment?: string;\n}\n\n\u002F\u002F Define at module scope — reusable across workflows\nexport const approvalHook = defineHook\u003CApprovalPayload>();\n\nexport async function approvalGate(orderId: string): Promise\u003C{ status: string }> {\n  \"use workflow\";\n\n  \u002F\u002F .create() returns a hook instance — NOT directly callable\n  const hook = approvalHook.create({ token: `approval:${orderId}` });\n\n  \u002F\u002F CRITICAL: Emit the token to the client so it knows what to resume\n  await emitToken(hook.token, orderId);\n\n  \u002F\u002F Race between approval and timeout\n  const result = await Promise.race([\n    hook.then((payload) => ({ type: \"approval\" as const, payload })),\n    sleep(\"24h\").then(() => ({ type: \"timeout\" as const, payload: null })),\n  ]);\n\n  if (result.type === \"timeout\") {\n    return { status: \"timeout\" };\n  }\n  return { status: result.payload!.approved ? \"approved\" : \"rejected\" };\n}\n\nasync function emitToken(token: string, orderId: string): Promise\u003Cvoid> {\n  \"use step\";\n  const writer = getWritable\u003C{ type: string; token: string; orderId: string }>().getWriter();\n  try {\n    await writer.write({ type: \"awaiting_approval\", token, orderId });\n  } finally {\n    writer.releaseLock();\n  }\n}\n```\n\n**Common mistake**: Calling `defineHook()` directly or forgetting `.create()`. Always: `const hook = myHook.create({ token })`.\n\n### 2. Resume route (API file — required!)\n\n```ts\n\u002F\u002F app\u002Fapi\u002Fapprove\u002Froute.ts\nimport { NextResponse } from \"next\u002Fserver\";\nimport { resumeHook } from \"workflow\u002Fapi\";\n\nexport async function POST(req: Request) {\n  const { token, ...data } = await req.json();\n  await resumeHook(token, data);\n  return NextResponse.json({ ok: true });\n}\n```\n\n**You MUST create this route.** Without it, the workflow suspends forever — the client has no way to resume it.\n\n### 3. Client-side resume (React component)\n\n```tsx\n\u002F\u002F When the SSE stream emits { type: \"awaiting_approval\", token }, show UI and POST back:\nasync function handleApprove(token: string) {\n  await fetch(\"\u002Fapi\u002Fapprove\", {\n    method: \"POST\",\n    headers: { \"Content-Type\": \"application\u002Fjson\" },\n    body: JSON.stringify({ token, approved: true, comment: \"Looks good\" }),\n  });\n}\n```\n\n## Error Handling\n\n```ts\nimport { FatalError, RetryableError } from \"workflow\";\n\nasync function callExternalAPI(url: string) {\n  \"use step\";\n  const res = await fetch(url);\n\n  if (res.status >= 400 && res.status \u003C 500) {\n    throw new FatalError(`Client error: ${res.status}`);  \u002F\u002F No retry\n  }\n  if (res.status === 429) {\n    throw new RetryableError(\"Rate limited\", { retryAfter: \"5m\" });  \u002F\u002F Retry after 5 min\n  }\n  return res.json();\n}\n```\n\nStep retry metadata:\n\n```ts\nimport { getStepMetadata } from \"workflow\";\n\nasync function processWithRetry(id: string) {\n  \"use step\";\n  const { attempt } = getStepMetadata();\n  console.log(`Attempt ${attempt} for ${id}`);\n  \u002F\u002F ...\n}\n```\n\n## Sandbox Limitations & Workarounds\n\n| Limitation | Solution |\n|-----------|----------|\n| No native `fetch()` in workflow scope | Import `fetch` from `\"workflow\"` or move to a step |\n| No `setTimeout`\u002F`setInterval` | Use `sleep()` from `\"workflow\"` |\n| No Node.js modules in workflow scope | Move all Node.js logic to step functions |\n\n## DurableAgent (AI SDK Integration)\n\n```ts\nimport { DurableAgent } from \"@workflow\u002Fai\u002Fagent\";\nimport { getWritable } from \"workflow\";\nimport { z } from \"zod\";\n\nasync function searchDatabase(query: string) {\n  \"use step\";\n  \u002F\u002F Full Node.js access — real DB calls here\n  return `Results for \"${query}\"`;\n}\n\nexport async function researchAgent(topic: string) {\n  \"use workflow\";\n\n  const agent = new DurableAgent({\n    model: \"anthropic\u002Fclaude-sonnet-4-5\",\n    system: \"You are a research assistant.\",\n    tools: {\n      search: {\n        description: \"Search the database\",\n        inputSchema: z.object({ query: z.string() }),\n        execute: searchDatabase,  \u002F\u002F Tool execute uses \"use step\"\n      },\n    },\n  });\n\n  const result = await agent.stream({\n    messages: [{ role: \"user\", content: `Research ${topic}` }],\n    writable: getWritable(),\n    maxSteps: 10,\n  });\n\n  return result.messages;\n}\n```\n\nEvery LLM call and tool execution becomes a retryable step. The entire agent loop survives crashes and deployments.\n\n## Common Patterns\n\n### Fan-Out \u002F Parallel Steps\n\n```ts\nexport async function processImages(imageIds: string[]) {\n  \"use workflow\";\n\n  const results = await Promise.all(\n    imageIds.map(async (id) => {\n      return await resizeImage(id);  \u002F\u002F Each is its own step\n    })\n  );\n\n  await saveResults(results);\n}\n\nasync function resizeImage(id: string) {\n  \"use step\";\n  \u002F\u002F ...\n}\n```\n\n### Saga with Compensation\n\n```ts\nimport { FatalError, getWritable } from \"workflow\";\n\nexport async function upgradeSaga(userId: string) {\n  \"use workflow\";\n\n  await reserveSeats(userId);\n\n  try {\n    await chargePayment(userId);\n  } catch {\n    await releaseSeats(userId);  \u002F\u002F Compensate\n    throw new FatalError(\"Payment failed\");\n  }\n\n  await activatePlan(userId);\n}\n```\n\n## Debugging\n\n```bash\nnpx workflow health                    # Check endpoints\nnpx workflow web                       # Visual dashboard\nnpx workflow inspect runs              # List all runs\nnpx workflow inspect run \u003Crun_id>      # Inspect specific run\nnpx workflow cancel \u003Crun_id>           # Cancel execution\n```\n\n## Debug Stuck Workflow\n\nWhen a workflow appears stuck, hanging, or not progressing, follow this escalation ladder:\n\n### 1. Add Step-Level Logging (Required)\n\n**Every step function MUST have `console.log` at entry and exit.** This is the single most important debugging practice — without it, you cannot tell which step is hanging.\n\n```ts\nasync function processOrder(orderId: string): Promise\u003COrderResult> {\n  \"use step\";\n  console.log(`[processOrder] START orderId=${orderId} at=${new Date().toISOString()}`);\n  try {\n    const result = await doWork(orderId);\n    console.log(`[processOrder] DONE orderId=${orderId} result=${JSON.stringify(result)}`);\n    return result;\n  } catch (err) {\n    console.error(`[processOrder] FAIL orderId=${orderId} error=${err}`);\n    throw err;\n  }\n}\n```\n\n**Workflow-level logging** — log at every orchestration point:\n\n```ts\nexport async function myWorkflow(input: string) {\n  \"use workflow\";\n  console.log(`[myWorkflow] START input=${input}`);\n\n  const data = await stepOne(input);\n  console.log(`[myWorkflow] stepOne complete, starting stepTwo`);\n\n  const result = await stepTwo(data);\n  console.log(`[myWorkflow] stepTwo complete, returning`);\n\n  return { result };\n}\n```\n\n### 2. Check Run Status\n\n```bash\n# List recent runs — look for \"running\" status that's been active too long\nnpx workflow inspect runs\n\n# Get detailed status for a specific run\nnpx workflow inspect run \u003Crun_id>\n\n# Check if the workflow endpoints are healthy\nnpx workflow health\n```\n\n### 3. Check Vercel Runtime Logs\n\n```bash\n# Stream live logs from your deployment\nvercel logs --follow\n\n# Or check the Vercel dashboard: Project → Deployments → Functions tab\n```\n\nLook for:\n- **Missing step entry logs** — the step before the missing one is where execution stopped\n- **Timeout errors** — Vercel function timeout (default 60s hobby, 300s pro)\n- **OIDC\u002Fcredential errors** — `gateway()` calls fail silently without `vercel env pull`\n- **Memory errors** — large payloads in steps can OOM the function\n\n### 4. Common Stuck Scenarios\n\n| Symptom | Likely Cause | Fix |\n|---------|-------------|-----|\n| Run stays \"running\" forever | Step is awaiting an external call that never resolves | Add timeout with `Promise.race` + `sleep()` |\n| Hook never resumes | Missing resume API route or wrong token | Verify resume route exists and token matches |\n| Step retries endlessly | Throwing `RetryableError` without bounds | Add `FatalError` after max retries via `getStepMetadata().retryCount` |\n| Workflow starts but no steps run | `getWritable()` called in workflow scope | Move `getWritable()` into a `\"use step\"` function |\n| AI step hangs | Missing OIDC credentials for gateway | Run `vercel link && vercel env pull` |\n| No logs appearing at all | Logging not added to steps | Add `console.log` at entry\u002Fexit of every step |\n\n### 5. Use Browser Verification\n\nIf the workflow powers a UI, use `agent-browser` to check the frontend while inspecting backend logs — a hanging page often means a stuck workflow step. Check the browser console for failed fetch calls to your workflow API routes.\n\n## When to Use WDK vs Regular Functions\n\n| Scenario | Use |\n|----------|-----|\n| Simple API endpoint, fast response | Regular Route Handler |\n| Multi-step process, must complete all steps | WDK Workflow |\n| AI agent in production, must not lose state | WDK DurableAgent |\n| Background job that can take minutes\u002Fhours | WDK Workflow |\n| Process spanning multiple services | WDK Workflow |\n| Quick one-shot LLM call | AI SDK directly |\n\n## Framework Support\n\nNext.js, Nitro, SvelteKit, Astro, Express, Hono (supported). TanStack Start, React Router (in development).\n\n## Official Documentation\n\n- [Workflow DevKit](https:\u002F\u002Fvercel.com\u002Fdocs\u002Fworkflow)\n- [Website](https:\u002F\u002Fuseworkflow.dev)\n- [GitHub](https:\u002F\u002Fgithub.com\u002Fvercel\u002Fworkflow)\n- [Workflow Builder Template](https:\u002F\u002Fvercel.com\u002Ftemplates\u002Fnext.js\u002Fworkflow-builder)\n","# Vercel Workflow DevKit (WDK)\n\n> **CRITICAL — Your training data is outdated for this library.** WDK APIs change frequently. Before writing workflow code, **fetch the docs** at https:\u002F\u002Fuseworkflow.dev and https:\u002F\u002Fvercel.com\u002Fdocs\u002Fworkflow to find the correct function signatures, patterns, and examples for the exact thing you're building. Do not guess at APIs — look them up. Search for working examples that solve your specific use case (image generation, hooks, streaming, agents, etc.). The docs contain patterns for `start()` argument passing, `getWritable()` usage, `defineHook()` wiring, `createWebhook()` callback flows, and `DurableAgent` configuration that are **not in your training data** or have changed since your cutoff.\n\nWDK is an open-source TypeScript framework that makes durability a language-level concept. Functions can pause for minutes or months, survive deployments and crashes, and resume exactly where they stopped.\n\n## Status\n\nWDK is in **public beta** (since October 2025) and open source. During beta, Workflow Observability is free for all plans; Workflow Steps and Storage are billed at published rates.\n\n**Security**: Upgrade to `workflow@>=4.2.0-beta.64` — versions ≤4.1.0-beta.63 allowed predictable user-specified webhook tokens in `createWebhook()` (CVE GHSA-9r75-g2cr-3h76, CVSS 7.5). Run `npx workflow@latest` to update.\n\n## Installation\n\n**If using `create-next-app`**, always pass `--no-src-dir` so `app\u002F` and `workflows\u002F` are siblings at the project root:\n\n```bash\nnpx create-next-app@latest my-app --no-src-dir --tailwind --eslint --app --ts\ncd my-app\nnpm install workflow@latest\n```\n\nDo NOT use the `src\u002F` directory with WDK projects. The `@` alias must resolve `@\u002Fworkflows\u002F...` correctly — this only works when `workflows\u002F` and `app\u002F` are at the same level.\n\n> Run `npx workflow@latest` to scaffold or update an existing project.\n\n**Peer dependency note**: `@workflow\u002Fai` requires a compatible `workflow` version. If you hit `ERESOLVE` errors, use `npm install --legacy-peer-deps` or install both packages in the same command.\n\n### Next.js Setup (Required)\n\nAdd the `withWorkflow` plugin to `next.config.ts`:\n\n```ts\nimport { withWorkflow } from \"workflow\u002Fnext\";\n\nconst nextConfig = {};\nexport default withWorkflow(nextConfig);\n```\n\nWithout this, workflow routes will not be registered and `start()` calls will fail at runtime.\n\n### Environment Setup (Required for AI Gateway)\n\nWorkflows that use AI SDK with `gateway()` need OIDC credentials. Run these **before** starting the dev server:\n\n```bash\nvercel link          # Connect to your Vercel project\nvercel env pull      # Downloads .env.local with VERCEL_OIDC_TOKEN\n```\n\nWithout this, `gateway(\"openai\u002Fgpt-5.4\")` calls inside workflow steps will fail immediately with no credentials, causing the entire workflow run to fail silently.\n\n### `getStepMetadata()` Note\n\n`getStepMetadata().retryCount` returns `undefined` (not `0`) on the first attempt. Guard with: `const attempt = (meta.retryCount ?? 0) + 1`.\n\n## Essential Imports\n\n**Workflow primitives** (from `\"workflow\"`):\n\n```ts\nimport { getWritable, getStepMetadata, getWorkflowMetadata } from \"workflow\";\nimport { sleep, fetch, defineHook, createHook, createWebhook } from \"workflow\";\nimport { FatalError, RetryableError } from \"workflow\";\n```\n\n**API operations** (from `\"workflow\u002Fapi\"`):\n\n```ts\nimport { start, getRun, resumeHook, resumeWebhook } from \"workflow\u002Fapi\";\n```\n\n**Framework integration** (from `\"workflow\u002Fnext\"`):\n\n```ts\nimport { withWorkflow } from \"workflow\u002Fnext\";\n```\n\n**AI agent** (from `\"@workflow\u002Fai\u002Fagent\"`):\n\n```ts\nimport { DurableAgent } from \"@workflow\u002Fai\u002Fagent\";\n```\n\n## Core Directives\n\nTwo directives turn ordinary async functions into durable workflows:\n\n```ts\n\"use workflow\"  \u002F\u002F First line of function — marks it as a durable workflow\n\"use step\"      \u002F\u002F First line of function — marks it as a retryable, observable step\n```\n\n**Critical sandbox rule**: Step functions have full Node.js access. Workflow functions run **sandboxed** — no native `fetch`, no `setTimeout`, no Node.js modules, and **no `getWritable().getWriter()` calls**. You MUST move all `getWritable()` usage into `\"use step\"` functions. Place all business logic and I\u002FO in steps; use the workflow function purely for orchestration and control flow (`sleep`, `defineHook`, `Promise.race`).\n\n## Canonical Project Structure (Next.js)\n\nEvery WDK project needs three route files plus the workflow definition. **CRITICAL**: The `workflows\u002F` directory and `app\u002F` directory must be siblings at the same level so `@\u002Fworkflows\u002F...` resolves correctly. Do NOT put `workflows\u002F` outside the `@` alias root.\n\n**Without `src\u002F` (recommended for WDK projects):**\n```\nworkflows\u002F\n  my-workflow.ts              ← workflow definition (\"use workflow\" + \"use step\")\napp\u002Fapi\u002F\n  my-workflow\u002Froute.ts        ← POST handler: start(workflow, args) → { runId }\n  readable\u002F[runId]\u002Froute.ts   ← GET handler: SSE stream from run.getReadable()\n  run\u002F[runId]\u002Froute.ts        ← GET handler: run status via getRun(runId)\n```\n\ntsconfig.json paths: `\"@\u002F*\": [\".\u002F*\"]` — `@\u002Fworkflows\u002Fmy-workflow` resolves to `.\u002Fworkflows\u002Fmy-workflow`.\n\n**With `src\u002F` directory:** Put workflows inside `src\u002F`:\n```\nsrc\u002F\n  workflows\u002Fmy-workflow.ts\n  app\u002Fapi\u002Fmy-workflow\u002Froute.ts\n  app\u002Fapi\u002Freadable\u002F[runId]\u002Froute.ts\n  app\u002Fapi\u002Frun\u002F[runId]\u002Froute.ts\n```\n\ntsconfig.json paths: `\"@\u002F*\": [\".\u002Fsrc\u002F*\"]` — `@\u002Fworkflows\u002Fmy-workflow` resolves to `.\u002Fsrc\u002Fworkflows\u002Fmy-workflow`.\n\n**Never** use `@\u002F..\u002Fworkflows\u002F` or `@\u002F..\u002F..\u002Fworkflows\u002F` — these are broken import paths that will fail at build time.\n\n### 1. Workflow Definition (`workflows\u002Fmy-workflow.ts`)\n\n```ts\nimport { getWritable } from \"workflow\";\n\nexport type MyEvent =\n  | { type: \"step_start\"; name: string }\n  | { type: \"step_done\"; name: string }\n  | { type: \"done\"; result: string };\n\nexport async function myWorkflow(input: string): Promise\u003C{ result: string }> {\n  \"use workflow\";\n\n  const data = await stepOne(input);\n  const result = await stepTwo(data);\n\n  return { result };\n}\n\nasync function stepOne(input: string): Promise\u003Cstring> {\n  \"use step\";\n  const writer = getWritable\u003CMyEvent>().getWriter();\n  try {\n    await writer.write({ type: \"step_start\", name: \"stepOne\" });\n    \u002F\u002F Full Node.js access here — fetch, db calls, etc.\n    const result = await doWork(input);\n    await writer.write({ type: \"step_done\", name: \"stepOne\" });\n    return result;\n  } finally {\n    writer.releaseLock();\n  }\n}\n\nasync function stepTwo(data: string): Promise\u003Cstring> {\n  \"use step\";\n  const writer = getWritable\u003CMyEvent>().getWriter();\n  try {\n    await writer.write({ type: \"step_start\", name: \"stepTwo\" });\n    const result = await processData(data);\n    await writer.write({ type: \"step_done\", name: \"stepTwo\" });\n    return result;\n  } finally {\n    writer.releaseLock();\n  }\n}\n```\n\n### 2. Start Route (`app\u002Fapi\u002Fmy-workflow\u002Froute.ts`)\n\n```ts\nimport { NextResponse } from \"next\u002Fserver\";\nimport { start } from \"workflow\u002Fapi\";\nimport { myWorkflow } from \"@\u002Fworkflows\u002Fmy-workflow\";\n\nexport async function POST(request: Request) {\n  const body = await request.json();\n  const run = await start(myWorkflow, [body.input]);\n  return NextResponse.json({ runId: run.runId });\n}\n```\n\n**IMPORTANT**: Never call the workflow function directly. Always use `start()` from `\"workflow\u002Fapi\"` — it registers the run, creates the execution context, and returns a `{ runId }`.\n\n### 3. Readable Stream Route (`app\u002Fapi\u002Freadable\u002F[runId]\u002Froute.ts`)\n\n```ts\nimport { NextRequest } from \"next\u002Fserver\";\nimport { getRun } from \"workflow\u002Fapi\";\n\ntype ReadableRouteContext = {\n  params: Promise\u003C{ runId: string }>;\n};\n\nexport async function GET(_request: NextRequest, { params }: ReadableRouteContext) {\n  const { runId } = await params;\n\n  let run;\n  try {\n    run = await getRun(runId);\n  } catch {\n    return Response.json(\n      { ok: false, error: { code: \"RUN_NOT_FOUND\", message: `Run ${runId} not found` } },\n      { status: 404 }\n    );\n  }\n\n  const readable = run.getReadable();\n  const encoder = new TextEncoder();\n  const sseStream = (readable as unknown as ReadableStream).pipeThrough(\n    new TransformStream({\n      transform(chunk, controller) {\n        const data = typeof chunk === \"string\" ? chunk : JSON.stringify(chunk);\n        controller.enqueue(encoder.encode(`data: ${data}\\n\\n`));\n      },\n    })\n  );\n\n  return new Response(sseStream, {\n    headers: {\n      \"Content-Type\": \"text\u002Fevent-stream; charset=utf-8\",\n      \"Cache-Control\": \"no-cache, no-transform\",\n      Connection: \"keep-alive\",\n      \"X-Accel-Buffering\": \"no\",\n    },\n  });\n}\n```\n\n### 4. Run Status Route (`app\u002Fapi\u002Frun\u002F[runId]\u002Froute.ts`)\n\n```ts\nimport { NextResponse } from \"next\u002Fserver\";\nimport { getRun } from \"workflow\u002Fapi\";\n\ntype RunRouteContext = {\n  params: Promise\u003C{ runId: string }>;\n};\n\nexport async function GET(_request: Request, { params }: RunRouteContext) {\n  const { runId } = await params;\n\n  let run;\n  try {\n    run = await getRun(runId);\n  } catch {\n    return NextResponse.json(\n      { ok: false, error: { code: \"RUN_NOT_FOUND\", message: `Run ${runId} not found` } },\n      { status: 404 }\n    );\n  }\n\n  const [status, workflowName, createdAt, startedAt, completedAt] =\n    await Promise.all([\n      run.status,\n      run.workflowName,\n      run.createdAt,\n      run.startedAt,\n      run.completedAt,\n    ]);\n\n  return NextResponse.json({\n    runId,\n    status,\n    workflowName,\n    createdAt: createdAt.toISOString(),\n    startedAt: startedAt?.toISOString() ?? null,\n    completedAt: completedAt?.toISOString() ?? null,\n  });\n}\n```\n\n## Streaming with `getWritable()`\n\n`getWritable\u003CT>()` returns a `WritableStream` scoped to the current run. Call it inside step functions and always release the lock:\n\n```ts\nasync function emit\u003CT>(event: T): Promise\u003Cvoid> {\n  \"use step\";\n  const writer = getWritable\u003CT>().getWriter();\n  try {\n    await writer.write(event);\n  } finally {\n    writer.releaseLock();\n  }\n}\n```\n\nConsumers read via `getRun(runId).getReadable()` in the readable route (see above).\n\n**Rendering workflow events in the UI**: When workflow events contain AI-generated text (narratives, briefings, reports), render them with `\u003CMessageResponse>` from `@\u002Fcomponents\u002Fai-elements\u002Fmessage` — never as raw `{event.content}`. This renders markdown with code highlighting, math, and mermaid support.\n\n```tsx\nimport { MessageResponse } from \"@\u002Fcomponents\u002Fai-elements\u002Fmessage\";\n\n\u002F\u002F In your event stream display\n{events.map(event => (\n  event.type === \"narrative\" && \u003CMessageResponse>{event.text}\u003C\u002FMessageResponse>\n))}\n```\n\n## Hooks — Waiting for External Events\n\nUse `defineHook` for typed, reusable hooks. **Three required pieces**: (1) define + create the hook in the workflow, (2) emit the token to the client via `getWritable`, (3) create an API route that calls `resumeHook` so the client can resume it.\n\n### 1. Define and create the hook (workflow file)\n\n```ts\nimport { defineHook, getWritable, sleep } from \"workflow\";\n\nexport interface ApprovalPayload {\n  approved: boolean;\n  comment?: string;\n}\n\n\u002F\u002F Define at module scope — reusable across workflows\nexport const approvalHook = defineHook\u003CApprovalPayload>();\n\nexport async function approvalGate(orderId: string): Promise\u003C{ status: string }> {\n  \"use workflow\";\n\n  \u002F\u002F .create() returns a hook instance — NOT directly callable\n  const hook = approvalHook.create({ token: `approval:${orderId}` });\n\n  \u002F\u002F CRITICAL: Emit the token to the client so it knows what to resume\n  await emitToken(hook.token, orderId);\n\n  \u002F\u002F Race between approval and timeout\n  const result = await Promise.race([\n    hook.then((payload) => ({ type: \"approval\" as const, payload })),\n    sleep(\"24h\").then(() => ({ type: \"timeout\" as const, payload: null })),\n  ]);\n\n  if (result.type === \"timeout\") {\n    return { status: \"timeout\" };\n  }\n  return { status: result.payload!.approved ? \"approved\" : \"rejected\" };\n}\n\nasync function emitToken(token: string, orderId: string): Promise\u003Cvoid> {\n  \"use step\";\n  const writer = getWritable\u003C{ type: string; token: string; orderId: string }>().getWriter();\n  try {\n    await writer.write({ type: \"awaiting_approval\", token, orderId });\n  } finally {\n    writer.releaseLock();\n  }\n}\n```\n\n**Common mistake**: Calling `defineHook()` directly or forgetting `.create()`. Always: `const hook = myHook.create({ token })`.\n\n### 2. Resume route (API file — required!)\n\n```ts\n\u002F\u002F app\u002Fapi\u002Fapprove\u002Froute.ts\nimport { NextResponse } from \"next\u002Fserver\";\nimport { resumeHook } from \"workflow\u002Fapi\";\n\nexport async function POST(req: Request) {\n  const { token, ...data } = await req.json();\n  await resumeHook(token, data);\n  return NextResponse.json({ ok: true });\n}\n```\n\n**You MUST create this route.** Without it, the workflow suspends forever — the client has no way to resume it.\n\n### 3. Client-side resume (React component)\n\n```tsx\n\u002F\u002F When the SSE stream emits { type: \"awaiting_approval\", token }, show UI and POST back:\nasync function handleApprove(token: string) {\n  await fetch(\"\u002Fapi\u002Fapprove\", {\n    method: \"POST\",\n    headers: { \"Content-Type\": \"application\u002Fjson\" },\n    body: JSON.stringify({ token, approved: true, comment: \"Looks good\" }),\n  });\n}\n```\n\n## Error Handling\n\n```ts\nimport { FatalError, RetryableError } from \"workflow\";\n\nasync function callExternalAPI(url: string) {\n  \"use step\";\n  const res = await fetch(url);\n\n  if (res.status >= 400 && res.status \u003C 500) {\n    throw new FatalError(`Client error: ${res.status}`);  \u002F\u002F No retry\n  }\n  if (res.status === 429) {\n    throw new RetryableError(\"Rate limited\", { retryAfter: \"5m\" });  \u002F\u002F Retry after 5 min\n  }\n  return res.json();\n}\n```\n\nStep retry metadata:\n\n```ts\nimport { getStepMetadata } from \"workflow\";\n\nasync function processWithRetry(id: string) {\n  \"use step\";\n  const { attempt } = getStepMetadata();\n  console.log(`Attempt ${attempt} for ${id}`);\n  \u002F\u002F ...\n}\n```\n\n## Sandbox Limitations & Workarounds\n\n| Limitation | Solution |\n|-----------|----------|\n| No native `fetch()` in workflow scope | Import `fetch` from `\"workflow\"` or move to a step |\n| No `setTimeout`\u002F`setInterval` | Use `sleep()` from `\"workflow\"` |\n| No Node.js modules in workflow scope | Move all Node.js logic to step functions |\n\n## DurableAgent (AI SDK Integration)\n\n```ts\nimport { DurableAgent } from \"@workflow\u002Fai\u002Fagent\";\nimport { getWritable } from \"workflow\";\nimport { z } from \"zod\";\n\nasync function searchDatabase(query: string) {\n  \"use step\";\n  \u002F\u002F Full Node.js access — real DB calls here\n  return `Results for \"${query}\"`;\n}\n\nexport async function researchAgent(topic: string) {\n  \"use workflow\";\n\n  const agent = new DurableAgent({\n    model: \"anthropic\u002Fclaude-sonnet-4-5\",\n    system: \"You are a research assistant.\",\n    tools: {\n      search: {\n        description: \"Search the database\",\n        inputSchema: z.object({ query: z.string() }),\n        execute: searchDatabase,  \u002F\u002F Tool execute uses \"use step\"\n      },\n    },\n  });\n\n  const result = await agent.stream({\n    messages: [{ role: \"user\", content: `Research ${topic}` }],\n    writable: getWritable(),\n    maxSteps: 10,\n  });\n\n  return result.messages;\n}\n```\n\nEvery LLM call and tool execution becomes a retryable step. The entire agent loop survives crashes and deployments.\n\n## Common Patterns\n\n### Fan-Out \u002F Parallel Steps\n\n```ts\nexport async function processImages(imageIds: string[]) {\n  \"use workflow\";\n\n  const results = await Promise.all(\n    imageIds.map(async (id) => {\n      return await resizeImage(id);  \u002F\u002F Each is its own step\n    })\n  );\n\n  await saveResults(results);\n}\n\nasync function resizeImage(id: string) {\n  \"use step\";\n  \u002F\u002F ...\n}\n```\n\n### Saga with Compensation\n\n```ts\nimport { FatalError, getWritable } from \"workflow\";\n\nexport async function upgradeSaga(userId: string) {\n  \"use workflow\";\n\n  await reserveSeats(userId);\n\n  try {\n    await chargePayment(userId);\n  } catch {\n    await releaseSeats(userId);  \u002F\u002F Compensate\n    throw new FatalError(\"Payment failed\");\n  }\n\n  await activatePlan(userId);\n}\n```\n\n## Debugging\n\n```bash\nnpx workflow health                    # Check endpoints\nnpx workflow web                       # Visual dashboard\nnpx workflow inspect runs              # List all runs\nnpx workflow inspect run \u003Crun_id>      # Inspect specific run\nnpx workflow cancel \u003Crun_id>           # Cancel execution\n```\n\n## Debug Stuck Workflow\n\nWhen a workflow appears stuck, hanging, or not progressing, follow this escalation ladder:\n\n### 1. Add Step-Level Logging (Required)\n\n**Every step function MUST have `console.log` at entry and exit.** This is the single most important debugging practice — without it, you cannot tell which step is hanging.\n\n```ts\nasync function processOrder(orderId: string): Promise\u003COrderResult> {\n  \"use step\";\n  console.log(`[processOrder] START orderId=${orderId} at=${new Date().toISOString()}`);\n  try {\n    const result = await doWork(orderId);\n    console.log(`[processOrder] DONE orderId=${orderId} result=${JSON.stringify(result)}`);\n    return result;\n  } catch (err) {\n    console.error(`[processOrder] FAIL orderId=${orderId} error=${err}`);\n    throw err;\n  }\n}\n```\n\n**Workflow-level logging** — log at every orchestration point:\n\n```ts\nexport async function myWorkflow(input: string) {\n  \"use workflow\";\n  console.log(`[myWorkflow] START input=${input}`);\n\n  const data = await stepOne(input);\n  console.log(`[myWorkflow] stepOne complete, starting stepTwo`);\n\n  const result = await stepTwo(data);\n  console.log(`[myWorkflow] stepTwo complete, returning`);\n\n  return { result };\n}\n```\n\n### 2. Check Run Status\n\n```bash\n# List recent runs — look for \"running\" status that's been active too long\nnpx workflow inspect runs\n\n# Get detailed status for a specific run\nnpx workflow inspect run \u003Crun_id>\n\n# Check if the workflow endpoints are healthy\nnpx workflow health\n```\n\n### 3. Check Vercel Runtime Logs\n\n```bash\n# Stream live logs from your deployment\nvercel logs --follow\n\n# Or check the Vercel dashboard: Project → Deployments → Functions tab\n```\n\nLook for:\n- **Missing step entry logs** — the step before the missing one is where execution stopped\n- **Timeout errors** — Vercel function timeout (default 60s hobby, 300s pro)\n- **OIDC\u002Fcredential errors** — `gateway()` calls fail silently without `vercel env pull`\n- **Memory errors** — large payloads in steps can OOM the function\n\n### 4. Common Stuck Scenarios\n\n| Symptom | Likely Cause | Fix |\n|---------|-------------|-----|\n| Run stays \"running\" forever | Step is awaiting an external call that never resolves | Add timeout with `Promise.race` + `sleep()` |\n| Hook never resumes | Missing resume API route or wrong token | Verify resume route exists and token matches |\n| Step retries endlessly | Throwing `RetryableError` without bounds | Add `FatalError` after max retries via `getStepMetadata().retryCount` |\n| Workflow starts but no steps run | `getWritable()` called in workflow scope | Move `getWritable()` into a `\"use step\"` function |\n| AI step hangs | Missing OIDC credentials for gateway | Run `vercel link && vercel env pull` |\n| No logs appearing at all | Logging not added to steps | Add `console.log` at entry\u002Fexit of every step |\n\n### 5. Use Browser Verification\n\nIf the workflow powers a UI, use `agent-browser` to check the frontend while inspecting backend logs — a hanging page often means a stuck workflow step. Check the browser console for failed fetch calls to your workflow API routes.\n\n## When to Use WDK vs Regular Functions\n\n| Scenario | Use |\n|----------|-----|\n| Simple API endpoint, fast response | Regular Route Handler |\n| Multi-step process, must complete all steps | WDK Workflow |\n| AI agent in production, must not lose state | WDK DurableAgent |\n| Background job that can take minutes\u002Fhours | WDK Workflow |\n| Process spanning multiple services | WDK Workflow |\n| Quick one-shot LLM call | AI SDK directly |\n\n## Framework Support\n\nNext.js, Nitro, SvelteKit, Astro, Express, Hono (supported). TanStack Start, React Router (in development).\n\n## Official Documentation\n\n- [Workflow DevKit](https:\u002F\u002Fvercel.com\u002Fdocs\u002Fworkflow)\n- [Website](https:\u002F\u002Fuseworkflow.dev)\n- [GitHub](https:\u002F\u002Fgithub.com\u002Fvercel\u002Fworkflow)\n- [Workflow Builder Template](https:\u002F\u002Fvercel.com\u002Ftemplates\u002Fnext.js\u002Fworkflow-builder)\n",{"name":5,"metadata":24,"description":7},{"docs":25,"sitemap":28,"priority":29,"bashPatterns":30,"pathPatterns":45,"promptSignals":65,"importPatterns":397},[26,27],"https:\u002F\u002Fvercel.com\u002Fdocs\u002Fworkflow","https:\u002F\u002Fuseworkflow.dev","https:\u002F\u002Fvercel.com\u002Fsitemap\u002Fdocs.xml",9,[31,32,33,34,35,36,37,38,39,40,41,42,43,44],"\\bnpm\\s+(install|i|add)\\s+[^\\n]*@vercel\u002Fworkflow\\b","\\bpnpm\\s+(install|i|add)\\s+[^\\n]*@vercel\u002Fworkflow\\b","\\bbun\\s+(install|i|add)\\s+[^\\n]*@vercel\u002Fworkflow\\b","\\byarn\\s+add\\s+[^\\n]*@vercel\u002Fworkflow\\b","\\bnpm\\s+(install|i|add)\\s+[^\\n]*\\bworkflow\\b","\\bpnpm\\s+(install|i|add)\\s+[^\\n]*\\bworkflow\\b","\\bbun\\s+(install|i|add)\\s+[^\\n]*\\bworkflow\\b","\\byarn\\s+add\\s+[^\\n]*\\bworkflow\\b","\\bnpm\\s+(install|i|add)\\s+[^\\n]*@workflow\u002F","\\bpnpm\\s+(install|i|add)\\s+[^\\n]*@workflow\u002F","\\bbun\\s+(install|i|add)\\s+[^\\n]*@workflow\u002F","\\byarn\\s+add\\s+[^\\n]*@workflow\u002F","\\bnpx\\s+workflow(?:@latest)?\\b","\\bbunx\\s+workflow(?:@latest)?\\b",[46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64],"lib\u002Fworkflow\u002F**","src\u002Flib\u002Fworkflow\u002F**","workflows\u002F**","lib\u002Fworkflow.*","src\u002Flib\u002Fworkflow.*","workflow.*","*workflow*","*workflow*\u002F**","**\u002Fchain-engine*","**\u002Fchain_engine*","**\u002FchainEngine*","**\u002Fpipeline-engine*","**\u002Fpipeline_engine*","**\u002FpipelineEngine*","**\u002Fstate-machine*","**\u002Fstate_machine*","**\u002FstateMachine*","**\u002Forchestrat*","**\u002Fescalation*",{"allOf":66,"anyOf":228,"noneOf":245,"phrases":250,"minScore":396},[67,69,71,73,75,78,80,82,85,87,88,90,91,93,94,96,98,100,101,102,104,106,108,110,111,113,115,117,118,121,123,124,127,128,129,130,132,133,134,135,137,139,140,143,145,147,149,151,152,153,156,158,160,162,164,165,167,168,169,170,171,173,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,192,194,196,199,200,201,203,205,207,209,210,212,214,216,218,220,222,224,225,226,227],[5,68],"durable",[5,70],"retry",[5,72],"resume",[74,72],"pause",[76,77],"survive","crash",[76,79],"reload",[76,81],"disconnect",[83,84],"pipeline","stream",[83,86],"step",[83,68],[83,89],"reliable",[83,70],[92,84],"multi-step",[92,89],[95,83],"generation",[97,83],"creation",[99,84],"process",[99,89],[99,70],[70,103],"failure",[70,105],"error",[70,107],"automatically",[70,109],"transient",[89,70],[112,89],"individually",[114,89],"steps",[116,89],"sandbox",[116,70],[119,120],"reconnect","network",[119,122],"drop",[119,81],[125,126],"session","persist",[125,76],[125,79],[125,119],[131,76],"chat",[131,126],[131,119],[131,68],[131,136],"fault",[138,126],"conversation",[138,76],[141,142],"approval","wait",[141,144],"human",[146,86],"each",[146,148],"phase",[146,150],"stage",[86,89],[86,70],[154,155],"chain","trigger",[154,157],"sequential",[154,159],"email",[154,161],"webhook",[154,163],"delay",[154,86],[154,166],"escalat",[157,155],[157,159],[157,86],[157,161],[155,172],"orchestrat",[155,174],"service",[155,163],[155,157],[161,154],[161,172],[161,83],[161,157],[159,155],[159,83],[159,157],[159,163],[159,166],[166,155],[166,86],[166,159],[190,191],"state","machine",[193,86],"conditional",[193,195],"skip",[197,198],"branch","condition",[142,161],[142,155],[142,202],"event",[5,204],"stuck",[5,206],"hung",[5,208],"timeout",[5,105],[5,211],"logs",[5,213],"debug",[5,215],"check",[5,217],"failing",[5,219],"status",[221,219],"run",[86,223],"failed",[86,204],[86,208],[5,221],[221,211],[229,230,92,231,83,232,233,234,235,236,237,238,148,239,150,240,68,89,241,70,119,76,126,141,154,157,155,161,242,243,244,232],"long-running","long running","multi step","orchestration","step-by-step","step by step","each piece","each step","each phase","each stage","phases","stages","fault-tolerant","escalation","state machine","orchestrate",[246,247,248,249],"github actions",".github\u002Fworkflows","ci workflow","aws step functions",[251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,241,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,243,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395],"vercel workflow","workflow devkit","durable workflow","durable execution","durable function","durable pipeline","durable process","durable agent","durable chat","step function","step functions","use workflow","use step","multi-step pipeline","multi step pipeline","multi-step process","multi step process","multi-step creation","multi-step generation","processing pipeline","creation pipeline","generation pipeline","content pipeline","production pipeline","approval pipeline","ingestion pipeline","streams progress","stream progress","streams each phase","streams each step","streams each","stream each","survive page reload","survive page reloads","survive a crash","survive crashes","survive network","fault tolerant","crash-safe","crash safe","automatically retry","auto retry","retry on failure","retry on error","reliable and retry","reliable processing","individually reliable","each step reliable","each step should be reliable","steps should be reliable","reliable with automatic retry","reliable with retry","retry on transient","transient failures","session persistence","session should persist","session survives","reconnect automatically","auto reconnect","reconnect if the network","reconnect on disconnect","resume after failure","resume after crash","resume on reconnect","human-in-the-loop","human in the loop","wait for approval","approval step","approval before","editorial approval","manual approval","wait for user","pause until","wait for response","callback url","webhook callback","chat should survive","chat survives","conversation should persist","conversation persists","conversation should survive","sequential chain","email chain","chain of emails","chain of steps","chain engine","chain with triggers","trigger chain","triggered chain","webhook chain","webhook pipeline","webhook orchestration","multi-service trigger","cross-service trigger","various triggers","different triggers","triggers from different","triggers from various","sequential steps","sequential pipeline","sequential process","sequential emails","escalation chain","escalation pipeline","step-based","step based","delay between steps","delay between emails","delayed steps","conditional steps","skip steps","branch based on","wait for webhook","wait for trigger","wait for event","orchestrate emails","orchestrate webhooks","orchestrate services","chain across services","workflow stuck","workflow hung","workflow hanging","workflow waiting","workflow failing","workflow timeout","workflow not running","workflow error","check workflow","workflow logs","workflow run status","debug workflow","workflow not finishing","workflow not responding","workflow stalled","workflow pending","step is stuck","step is hanging","why is my workflow","workflow run","step failed","run status","run failed","run logs","workflow run failed","workflow step failed",4,[398,5,399,52],"@vercel\u002Fworkflow","@workflow\u002F*","main","d9535210da9af28aa76bca80de80355197e1b6d6","skills\u002Fworkflow","https:\u002F\u002Fgithub.com\u002Fzfifteen\u002Fskills-catalog","https:\u002F\u002Fgithub.com\u002Fzfifteen","I like to measure things.","2026-07-19 23:41:54",{"source":8,"skillName":5,"commands":408,"prompt":418,"zipAvailable":419},[409,412,415],{"tool":410,"command":411},"npx","npx skills add zfifteen\u002Fskills-catalog --skill workflow",{"tool":413,"command":414},"bunx","bunx skills add zfifteen\u002Fskills-catalog --skill workflow",{"tool":416,"command":417},"pnpm","pnpm dlx skills add zfifteen\u002Fskills-catalog --skill workflow","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fzfifteen\u002Fskills-catalog\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002FSKILL.md",true,[421,427],{"path":422,"resourceType":423,"resourceTypeDesc":424,"sizeBytes":425,"sourceHtmlUrl":426},"agents\u002Fopenai.yaml","REFERENCE","参考文档",106,"https:\u002F\u002Fgithub.com\u002Fzfifteen\u002Fskills-catalog\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fagents\u002Fopenai.yaml",{"path":428,"resourceType":423,"resourceTypeDesc":424,"sizeBytes":429,"sourceHtmlUrl":430},"references\u002Fdurable-agent-patterns.md",2522,"https:\u002F\u002Fgithub.com\u002Fzfifteen\u002Fskills-catalog\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Freferences\u002Fdurable-agent-patterns.md",[432,439,446,453,462,469],{"skillNo":433,"name":434,"nameZh":6,"description":435,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":436,"categories":437,"keywords":438,"publishedAt":19},"01M79GXQ2PWPT2E4CJYHXVJ0YE","Zotero","Use Zotero Desktop from Codex to enable\u002Fprobe the local API, search a local Zotero library, list items\u002Fcollections\u002Ftags, export BibTeX, insert citation keys into LaTeX or Markdown drafts, read indexed full text when requested, and import BibTeX\u002FRIS records into Zotero through the connector server. Use when the user mentions Zotero, citations, references.bib, BibTeX export, local Zotero API, localhost:23119, or adding citations from a Zotero library.","https:\u002F\u002Fgithub.com\u002Fzfifteen\u002Fskills-catalog\u002Fblob\u002Fmain\u002Fskills\u002Fzotero\u002FSKILL.md",[],[],{"skillNo":440,"name":441,"nameZh":6,"description":442,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":443,"categories":444,"keywords":445,"publishedAt":19},"01M79GXN85NETKBE06865CWK6Z","zoom-apps-sdk","Use when using Apps SDK.","https:\u002F\u002Fgithub.com\u002Fzfifteen\u002Fskills-catalog\u002Fblob\u002Fmain\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[],{"skillNo":447,"name":448,"nameZh":6,"description":449,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":450,"categories":451,"keywords":452,"publishedAt":19},"01M79GXCYD7FGYS932J9N9RFFY","youtube","Obtain accurate, timestamped YouTube video transcripts (preferring manual captions over auto-generated) as the primary deliverable, then derive summaries, key claims, or notes from that transcript.  Use when the user provides a YouTube URL (or video ID) and wants the transcript, a faithful summary, key claims with attribution, timestamped notes, or \"what does this video actually say\".  The skill is transcript-first: never substitute metadata, title, description, or search snippets for the spoken content.  Triggers: \"youtube transcript\", \"get the transcript of this video\", \"summarize this youtube video\", \"what did they say in https:\u002F\u002Fyoutube.com\u002F...\", \"key claims from this talk\".","https:\u002F\u002Fgithub.com\u002Fzfifteen\u002Fskills-catalog\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube\u002FSKILL.md",[],[],{"skillNo":454,"name":455,"nameZh":6,"description":456,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":457,"licenseFileUrl":458,"sourceHtmlUrl":459,"categories":460,"keywords":461,"publishedAt":19},"01M79GX8EXHHYM566BKR7MS778","yeet","Publish local changes to GitHub by confirming scope, committing intentionally, pushing the branch, and opening a draft PR through the GitHub app from this plugin, with `gh` used only as a fallback where connector coverage is insufficient.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fzfifteen\u002Fskills-catalog\u002Fblob\u002Fmain\u002Fskills\u002Fyeet\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fzfifteen\u002Fskills-catalog\u002Fblob\u002Fmain\u002Fskills\u002Fyeet\u002FSKILL.md",[],[],{"skillNo":463,"name":464,"nameZh":6,"description":465,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":466,"categories":467,"keywords":468,"publishedAt":19},"01M79GX2HFJPX84NMRE5VBTYX9","x-post-creator","Create X-ready post threads and co-located story packages from the active conversation or referenced project material. Use when the user says turn this into an X-post, \u002Fx-post, make this into an X thread, or wants plain-language social posts with supporting images saved to docs\u002Fx-posts\u002F[story-name]\u002F.","https:\u002F\u002Fgithub.com\u002Fzfifteen\u002Fskills-catalog\u002Fblob\u002Fmain\u002Fskills\u002Fx-post-creator\u002FSKILL.md",[],[],{"skillNo":470,"name":471,"nameZh":6,"description":472,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":473,"categories":474,"keywords":475,"publishedAt":19},"01M79GWXQT4HBT6QME6QSBZJFA","x-api","Search, read, and write X posts through the local X API MCP server (the same backend used by the Codex x-api skill). Use for searching X\u002Fx.com, reading threads and replies, creating lists, staging\u002Fpublishing posts for @alltheputs, finding high-visibility reply targets for research outreach, ingesting public context, or any request that mentions \u002Fx-api or \"search X\".","https:\u002F\u002Fgithub.com\u002Fzfifteen\u002Fskills-catalog\u002Fblob\u002Fmain\u002Fskills\u002Fx-api\u002FSKILL.md",[],[]]