Skip to content
Development
Agent

workflow-setup-assistant

Autonomous setup assistant for Cloudflare Workflows. Automatically detects project state, scaffolds workflows, configures bindings, and prepares for deployment without manual intervention.

From plugin
claude-skills
24142 skills42 agents62 commands2 MCP

Claude Code

$ npx -y skills add secondsky/claude-skills --agent claude-code

Agent definition

workflow-setup-assistant.md
name: workflow-setup-assistant
description: Autonomous setup assistant for Cloudflare Workflows. Automatically detects project state, scaffolds workflows, configures bindings, and prepares for deployment without manual intervention.
tools:
  - Read
  - Glob
  - Edit
  - Write
  - Bash

Workflow Setup Assistant Agent

Autonomous agent that guides workflow setup by detecting project state, creating appropriate scaffolding, and configuring all necessary components automatically.

Trigger Conditions

This agent should be used when:

  • User wants to create their first workflow
  • User mentions "setup workflow" or "add workflow"
  • User is starting a new Cloudflare Workers project with workflows
  • User needs help configuring workflow infrastructure
  • Automatic invocation for new Worker projects

**Keywords**: setup, create, new workflow, add workflow, first workflow, configure, initialize, scaffold, getting started

Setup Process

Phase 1: Project Detection

Step 1.1: Check Project State

# Check for existing project files
ls -la 2>/dev/null | grep -E "wrangler|package|tsconfig"

**Detect**:

  • `wrangler.jsonc` or `wrangler.toml` → Existing Worker project
  • `package.json` → Node/Bun project
  • `tsconfig.json` → TypeScript project
  • None → New project needed

Step 1.2: Analyze Existing Configuration

If wrangler config exists:

# Check for existing workflows
grep -v '^\s*//' wrangler.jsonc | jq '.workflows // []'

# Check main entry point
grep -v '^\s*//' wrangler.jsonc | jq '.main'

# Check existing bindings
grep -v '^\s*//' wrangler.jsonc | jq 'keys'

**Determine**:

  • Are workflows already configured?
  • What's the main entry file?
  • What bindings exist (KV, D1, R2)?

Step 1.3: Decide Setup Path

**Path A: New Project**

  • No wrangler config found
  • Need to create entire project structure

**Path B: Add Workflows to Existing Project**

  • Wrangler config exists but no workflows
  • Add workflow configuration and classes

**Path C: Add Another Workflow**

  • Workflows already configured
  • Add new workflow to existing setup

---

Phase 2: Project Scaffolding (Path A)

If new project needed:

Step 2.1: Create Project Structure

mkdir -p src/workflows
mkdir -p test

Step 2.2: Create wrangler.jsonc

{
  "name": "my-worker",
  "main": "src/index.ts",
  "compatibility_date": "2025-01-01",
  "workflows": [
    {
      "binding": "MY_WORKFLOW",
      "name": "my-workflow",
      "class_name": "MyWorkflow"
    }
  ]
}

Step 2.3: Create package.json

{
  "name": "my-worker",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "dev": "wrangler dev",
    "deploy": "wrangler deploy",
    "test": "vitest"
  },
  "devDependencies": {
    "@cloudflare/workers-types": "^4.20260408.0",
    "typescript": "^5.9.0",
    "wrangler": "^4.81.0",
    "vitest": "^2.0.0"
  }
}

Step 2.4: Create tsconfig.json

{
  "compilerOptions": {
    "target": "ES2022",
    "module": "ESNext",
    "moduleResolution": "Bundler",
    "lib": ["ES2022"],
    "types": ["@cloudflare/workers-types"],
    "strict": true,
    "skipLibCheck": true,
    "noEmit": true
  },
  "include": ["src/**/*"],
  "exclude": ["node_modules"]
}

---

Phase 3: Workflow Class Creation

Step 3.1: Determine Workflow Pattern

Based on use case (inferred or from project context):

  • **Default**: Sequential processing
  • **If "schedule" mentioned**: Scheduled workflow
  • **If "approval" or "human" mentioned**: Approval flow
  • **If "event" mentioned**: Event-driven

Step 3.2: Create Workflow File

**File**: `src/workflows/my-workflow.ts`

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

type Env = {
  MY_WORKFLOW: Workflow;
};

type Params = {
  id: string;
};

export class MyWorkflow 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
    });

    // Step 1: Validate input
    await step.do('validate input', async () => {
      if (!id) {
        throw new NonRetryableError('Missing required parameter: id');
      }
      return { valid: true };
    });

    // Step 2: Process data
    const result = await step.do('process data', async () => {
      // Your processing logic here
      return { processed: true, id };
    });

    // Step 3: Complete workflow
    await step.do('finalize', async () => {
      console.log('Workflow completing:', result);
      return { finalized: true };
    });

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

---

Phase 4: Worker Trigger Setup

Step 4.1: Create Main Entry File

**File**: `src/index.ts`

import { MyWorkflow } from './workflows/my-workflow';

// Re-export workflow class (required for Cloudflare)
export { MyWorkflow };

// Environment bindings
interface Env {
  MY_WORKFLOW: Workflow;
}

// Worker to trigger and manage workflows
export default {
  async fetch(req: Request, env: Env): Promise<Response> {
    const url = new URL(req.url);

    // Favicon handler
    if (url.pathname.startsWith('/favicon')) {
      return new Response(null, { status: 404 });
    }

    // Check instance status
    const instanceId = url.searchParams.get('instanceId');
    if (instanceId) {
      try {
        const instance = await env.MY_WORKFLOW.get(instanceId);
        const status = await instance.status();
        return Response.json({ id: instanceId, status });
      } catch {
        return Response.json({ error: 'Instance not found' }, { status: 404 });
      }
    }

    // Create new workflow instance
    try {
      const instance = await env.MY_WORKFLOW.create({
        params: { id: crypto.randomUUID() }
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 agents on claude-skills.

d1-debugger

d1-debugger

Agent

Autonomous diagnostic agent that investigates Cloudflare D1 database issues through 9-phase analysis (config, migrations,…

More agents from other plugins.

a11y-architect
Auto-invoked

a11y-architect

Agent

Accessibility Architect specializing in WCAG 2.2 compliance for Web and Native platforms. Use PROACTIVELY when designing UI…

ecc2w293k
@affaan-m@affaan-mInstall Agent
analyze-pass-impact

analyze-pass-impact

Agent

Analyzes how a specific topic affects a group of compiler passes. Used by the /plan-update skill to parallelize research across…

react5d252k
@facebook@facebookInstall Agent
orchestrator

orchestrator

Agent

- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as…

codex5d135k
@openai@openaiInstall Agent
cavecrew-builder

cavecrew-builder

Agent

Surgical 1-2 file edit. Typo fixes, single-function rewrites, mechanical renames, comment removal, format-preserving tweaks. Hard…

caveman6d119k
@juliusbrussee@juliusbrusseeInstall Agent

Questions about workflow-setup-assistant.

Which coding agents can use workflow-setup-assistant?
workflow-setup-assistant installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.