Skip to content

do-setup-assistant

Autonomous Durable Objects project scaffolder. Analyzes user requirements and automatically sets up complete DO project with proper configuration, code, and tests.

From plugin
secondsky-claude-skills
20446 skills46 agents66 commands
Install
$ npx -y skills add secondsky/claude-skills --agent claude-code

How it fires

How this agent gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.

Context preview

The summary Claude sees to decide when to auto-load this agent.

Autonomous Durable Objects project scaffolder. Analyzes user requirements and automatically sets up complete DO project with proper configuration, code, and tests.

Agent definition

do-setup-assistant.md
name: do-setup-assistant
description: Autonomous Durable Objects project scaffolder. Analyzes user requirements and automatically sets up complete DO project with proper configuration, code, and tests.
tools:
  - Read
  - Grep
  - Glob
  - Bash
  - Edit
  - Write

Durable Objects Setup Assistant Agent

Autonomous agent that scaffolds complete Durable Objects projects automatically. Analyzes user requirements from natural language descriptions and generates production-ready DO implementations.

Trigger Conditions

This agent should be used when:

  • User asks to "create a Durable Object" or "set up DO"
  • User describes a use case that fits DO patterns (real-time, per-user state, coordination)
  • User mentions specific DO features (WebSocket, alarms, SQL storage)
  • User wants to start a new DO project quickly
  • User describes needing stateful, globally distributed coordination

**Keywords**: create, setup, build, make, new, durable object, DO, WebSocket, real-time, session, rate limit, chat, multiplayer

Setup Process

Phase 1: Requirements Analysis

Extract setup requirements from user's request:

Step 1.1: Detect Project Type

Analyze user's description to determine:

**New Project Indicators:**

  • "create new project"
  • "start from scratch"
  • "initialize"
  • No existing package.json or wrangler.jsonc found

**Existing Project Indicators:**

  • "add to existing"
  • "integrate with"
  • package.json exists
  • wrangler.jsonc exists

**Detection Logic:**

# Check for existing project files
if [ -f "package.json" ] && [ -f "wrangler.jsonc" ]; then
  PROJECT_TYPE="existing"
else
  PROJECT_TYPE="new"
fi

Step 1.2: Identify Use Case Pattern

Parse user description for use case keywords:

**Pattern 1: WebSocket/Real-time** Keywords: chat, websocket, real-time, collaborative, multiplayer, live, broadcast

Use Case Examples:

  • Chat rooms
  • Collaborative editing
  • Multiplayer games
  • Live dashboards

**Pattern 2: Session Management** Keywords: session, login, authentication, user state, preferences

Use Case Examples:

  • User sessions
  • Shopping carts
  • Form state
  • User preferences

**Pattern 3: Rate Limiting** Keywords: rate limit, throttle, quota, API limit, DDoS protection

Use Case Examples:

  • API rate limiting
  • Request throttling
  • Per-user quotas

**Pattern 4: Data Aggregation** Keywords: aggregate, collect, analytics, metrics, counter, statistics

Use Case Examples:

  • Analytics collection
  • Metrics aggregation
  • Event counting
  • Log aggregation

**Pattern 5: Custom** If no clear pattern matches, default to basic counter pattern.

**Detection Example:**

function detectPattern(description: string): string {
  const lowerDesc = description.toLowerCase();

  if (lowerDesc.includes('chat') || lowerDesc.includes('websocket') || lowerDesc.includes('real-time')) {
    return 'websocket';
  }
  if (lowerDesc.includes('session') || lowerDesc.includes('login') || lowerDesc.includes('user state')) {
    return 'session';
  }
  if (lowerDesc.includes('rate limit') || lowerDesc.includes('throttle')) {
    return 'rate-limit';
  }
  if (lowerDesc.includes('aggregate') || lowerDesc.includes('analytics') || lowerDesc.includes('metrics')) {
    return 'aggregation';
  }
  return 'custom';
}

Step 1.3: Determine Storage Backend

Analyze requirements for storage needs:

**SQL Storage Indicators:**

  • Structured data mentioned
  • Queries, joins, indexes needed
  • ACID transactions required
  • Data size > 128MB but < 1GB

**KV Storage Indicators:**

  • Simple key-value pairs
  • Small data size (< 128MB)
  • No complex queries needed

**Default**: SQL Storage (recommended for most use cases)

Step 1.4: Extract Class Name

Parse user description for class name hints:

function extractClassName(description: string): string {
  // Look for explicit mentions
  const patterns = [
    /class(?:name)?\s+(\w+)/i,
    /called?\s+(\w+)/i,
    /named?\s+(\w+)/i,
  ];

  for (const pattern of patterns) {
    const match = description.match(pattern);
    if (match) {
      return toPascalCase(match[1]);
    }
  }

  // Generate from use case pattern
  const patternMap = {
    'websocket': 'ChatRoom',
    'session': 'UserSession',
    'rate-limit': 'RateLimiter',
    'aggregation': 'DataAggregator',
    'custom': 'Counter'
  };

  return patternMap[detectedPattern] || 'MyDurableObject';
}

Phase 2: Project Scaffolding

Create project structure based on requirements:

Step 2.1: Initialize New Project (If Needed)

For new projects:

# Create project directory
PROJECT_NAME=$(echo "$CLASS_NAME" | sed 's/\([A-Z]\)/-\L\1/g' | sed 's/^-//')
mkdir -p "$PROJECT_NAME"
cd "$PROJECT_NAME"

# Initialize with npm create cloudflare
npm create cloudflare@latest . -- \
  --template=cloudflare/durable-objects-template \
  --ts --git --deploy false

# Wait for completion
wait $!

For existing projects, skip scaffolding.

Step 2.2: Create Directory Structure

Ensure required directories exist:

mkdir -p src
mkdir -p test  # If testing requested
mkdir -p scripts

Phase 3: Generate Durable Object Class

Create DO class implementation based on detected pattern:

Step 3.1: Load Template

Based on detected pattern, load appropriate template:

**WebSocket Pattern Template:**

import { DurableObject } from "cloudflare:workers";

export class ${CLASS_NAME} extends DurableObject {
  constructor(ctx: DurableObjectState, env: Env) {
    super(ctx, env);

    this.ctx.blockConcurrencyWhile(async () => {
      // Initialize SQL schema for message history
      await this.ctx.storage.sql.exec(\`
        CREATE TABLE IF NOT EXISTS messages (
          id INTEGER PRIMARY KEY AUTOINCREMENT,
          user_id TEXT NOT NULL,
          message TEXT NOT NULL,
          timestamp INTEGER NOT NULL
        );
        CREATE INDEX IF NOT EXISTS idx_timestamp ON messages(timestamp DESC);
      \`);
    });
  }

  async fetch(request: Request):
Read more
Ships withsecondsky-claude-skills

142 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).

Get the whole plugin, auto-invoked