Api endpoint

From event4u-app/agent-config · View interactive version

Api endpoint is an AI agent skill from the GitHub repository event4u-app/agent-config. Use when creating an API endpoint or HTTP route handler — detects the project stack and routes to the matching carve-out (laravel-api-endpoint, nextjs-patterns, symfony-workflow).

How to use this skill

Skill file

api-endpoint

Grounded corpus: endpoint-shape decisions (pagination, error

shape, idempotency, rate limits) are grounded via the

CODE0 corpus — `node

<skills-root>/corpus-grounding/scripts/ground.mjs search

--manifest <skills-root>/api-design/data/manifest.json "<concern>"`.

When to use

Use this skill when the user asks to create a new API endpoint, REST route, or HTTP handler.

Do NOT use when:

Stack routing

Detect the stack, then hand off to the matching carve-out skill for the framework-specific procedure (file layout, validation primitive, response-shaping convention).

| Detected stack | Carve-out skill |

|---|---|

| Laravel (artisan + composer.json with laravel/framework) | CODE3 |

| Symfony (bin/console + composer.json with symfony/framework-bundle) | CODE3 |

| Next.js (next in package.json) | CODE2 |

| Express / Fastify / NestJS / plain Node | follow project conventions in agents/ + package.json scripts |

| FastAPI / Django / Flask | follow project conventions in agents/ + pyproject.toml |

| Go (net/http, gin, echo, fiber) | follow project conventions in agents/ + go.mod |

| Rust (axum, actix-web, rocket) | follow project conventions in agents/ + Cargo.toml |

If the project doc folder (agents/) has an endpoint-creation guide, that is the source of truth — read it before generating code.

Procedure: Create an API endpoint (stack-neutral)

  1. Read project docs — Check ./agents/ and AGENTS.md for endpoint conventions, routing layout, response shape.
  2. Detect stack and route to the carve-out per the table above.
  3. Plan the endpoint — method, path, request shape, response shape, auth requirement, idempotency.
  4. Create the route registration in the project's routing surface (route file, decorator-annotated handler, file-based router).
  5. Create the request handler / controller — thin; delegate business logic to a service / use-case.
  6. Validate input at the boundary via the framework's validation primitive (FormRequest, Zod, class-validator, Pydantic, struct-tag validators, etc.) — never inline ad-hoc if checks.
  7. Authorize the action via the framework's authz primitive (Policy, voter, guard, middleware, route dependency).
  8. Shape the response through a transformer / serializer / DTO — never return raw ORM entities.
  9. Document the endpoint (OpenAPI annotations / generated spec / project doc).
  10. Verify — run the project type-checker + targeted tests + smoke probe (curl / Bruno / Postman / integration test).

Conventions (apply on every stack)

Stack-specific procedures

For Laravel projects (the most fully-fleshed-out carve-out in this package), see CODE0 — covers single-action controllers, FormRequest, Resource, Policy, CollectionFormRequest, OpenAPI attributes, and the versioned route layout.

For other stacks, read the matching carve-out from the table above and combine with the project's agents/ docs.

Output format

  1. Generated files — route registration, handler, request validator, response shaper, authorization rule.
  2. Test file with happy path and validation-error cases (using the project's test framework).
  3. Summary of created files and their locations.

Gotcha

Do NOT

Auto-trigger keywords

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.