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 从公开仓库中收录这些内容。

举报或申请下架