Skip to content
Development
Command

/workflow-setup

Interactive wizard for complete Cloudflare Workflows setup from scratch. Use when user wants to create first workflow, setup workflow infrastructure, or add workflows to existing Worker project.

From plugin
claude-skills
24162 skills42 agents62 commands2 MCP
$ npx -y skills add secondsky/claude-skills --agent claude-code

Command definition

workflow-setup.md
name: cloudflare-workflows:setup
description: Interactive wizard for complete Cloudflare Workflows setup from scratch. Use when user wants to create first workflow, setup workflow infrastructure, or add workflows to existing Worker project.

Workflow Setup Wizard

Overview

Complete interactive setup wizard for Cloudflare Workflows: project initialization, configuration, class scaffolding, and deployment preparation.

Prerequisites

Check before starting:

  • Cloudflare account with wrangler authenticated (`wrangler whoami`)
  • Node.js/Bun installed
  • Existing Worker project OR willingness to create one
  • Write access to wrangler.jsonc

Steps

Step 1: Project Detection

Check if this is a new or existing project:

# Check for wrangler.jsonc
if [ -f "wrangler.jsonc" ]; then
  EXISTING_PROJECT=true
else
  EXISTING_PROJECT=false
fi

# Check for package.json
if [ -f "package.json" ]; then
  HAS_PACKAGE_JSON=true
else
  HAS_PACKAGE_JSON=false
fi

**If new project** (`$EXISTING_PROJECT == false`):

Use AskUserQuestion:

  • **Question**: "No Worker project detected. Create new project?"
  • **Options**:
  • "Yes - Create new Worker project" → Run `npm create cloudflare@latest`
  • "No - I'll set up manually" → Exit with setup instructions

**If existing project**: Continue to Step 2

---

Step 2: Gather Workflow Requirements

Use AskUserQuestion to collect setup preferences.

**Question 1: Workflow Name**

  • **Header**: "Workflow Name"
  • **Question**: "What should your workflow be named?"
  • **multiSelect**: false
  • **Options**:
  • **label**: "Custom name (I'll type it)"
  • **description**: "Enter a unique workflow name (e.g., order-processing, user-onboarding)"

**Capture input**: Ask user to provide workflow name

  • **Validation**: Must be lowercase, alphanumeric + hyphens only (`^[a-z0-9-]+$`)
  • **Store as**: `workflowName`
  • **Generate**: `className` = PascalCase version (e.g., "order-processing" → "OrderProcessing")

---

**Question 2: Workflow Purpose**

  • **Header**: "Workflow Type"
  • **Question**: "What type of workflow are you building?"
  • **multiSelect**: false
  • **Options**:
  • **label**: "Sequential Processing"
  • **description**: "Multi-step data processing with automatic retries"
  • **label**: "Scheduled Tasks"
  • **description**: "Workflows with delays and scheduled execution"
  • **label**: "Event-Driven"
  • **description**: "Wait for external events or approvals"
  • **label**: "Approval Flow"
  • **description**: "Human-in-the-loop approval with escalation"
  • **label**: "Data Pipeline"
  • **description**: "Process large datasets in batches over time"

**Store as**: `workflowType`

---

**Question 3: Expected Duration**

  • **Header**: "Duration"
  • **Question**: "How long will your workflow typically run?"
  • **multiSelect**: false
  • **Options**:
  • **label**: "Minutes (< 1 hour)"
  • **description**: "Short-running workflows with quick execution"
  • **label**: "Hours (1-24 hours)"
  • **description**: "Medium-duration workflows with scheduling"
  • **label**: "Days (> 24 hours)"
  • **description**: "Long-running workflows with extensive delays"

**Store as**: `expectedDuration`

---

**Question 4: External Integrations**

  • **Header**: "Integrations"
  • **Question**: "Will your workflow integrate with external services?"
  • **multiSelect**: true (user can select multiple)
  • **Options**:
  • **label**: "HTTP APIs"
  • **description**: "Call external REST/GraphQL APIs"
  • **label**: "D1 Database"
  • **description**: "Query and update D1 database"
  • **label**: "KV Storage"
  • **description**: "Read/write to KV namespace"
  • **label**: "R2 Storage"
  • **description**: "Store/retrieve files from R2"
  • **label**: "Queues"
  • **description**: "Send/receive messages via Queues"

**Store as**: `integrations` (array)

---

**Question 5: Error Handling Strategy**

  • **Header**: "Error Handling"
  • **Question**: "How should failures be handled?"
  • **multiSelect**: false
  • **Options**:
  • **label**: "Automatic Retry (Recommended)"
  • **description**: "Retry failed steps with exponential backoff"
  • **label**: "Fail Fast"
  • **description**: "Stop workflow immediately on any error"
  • **label**: "Custom Retry Logic"
  • **description**: "I'll implement specific retry strategies per step"

**Store as**: `errorStrategy`

---

Step 3: Create Workflow Class

Generate WorkflowEntrypoint class based on user inputs.

**File Location**: `src/workflows/${workflowName}.ts`

**Template Selection**:

  • If `workflowType == "Sequential Processing"` → Use basic sequential template
  • If `workflowType == "Scheduled Tasks"` → Use scheduled workflow template
  • If `workflowType == "Event-Driven"` → Use event-driven template
  • If `workflowType == "Approval Flow"` → Use approval flow template
  • If `workflowType == "Data Pipeline"` → Use batch processing template

**Generate Class**:

/**
 * ${className} Workflow
 * Type: ${workflowType}
 * Expected Duration: ${expectedDuration}
 * Generated: ${currentDate}
 */

import { WorkflowEntrypoint, WorkflowStep, WorkflowEvent } from 'cloudflare:workers';
import { NonRetryableError } from 'cloudflare:workflows';

// Define environment bindings
type Env = {
  ${workflowName.toUpperCase()}_WORKFLOW: Workflow;
  ${generateEnvBindings(integrations)}
};

// Define workflow parameters
type Params = {
  id: string;
  // Add your parameters here
};

/**
 * ${className} Workflow
 *
 * ${generateWorkflowDescription(workflowType)}
 */
export class ${className} extends WorkflowEntrypoint<Env, Params> {
  async run(event: WorkflowEvent<Params>, step: WorkflowStep) {
    const { id } = event.payload;

    console.log('Workflow started:', {
      instanceId: event.instanceId,
      params: event.payload
    });

    ${generateStepScaffolding(workflowType, errorStrategy)}

    return {
      status: 'complete',
      id,
      completedAt: new Date().toISOString()
    };
  }
}

**Helper Function Logic**:

`g

Read more
@secondsky
Ships withclaude-skills

145 production-ready skills for Claude Code CLI 🔌 Platform / Harness Support These plugins ship as Claude Code marketplace plugins (.claude-plugin/ manifests) and Codex CLI plugins (.codex-plugin/ manifests).

241183 skills42 agents2 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
241
Star history of secondsky/claude-skills on GitHub, a chart by star-history.com

Other commands on claude-skills.

better-auth-setup

better-auth-setup

Command

Interactive setup wizard for better-auth authentication. Guides through database, framework, OAuth providers, and plugin…

More commands from other plugins.

build
Auto-invoked

build

Command

Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.

@addyosmani@addyosmaniInstall Command