add-api-endpoint

Creates Foundation-compatible Hono API endpoints in the Axentra Bun workspace.

Updated Sep 16, 2026
One-click install
npx skills add https://github.com/PT-Perkasa-Pilar-Utama/axentra --skill add-api-endpoint-pt-perkasa-pilar-utama
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: add-api-endpoint
Source: https://github.com/PT-Perkasa-Pilar-Utama/axentra/tree/main/.claude/skills/add-api-endpoint
Command: npx skills add https://github.com/PT-Perkasa-Pilar-Utama/axentra --skill add-api-endpoint-pt-perkasa-pilar-utama

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Adding a new API endpoint in Axentra requires following strict module boundaries, layered architecture, validation rules, and testing conventions. This Skill guides you through creating endpoints that comply with the Foundation engineering base without violating architectural constraints. ## Core Features & Use Cases - Module Scaffolding Guidance: Directs creation of routes, service, repository, schema, and test files under apps/api/src/modules/<module>/ with correct responsibility separation. - Validation & Security Enforcement: Ensures Zod validation, server-side RBAC, trusted tenant context, and the documented success/error envelope. - Use Case: When a sprint task card requires a new REST endpoint, use this Skill to structure the module, mount it under /api/v1, add coverage for success and failure paths, and pass the review checklist before opening a PR. ## Quick Start Use the add-api-endpoint skill to create a new Hono endpoint for the task card I describe, following the Axentra module structure and review checklist.

Frequently Asked Questions about add-api-endpoint

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

FAQPage Schema
How do I add a new API endpoint in a Hono application?▼

Create a module directory with routes, service, repository, schema, and test files, then mount the routes from app.ts under the /api/v1 prefix. Keep transport parsing in routes, business logic in services, and persistence in repositories.

How to validate request bodies with Zod in Hono routes?▼

Define Zod schemas in the module's schema file and validate params, query, and JSON body in the route layer. On failure, return the project's documented error envelope rather than raw validation errors.

What file structure should a Hono API module use?▼

Use five files per module: <module>.routes.ts, <module>.service.ts, <module>.repository.ts, <module>.schema.ts, and <module>.test.ts under apps/api/src/modules/<module>/. This separates transport, business decisions, persistence, and validation concerns.

Should tenant identifiers come from the request body?▼

No. Tenant and branch identifiers must be derived from trusted server-side request context, never accepted as authority from the browser. This prevents cross-tenant data access through manipulated client input.

What tests are required before merging a new endpoint?▼

Cover success, validation failure, authorization, and persistence conflict paths, and prove the route through the API test harness. Run bun run complete-check before opening the PR, and never rely on production services in tests.