new-api-route

Generate Cloudflare Workers API route files with JSON parsing and validation.

1|Updated Feb 21, 2026
One-click install
npx skills add https://github.com/bluewaves-creations/website-foundation --skill new-api-route-bluewaves-creations
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: new-api-route
Source: https://github.com/bluewaves-creations/website-foundation/tree/main/.claude/skills/new-api-route
Command: npx skills add https://github.com/bluewaves-creations/website-foundation --skill new-api-route-bluewaves-creations

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines the creation of new API endpoints within a Cloudflare Workers project, ensuring consistency and reducing boilerplate code.

Core Features & Use Cases

  • Boilerplate Generation: Automatically creates the necessary file structure and basic code for a new API route.
  • Method Handling: Supports defining which HTTP methods (e.g., POST, GET) the route should respond to.
  • Request Validation: Includes built-in JSON parsing and error handling for incoming request bodies.
  • Authentication Guard: Option to easily integrate Cloudflare Access authentication.
  • Use Case: When you need to add a new webhook endpoint to receive data from a third-party service, this skill will set up the route, handle JSON parsing, and optionally secure it.

Quick Start

Use the new-api-route skill to create a new API route for handling user signups at the path 'auth/signup'.

Frequently Asked Questions about new-api-route

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

FAQPage Schema
How do I create a new API route in Cloudflare Workers?

Creating a new API route in Cloudflare Workers involves generating a file with a predefined structure for handling HTTP requests, including JSON body parsing and validation. This reduces boilerplate and enforces project-specific conventions for serverless endpoints.

How do I handle JSON request validation for an Astro API endpoint?

Handling JSON request validation for an Astro API endpoint requires parsing the incoming request body and applying error handling. This ensures that invalid data formats are caught early before processing the serverless API request.

Can I add Cloudflare Access authentication to a serverless API route?

Yes, you can add Cloudflare Access authentication to a serverless API route by integrating an optional authentication guard. This secures your endpoint by validating incoming requests before they reach the core API logic.

Does this API route generator support defining specific HTTP methods like POST or GET?

Yes, this API route generator supports defining specific HTTP methods like POST or GET. It allows you to specify which methods the serverless endpoint should respond to when setting up the Cloudflare Workers route file.

What is the best way to reduce boilerplate code for Cloudflare Workers endpoints?

The best way to reduce boilerplate code for Cloudflare Workers endpoints is to use a generator that automatically creates the necessary file structure and basic code. This enforces consistent error handling and Cloudflare binding access across your project.

How do I set up a webhook endpoint to receive third-party data in an Astro project?

To set up a webhook endpoint to receive third-party data in an Astro project, you generate a new API route that handles JSON parsing and optionally secures the endpoint. This configures the serverless path to properly ingest incoming payloads.