api-endpoint
БесплатноБез исполняемых скриптовНе проверенCreate or modify API endpoints in IdeaForge backend. Triggers: new route, controller, service, repository, CRUD operation, Zod validation, API debugging…
от diegosouzapw★ 68 звёзд на GitHubОб этом скилле
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)
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)
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)
import myRouter from './api/routes/my';
app.use('/api/my-resource', myRouter);
Response Format
// Success
{ success: true, data: { ... } }
// Error (via errorHandler middleware)
{ success: false, error: { message: "...", code: "ERROR_CODE" } }
Rules
- Controllers: validation + response only
- Services: all business logic
- Always use
ApiResponse<T>wrapper - Always
next(error)- never catch and format - Zod for all input validation
- Manual DI in route files
Установить api-endpoint в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл 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.
Как установить скилл api-endpoint?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл api-endpoint запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic