api-endpoint

Define REST API route patterns, JSON responses, and JWT authentication conventions.

Updated Feb 5, 2026
One-click install
npx skills add https://github.com/twlines/maslow --skill api-endpoint-twlines
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-endpoint
Source: https://github.com/twlines/maslow/tree/main/skills/api-endpoint
Command: npx skills add https://github.com/twlines/maslow --skill api-endpoint-twlines

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides clear conventions and examples for defining REST API route patterns, ensuring consistency and maintainability in API development.

Core Features & Use Cases

  • Route Pattern Matching: Demonstrates both exact path matching and parameterized path matching using regular expressions.
  • Response Shaping: Standardizes successful responses to { ok: true, data: ... } and errors to { ok: false, error: ... }.
  • Input Validation: Outlines best practices for parsing request bodies, validating fields, and handling query parameters.
  • Authentication: Specifies that JWT authentication should be handled centrally before route matching for most API endpoints.
  • Use Case: When building a new API endpoint, consult this Skill to ensure it follows established patterns for routing, response structure, and authentication.

Quick Start

Follow the API endpoint conventions for defining route patterns and response shapes.

Frequently Asked Questions about api-endpoint

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

FAQPage Schema
How do I define REST API route patterns in TypeScript?

To define REST API route patterns in TypeScript, use exact string comparisons for static paths and regular expressions for parameterized path matching within an AppServer. This approach ensures consistent routing conventions and maintainable backend code.

What is the standard JSON response structure for REST APIs?

The standard JSON response structure for REST APIs uses `{ ok: true, data: ... }` for successful responses and `{ ok: false, error: ... }` for error states. This convention standardizes API communication and simplifies client-side response handling.

How should JWT authentication be handled for API routes?

JWT authentication should be handled centrally before route matching for most API endpoints. By processing authentication centrally in the AppServer, you enforce consistent security conventions across all REST API routes without duplicating validation logic.

What are the best practices for input validation in backend API routes?

Best practices for input validation in backend API routes involve parsing request bodies, validating required fields, and handling query parameters systematically. Following these REST conventions ensures data integrity and prevents invalid inputs from reaching your core logic.

Can I use regular expressions for parameterized path matching in an AppServer?

Yes, you can use regular expressions for parameterized path matching in an AppServer. The Skill demonstrates combining exact string comparisons for static routes with regular expressions to extract parameters from dynamic REST API endpoints.