api-endpoint

Create or modify IdeaForge API endpoints with Zod validation and ApiResponse wrapping.

6|Updated Nov 27, 2025
One-click install
npx skills add https://github.com/Holo00/IdeaForge --skill api-endpoint
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-endpoint
Source: https://github.com/Holo00/IdeaForge/tree/main/.claude/skills/api-endpoint
Command: npx skills add https://github.com/Holo00/IdeaForge --skill api-endpoint

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill standardizes and accelerates the creation and modification of API endpoints in the IdeaForge backend, ensuring adherence to architectural patterns, best practices, and robust error handling.

Core Features & Use Cases

  • Architectural Pattern: Implement the Routes → Controller → Service → Repository pattern for clear separation of concerns.
  • Input Validation: Enforce data integrity and prevent errors using Zod for all input validation.
  • Error Handling: Standardized ApiResponse<T> wrapper and error propagation via middleware, simplifying debugging.
  • Use Case: "Create a new API endpoint /api/users that supports GET to list users and POST to create a new user, including Zod validation for user creation and proper error handling, reducing development time."

Quick Start

Use the api-endpoint skill to create a new GET /api/products endpoint that lists all products from the database.

Frequently Asked Questions about api-endpoint

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

FAQPage Schema
How do I create API endpoints following the Routes, Controller, Service, Repository pattern?

The Routes → Controller → Service → Repository pattern separates concerns: routes instantiate dependencies, controllers validate input with Zod and shape responses, services contain business logic, and repositories execute database queries. All responses wrap in ApiResponse<T> for standardized error handling and consistent structure across your backend.

What's the best way to validate API request data in Node.js and Express?

Use Zod for input validation on all API endpoints. Zod schemas enforce data integrity before business logic executes, preventing invalid data from reaching your database. Validation happens in the controller layer, which returns standardized ApiResponse errors if validation fails.

How do I implement CRUD operations for a new API endpoint?

Create a new route that instantiates a controller, which calls service methods for GET, POST, PUT, and DELETE operations. Each service method delegates database work to the repository layer. Wrap all responses in ApiResponse<T> and handle errors through middleware for consistent API behavior.

Can I use Zod validation with Express middleware for API endpoints?

Yes. Zod validates request payloads in the controller before passing data to services. The api-endpoint Skill integrates Zod validation directly into controller logic, ensuring all inputs conform to schema requirements before touching your database layer.

What error handling approach works best for Node.js REST APIs?

Standardize all API responses with ApiResponse<T> wrapper and propagate errors through middleware. This centralizes error formatting, simplifies debugging, and ensures clients receive consistent error structures across all endpoints regardless of where failures occur.

Do I need to manually wire dependencies in Express routes?

Yes. Routes instantiate repositories and services manually before passing them to controllers. This explicit dependency injection keeps architectural layers clear and testable, though it requires wiring each route with its required service and repository instances.