Workflow Init

作者 vercelb5c1bc892a28無授權條款2.4K 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫今天更新

Install and configure Vercel Workflow SDK before it exists in node_modules. Use when the user asks to "install workflow", "set up workflow", "add durable workflows", "configure workflow sdk", or "init workflow" for Next.js, Express, Hono, Fastify, NestJS, Nitro, Nuxt, Astro, SvelteKit, or Vite.

AI 產生的概覽

指導在指定 JavaScript 框架中首次安裝並設定 Vercel Workflow SDK。

功能
此技能用於在 node_modules 中還沒有 workflow 套件時,完成 Vercel Workflow SDK 的首次設定。它會檢查 package.json,自動辨識或詢問所使用的框架,取得對應的官方入門指南,並依步驟安裝相依套件、設定框架、建立第一個工作流程與路由處理器,然後執行並驗證設定。它也會回答安裝前的概念性問題,並在完成後交由另一個 workflow 技能繼續開發。
適用情境
當使用者要求在尚未安裝 workflow 相依套件的專案中安裝、設定、加入、配置或初始化 Vercel Workflow SDK 的持久性工作流程時使用。適用於 Next.js、Express、Hono、Fastify、NestJS、Nitro、Nuxt、Astro、SvelteKit 與 Vite 專案。
執行需求
不執行指令碼,僅為操作說明。需要能讀取 package.json 與設定檔,需要網路存取以取得官方入門文件頁面,並需要一個具備套件管理員的 Node.js 專案來安裝相依套件與執行開發伺服器。

workflow-init

Initial setup of Vercel Workflow SDK before workflow is installed. Fetch the official getting-started guide for the user's framework.

Decision flow

0) Sanity check

Read package.json. If workflow is already a dependency, tell the user to use /workflow instead (it reads versioned docs from node_modules/workflow/docs/). Only continue if workflow is missing.

1) Determine the framework

Non-interactive: If the user named a framework in their prompt, use it directly.

Auto-detect: Inspect package.json deps and config files. Use the first match:

  1. Next.js - next dep or next.config.*
  2. Nuxt - nuxt dep or nuxt.config.*
  3. SvelteKit - @sveltejs/kit dep or svelte.config.*
  4. Astro - astro dep or astro.config.*
  5. NestJS - @nestjs/core dep or nest-cli.json
  6. Nitro - nitro dep or nitro.config.*
  7. Express - express dep
  8. Fastify - fastify dep
  9. Hono - hono dep
  10. Vite - vite dep (and not matched above)

If no match or multiple matches, ask the user to pick.

2) Fetch and follow the getting-started guide

Fetch exactly one of these URLs and follow the guide step-by-step:

Each guide covers: install deps, configure framework, create first workflow, create route handler, run + verify.

3) Verify setup

  • Start the dev server per the guide.
  • Trigger the example endpoint with the provided curl.
  • Confirm logs show the workflow and steps executing.
  • Optional: npx workflow web or npx workflow inspect runs.

4) No framework yet?

If no framework exists, ask what the user wants:

  • Web app: Next.js / Nuxt / SvelteKit / Astro
  • API server: Express / Fastify / Hono
  • Minimal server: Nitro or Vite

Then follow the "Create Your Project" section of the chosen guide.

Concept questions (pre-install)

If the user asks conceptual questions before installing, fetch:

Handoff

When setup is complete, tell the user: Use /workflow for ongoing development - it reads the versioned docs bundled in node_modules/workflow/docs/.

來源與署名

來源:vercel/workflow位於skills/workflow-init提交b5c1bc8

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架