add-api-route

Scaffolds new JobPilot API routes with contracts, controllers, services, and response schemas.

73|19|Updated Mar 22, 2026
One-click install
npx skills add https://github.com/suxrobGM/jobpilot --skill add-api-route-suxrobgm
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: add-api-route
Source: https://github.com/suxrobGM/jobpilot/tree/main/.claude/skills/add-api-route
Command: npx skills add https://github.com/suxrobGM/jobpilot --skill add-api-route-suxrobgm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Adding a new API endpoint in the JobPilot codebase requires touching many files—contracts schemas, controllers, services, response schemas, and web hooks—and missing any convention (like z.date() or the global error envelope) causes type mismatches or stripped response fields. ## Core Features & Use Cases - Convention-driven scaffolding: Walks through request schemas in packages/contracts, response schemas in <name>.schema.ts, and Elysia controllers with rateLimit policies. - Service layer guidance: Enforces tsyringe @singleton services with value imports and module mounting in app.ts. - Full-stack coverage: Covers the web side via Eden Treaty type inference and query/mutation hooks under apps/web/src/api/. - Use Case: When asked to "add an endpoint to list user notifications", the Skill produces the schema, controller route with response typing, service logic, and web hook following project conventions, then invokes the verify skill. ## Quick Start Add a new API endpoint for fetching application statistics following the standard module structure.

Frequently Asked Questions about add-api-route

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

FAQPage Schema
How do I add a new API endpoint in an Elysia backend?▼

Define the request schema in packages/contracts, model the response schema exactly matching the service return, then add the route in the module's controller with body, query, params, response schema, and a detail summary. Mount new module controllers in app.ts.

How do I create a new module in the JobPilot API?▼

Mirror an existing module: create <name>.controller.ts, <name>.service.ts, and <name>.schema.ts under modules/<name>/, register the service as a tsyringe @singleton, and mount the controller in app.ts. Reuse shared response envelopes from @/types/response where applicable.

Why are fields missing from my Elysia API response?▼

Elysia strips any fields not declared in the route's response schema. Model the service's return value exactly in the response schema, including z.date() for date fields, so no properties are dropped during serialization.

Does the frontend automatically get types for new API routes?▼

Yes, Eden Treaty picks up endpoint types automatically from the Elysia app. You only need to add query or mutation hooks under apps/web/src/api/ to consume the new route from the web client.

When should I add rate limiting to an API route?▼

Add a rateLimit(policy) beforeHandle where the endpoint warrants one, such as expensive or abuse-prone operations. Per-route error responses are not declared individually since they are handled by the global error envelope.