write-endpoints

Build OpenAPI endpoints for Cloudflare Workers with Chanfana and Zod v4.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/dwhoban/chanfana-vite-kumo --skill write-endpoints-dwhoban
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: write-endpoints
Source: https://github.com/dwhoban/chanfana-vite-kumo/tree/main/.agents/skills/write-endpoints
Command: npx skills add https://github.com/dwhoban/chanfana-vite-kumo --skill write-endpoints-dwhoban

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the development of robust OpenAPI endpoints for Cloudflare Workers, simplifying schema definition, request validation, CRUD operations, and database integration.

Core Features & Use Cases

  • OpenAPI-First Development: Define API endpoints using OpenAPI specifications and Zod schemas.
  • CRUD Automation: Generate standard Create, Read, Update, Delete, and List operations automatically.
  • D1 Database Integration: Seamlessly connect and interact with Cloudflare D1 databases.
  • Error Handling: Implement comprehensive error management with predefined exception classes.
  • Use Case: Develop a new RESTful API for a user management system, complete with data validation, database persistence using D1, and clear OpenAPI documentation, all within a few hours.

Quick Start

Use the write-endpoints skill to create a new Hono endpoint for fetching user data.

Frequently Asked Questions about write-endpoints

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build OpenAPI endpoints for Cloudflare Workers?

To build OpenAPI endpoints for Cloudflare Workers, use the Chanfana framework to define API routes with Zod v4 schemas. Chanfana handles request validation, automatic CRUD operations, and generates OpenAPI documentation automatically.

Can I use Chanfana with Hono and itty-router to create APIs?

Yes, Chanfana works with both Hono and itty-router to create OpenAPI-compliant APIs. The framework provides detailed integration examples for both routers, allowing you to define endpoints, validate requests with Zod, and manage exceptions.

Does Chanfana support automatic CRUD operations with D1 databases?

Chanfana supports automatic CRUD operations integrated directly with Cloudflare D1 databases. You can generate standard Create, Read, Update, Delete, and List operations automatically while maintaining schema validation through Zod v4 definitions.

What is the best way to validate API requests in Cloudflare Workers?

The best way to validate API requests in Cloudflare Workers is using Zod v4 schemas with Chanfana. This approach automatically validates various data types against your OpenAPI specifications, ensuring robust request validation before processing.

How do I handle exceptions and errors in OpenAPI endpoints on Cloudflare Workers?

To handle exceptions in OpenAPI endpoints on Cloudflare Workers, Chanfana provides predefined exception classes for robust error management. Implementing these predefined exceptions ensures consistent error responses across your API routes.