write-route

Expose behaviors as HTTP routes with Zod validation and SSE streaming.

Updated Oct 29, 2025
One-click install
npx skills add https://github.com/coeus-ventures/epic-web --skill write-route
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: write-route
Source: https://github.com/coeus-ventures/epic-web/tree/main/.claude/skills/write-route
Command: npx skills add https://github.com/coeus-ventures/epic-web --skill write-route

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill standardizes how to expose business logic as HTTP routes using the Epic three-layer architecture, ensuring consistent endpoints, authentication, and safe streaming/webhook patterns.

Core Features & Use Cases

  • Backend route generation consistent with app structure, supports GET/POST, headers/status, and optional SSE streaming.
  • Supports webhooks and external integrations; routes live under app/(app)/projects/behaviors structure with route.ts and helper hooks.
  • Enforces authentication checks, input validation with Zod, and safe error handling for production-grade APIs.

Quick Start

Create a new route by following the documented folder structure and implement route.ts plus use-*.ts to expose a secure HTTP endpoint.

Frequently Asked Questions about write-route

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

FAQPage Schema
How do I create an HTTP route with SSE streaming and authentication?

To create an HTTP route with SSE streaming and authentication, you expose business logic following the Epic architecture, enforcing auth checks, Zod input validation, and safe error handling within the app/(app)/projects/behaviors structure.

What is the Epic architecture pattern for backend HTTP routes?

The Epic architecture pattern for backend HTTP routes is a standardized three-layer structure that exposes behaviors as endpoints, ensuring consistent authentication, input validation, and safe streaming or webhook patterns.

Can I use Zod validation for webhook endpoints in a Next.js app?

Yes, you can use Zod validation for webhook endpoints by applying the Epic architecture pattern, which enforces input validation and safe error handling for external integrations and standard HTTP endpoints.

What's the best way to structure backend API routes for streaming and webhooks?

The best way to structure backend API routes for streaming and webhooks is using a standardized Epic architecture, placing route.ts and helper hooks under the app/(app)/projects/behaviors folder structure.

Why does my SSE streaming route fail authentication checks?

SSE streaming routes fail authentication checks when they are not properly exposed following the Epic architecture, which enforces authentication checks before handling streaming responses and safe error handling.