Agent skill
ekoen-backend.doc.route-error
Add HttpErrorRes responses to eKoEN backend routes when controllers can throw errors from app/util/errors/index.ts
Install this agent skill to your Project
npx add-skill https://github.com/shaowei-g/codex-skills/tree/main/skills/ekoen-backend.doc.route-error
SKILL.md
Target repo :ekoen-backend, Route Error Documentation
Use this skill when adding or updating error responses in TSOA controllers under app/rpc/v2/controller/**.
Goal
If a controller method can throw a defined error from app/util/errors/index.ts, document it with TSOA @Response using HttpErrorRes (or HttpErrorRes[] for multiple errors).
Quick Flow
- Identify the controller method(s) that can throw errors (directly or via use case/service).
- Locate the matching error definitions in
app/util/errors/index.ts(namespace inekErr). - Import
HttpErrorResandekErrinto the controller file. - Add
@Responsedecorators above the route method:- Single error:
@Response<HttpErrorRes>('422', error.message, error) - Multiple errors:
@Response<HttpErrorRes[]>('409', 'failed, one of list', [errorA, errorB])
- Single error:
- Use
toHttpResBody()to supply the error examples, consistent with existing controllers.
Controller Example Pattern
import { Response } from 'tsoa';
import { ekErr, type HttpErrorRes } from 'app/util';
const exampleA = new ekErr.EkoEN.SomeError().toHttpResBody();
const exampleB = new ekErr.Api.InvalidArgs().toHttpResBody();
@Response<HttpErrorRes>('422', exampleB.message, exampleB)
@Response<HttpErrorRes[]>('409', 'failed, one of list', [exampleA])
Notes
- Keep error documentation in the controller (presentation layer).
- Do not add new error definitions here—only reference existing ones.
- Prefer consistent HTTP codes defined in
makeError.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.
ekoen-frontend-code-review
Production-grade code review for the eKoEN frontend codebase. Use when asked to review, audit, inspect, or harden eKoEN React/Next.js frontend code, pages, components, hooks, API clients, or state layers for bugs, performance bottlenecks, TypeScript safety issues, request inefficiency, state-management risks, memory leaks, rendering regressions, error-handling gaps, duplication, or maintainability problems, especially when a structured severity-ranked report with code locations, root causes, suggested fixes, and example refactors is required.
conventional-commit-helper
Generate and validate Conventional Commit messages for semantic-release workflows. Use when a user asks to write a commit message, asks to commit changes, asks for commit type/scope selection, or asks to enforce Conventional Commits consistency.
codex-cli-subagent-transport
Use only when native subagent execution is unavailable and the caller needs one deterministic Codex CLI run with repo-local artifacts and a manifest-based result contract.
skill-usage-logger
All skill MUST use this logger to record usage events in NDJSON format.Log Codex skill usage events to NDJSON with safe concurrent appends.
nodejs-package-json
Patch a Node.js project's package.json for standard build automation. Use when asked to add/standardize package.json scripts like prebuild/postbuild for TypeScript builds (rimraf dist + tsc-alias), adjust prebuild for Next.js (rimraf dist .next), or ensure an existing package.json pkg config includes required scripts/assets/targets/outputPath.
Didn't find tool you were looking for?