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.
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
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/api-endpoint/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How api-endpoint Compares
| Feature / Agent | api-endpoint | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/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 filesRelated Skills
api-endpoint-scaffold
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
Standards for creating and organizing HTTP API endpoints using the Echo framework
api-endpoint-generator
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
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
Guides standardized REST API endpoint creation following team conventions. Use when creating new API endpoints.
api-endpoint-builder
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
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
Add a new endpoint or endpoints to Ghost's Admin API at `ghost/api/admin/**`.
bgo
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.
mcp-create-declarative-agent
Skill converted from mcp-create-declarative-agent.prompt.md
MCP Architecture Expert
Design and implement Model Context Protocol servers for standardized AI-to-data integration with resources, tools, prompts, and security best practices
mathem-shopping
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.