Back to list
onichandame

cloudflare-workers-api

by onichandame

a zap-fast task management system with full privacy

0🍴 0📅 Jan 12, 2026

SKILL.md


name: cloudflare-workers-api description: Build and deploy comprehensive Cloudflare Workers with SvelteKit API routes, D1 database, KV storage, and R2 object storage integration for production serverless applications. license: MIT scope: project

Cloudflare Workers API Development

When to use this skill

When implementing production-grade backend APIs using Cloudflare Workers with SvelteKit, including complex authentication patterns, database operations, session management, file storage integrations, and comprehensive error handling.

Overview

This skill provides comprehensive guidance for building serverless APIs with Cloudflare Workers and SvelteKit. The content is organized into focused sub-skills for progressive learning:

🏗️ Core Architecture

  • Project structure and environment configuration
  • API route patterns with SvelteKit
  • TypeScript setup and type definitions

🔐 Authentication & Security

  • Session-based authentication with KV storage
  • Challenge-response authentication
  • Security middleware patterns

🗄️ D1 Database Operations

  • Schema management with Drizzle ORM
  • Database client setup and utilities
  • Advanced querying and pagination

📁 R2 Object Storage

  • Presigned URL generation (AWS Signature v4)
  • File management operations
  • Upload/download API routes

🚨 Error Handling & Logging

  • Comprehensive error handlers
  • Structured logging patterns
  • API error response standards

Performance & Testing

  • Caching strategies
  • API integration testing
  • Production deployment best practices

Quick Start Guide

  1. Project Setup: Start with Core Architecture for proper project structure
  2. Authentication: Implement security patterns using the Authentication module
  3. Database: Add data persistence with D1 Database operations
  4. Storage: Integrate file handling with R2 Storage
  5. Production: Apply Performance & Testing patterns for deployment

Prerequisites

  • Node.js 18+ and npm/yarn
  • Cloudflare account with Workers, D1, KV, and R2 enabled
  • SvelteKit project setup knowledge
  • TypeScript proficiency
  • Basic understanding of serverless concepts

Development Workflow

# Install dependencies
npm install @sveltejs/adapter-cloudflare drizzle-orm

# Set up Cloudflare bindings
# See architecture/ for detailed environment setup

# Run locally
npm run dev

# Deploy to production
npm run build
npx wrangler deploy

Key Benefits

  • Production Ready: Battle-tested patterns for enterprise applications
  • Type Safe: Full TypeScript coverage with comprehensive type definitions
  • Secure: Zero-knowledge architecture with client-side encryption options
  • Scalable: Built for high-traffic applications with proper caching strategies
  • Maintainable: Modular structure following OpenCode skill factory patterns
  • Each sub-skill is self-contained and can be loaded independently
  • Progress sequentially from architecture to deployment
  • Cross-references between modules for related concepts
  • All code examples are production-tested and ready to implement

Get started with Core Architecture or jump to any specific module based on your needs.

Score

Total Score

50/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon