add-api-route

Scaffolds new API routes with authentication and workspace scoping for Mako Hono backend.

11|6|Updated Nov 15, 2025
One-click install
npx skills add https://github.com/mako-ai/mako --skill add-api-route-mako-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-api-route
Source: https://github.com/mako-ai/mako/tree/main/.cursor/skills/add-api-route
Command: npx skills add https://github.com/mako-ai/mako --skill add-api-route-mako-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines the creation of new API endpoints by providing a standardized scaffold that enforces authentication, workspace scoping, and a deterministic middleware chain for the Mako Hono backend.

Core Features & Use Cases

  • Route scaffolding: Generates api/src/routes/<feature>.ts with a consistent routing and auth setup.
  • API mounting: Updates api/src/index.ts to mount the new feature under /api/<feature>.
  • Service delegation: Encourages creating a minimal service layer (api/src/services/<feature>.service.ts) to host business logic while keeping routes thin.
  • Middleware order: Enforces the required sequence unifiedAuthMiddleware → workspace verification → route handler, with defense-in-depth checks.

Quick Start

Create the route file at api/src/routes/<feature>.ts, mount it in api/src/index.ts, and implement a minimal service to handle business logic.

Frequently Asked Questions about add-api-route

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

FAQPage Schema
How do I scaffold a secure API route with authentication in Hono?

To scaffold a secure API route in Hono, create a route file with a deterministic middleware chain that applies unifiedAuthMiddleware before workspace verification and route handler execution.

What middleware order is required for authenticated API routes?

The required middleware order for authenticated API routes is unifiedAuthMiddleware first, followed by workspace verification, and then the route handler, establishing defense-in-depth checks for secure delegation.

How do I mount a new API endpoint in a Hono backend?

Mounting a new API endpoint in a Hono backend requires updating the main index file to register the new feature router under the /api/<feature> path, linking the scaffolded route to the application.

Should business logic go in the route handler or a service layer?

Business logic should reside in a minimal service layer file rather than the route handler, keeping routes thin while the service layer hosts the delegated business logic and consistent error handling.

Does this API scaffolding enforce workspace scoping for multi-tenant endpoints?

Yes, API scaffolding enforces workspace scoping by integrating workspace verification directly into the middleware chain, ensuring all endpoint business logic remains scoped to the correct workspace context.