What problem does it solve? Adding a new server endpoint in an Astro + Cloudflare D1 project requires following several non-obvious conventions—disabling prerendering, authenticating via a thrown Response, accessing D1 through the runtime adapter, and validating input with Zod. This Skill encodes those patterns so new API routes are created correctly the first time. ## Core Features & Use Cases - Route Templates: Provides ready-to-adapt templates for collection endpoints (GET/POST on index.ts) and item endpoints (GET/PUT/DELETE on [id].ts) under src/pages/api/. - Auth and Validation Patterns: Enforces requireAuth before data access, getDb(locals.runtime.env) for D1 bindings, and Zod safeParse with validationError for request bodies. - Use Case: When adding a new admin endpoint such as /api/admin/posts, use this Skill to generate the route file with export const prerender = false, Bearer-token auth, D1 queries, and typed Zod validation already wired in. ## Quick Start Create a new authenticated admin API route for the projects entity with GET and POST handlers following the project's D1 and Zod patterns.