routes-site

Standardize site HTTP route handlers in the Madoc TS application.

57|15|Updated Nov 28, 2018
One-click install
npx skills add https://github.com/digirati-co-uk/madoc-platform --skill routes-site
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: routes-site
Source: https://github.com/digirati-co-uk/madoc-platform/tree/main/.agents/skills/routes-site
Command: npx skills add https://github.com/digirati-co-uk/madoc-platform --skill routes-site

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Ensure site HTTP endpoints in the Madoc TypeScript service are implemented consistently, follow shared middleware and authorization patterns, and return predictable request/response shapes to reduce bugs and integration issues.

Core Features & Use Cases

  • Conventions for Route Modules: Guidance on where site route modules live under services/madoc-ts/src/routes/site and how to structure handlers.
  • Middleware and Shared Setup: Advice on confirming and using shared middleware from services/madoc-ts/src/routes/root.ts and services/madoc-ts/src/routes/global/.
  • Request/Response Expectations: Recommendations for consistent response shapes, auth/permission checks, and integration test coverage when adding or updating endpoints.
  • Use Cases: Add a new site endpoint, modify an existing handler's response, or introduce middleware for site routes while preserving global behaviors.

Quick Start

Add a new site endpoint in services/madoc-ts/src/routes/site/ following existing handler patterns and using shared middleware from services/madoc-ts/src/routes/root.ts.

Frequently Asked Questions about routes-site

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

FAQPage Schema
How do I add a new HTTP route handler in a TypeScript backend application?

To add a new HTTP route handler, create a module under the site routes directory and follow existing handler conventions, ensuring you apply shared middleware and authorization checks for consistent request and response patterns.

What's the best way to standardize API response shapes across site endpoints?

Standardize API response shapes by applying shared middleware from the global routing files and following established handler conventions, ensuring all site endpoints return predictable response shapes and pass integration tests.

How does shared middleware work for site route handlers in Madoc TS?

Shared middleware for site route handlers is imported from the root and global routing files, ensuring consistent authorization checks, request processing, and response formatting across all modules in the site routes directory.

Do I need to write integration tests when modifying existing site endpoints?

Yes, integration test coverage is required when adding or updating site endpoints to verify handler conventions, shared middleware usage, authorization checks, and consistent response shapes are properly maintained.

Can I introduce custom middleware for site routes without breaking global behaviors?

You can introduce middleware for site routes while preserving global behaviors by applying shared middleware from the root routing files and following established handler conventions within the site routes directory.

Why are my site route handlers returning inconsistent response shapes?

Inconsistent response shapes occur when site route handlers bypass shared middleware from the root and global routing files or deviate from established handler conventions, authorization checks, and standard request and response patterns.