api-endpoint

Create or modify API endpoints in IdeaForge backend. Triggers: new route, controller, service, repository, CRUD operation, Zod validation, API debugging. Pattern: Routes → Controller → Service → Repository.

16 stars

Best use case

api-endpoint is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Create or modify API endpoints in IdeaForge backend. Triggers: new route, controller, service, repository, CRUD operation, Zod validation, API debugging. Pattern: Routes → Controller → Service → Repository.

Teams using api-endpoint should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/api-endpoint/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/backend/api-endpoint/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/api-endpoint/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How api-endpoint Compares

Feature / Agentapi-endpointStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Create or modify API endpoints in IdeaForge backend. Triggers: new route, controller, service, repository, CRUD operation, Zod validation, API debugging. Pattern: Routes → Controller → Service → Repository.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# API Endpoints

## Architecture

```
Route (backend/src/api/routes/)     → DI setup + routing
Controller (backend/src/api/controllers/) → Zod validation + ApiResponse
Service (backend/src/services/)     → Business logic
Repository (backend/src/repositories/) → Database queries
```

## Quick Start

### 1. Route (`routes/{resource}.ts`)
```typescript
import { Router } from 'express';
const router = Router();

// Manual DI
const repo = new MyRepository();
const service = new MyService(repo);
const controller = new MyController(service);

router.get('/', (req, res, next) => controller.getAll(req, res, next));
router.post('/', (req, res, next) => controller.create(req, res, next));

export default router;
```

### 2. Controller (`controllers/{resource}Controller.ts`)
```typescript
const CreateSchema = z.object({
  name: z.string().min(1).max(255),
});

export class MyController {
  constructor(private service: MyService) {}

  async create(req: Request, res: Response, next: NextFunction) {
    try {
      const data = CreateSchema.parse(req.body);
      const result = await this.service.create(data);
      res.json({ success: true, data: result } as ApiResponse<typeof result>);
    } catch (error) {
      next(error);
    }
  }
}
```

### 3. Register (`index.ts`)
```typescript
import myRouter from './api/routes/my';
app.use('/api/my-resource', myRouter);
```

## Response Format

```typescript
// Success
{ success: true, data: { ... } }

// Error (via errorHandler middleware)
{ success: false, error: { message: "...", code: "ERROR_CODE" } }
```

## Rules

1. Controllers: validation + response only
2. Services: all business logic
3. Always use `ApiResponse<T>` wrapper
4. Always `next(error)` - never catch and format
5. Zod for all input validation
6. Manual DI in route files

Related Skills

api-endpoint-scaffold

16
from diegosouzapw/awesome-omni-skill

Scaffold new Next.js API endpoints with authentication, rate limiting, and tests. Use when creating new API routes, adding endpoints, or building API features.

api-endpoint-pattern

16
from diegosouzapw/awesome-omni-skill

Standards for creating and organizing HTTP API endpoints using the Echo framework

api-endpoint-generator

16
from diegosouzapw/awesome-omni-skill

Generates CRUD REST API endpoints with request validation, TypeScript types, consistent response formats, error handling, and documentation. Includes route handlers, validation schemas (Zod/Joi), typed responses, and usage examples. Use when building "REST API", "CRUD endpoints", "API routes", or "backend endpoints".

api-endpoint-design

16
from diegosouzapw/awesome-omni-skill

API endpoint design and testing for vehicle insurance data platform. Use when designing new API endpoints, testing existing ones, validating response formats, or debugging API issues. Covers 11 core endpoints including 3 new pie chart distribution endpoints, parameter validation, error handling, and integration patterns.

api-endpoint-creator

16
from diegosouzapw/awesome-omni-skill

Guides standardized REST API endpoint creation following team conventions. Use when creating new API endpoints.

api-endpoint-builder

16
from diegosouzapw/awesome-omni-skill

Build REST API endpoints when designing or implementing API routes with security best practices. Not for client-side fetching or non-API logic.

add-api-endpoint

16
from diegosouzapw/awesome-omni-skill

Create API layer components for a new entity. Includes usecase interactors (internal/usecase/), proto definitions (schema/proto/), gRPC handlers (internal/infrastructure/grpc/), and DI registration. Use when adding CRUD endpoints or Step 3 of CRUD workflow (after add-domain-entity).

Add Admin API Endpoint

16
from diegosouzapw/awesome-omni-skill

Add a new endpoint or endpoints to Ghost's Admin API at `ghost/api/admin/**`.

bgo

10
from diegosouzapw/awesome-omni-skill

Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.

Coding & Development

mcp-create-declarative-agent

16
from diegosouzapw/awesome-omni-skill

Skill converted from mcp-create-declarative-agent.prompt.md

MCP Architecture Expert

16
from diegosouzapw/awesome-omni-skill

Design and implement Model Context Protocol servers for standardized AI-to-data integration with resources, tools, prompts, and security best practices

mathem-shopping

16
from diegosouzapw/awesome-omni-skill

Automatiserar att logga in på Mathem.se, söka och lägga till varor från en lista eller recept, hantera ersättningar enligt policy och reservera leveranstid, men lämnar varukorgen redo för manuell checkout.