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

Stars 0
Forks 0

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

  1. Identify the controller method(s) that can throw errors (directly or via use case/service).
  2. Locate the matching error definitions in app/util/errors/index.ts (namespace in ekErr).
  3. Import HttpErrorRes and ekErr into the controller file.
  4. Add @Response decorators above the route method:
    • Single error: @Response<HttpErrorRes>('422', error.message, error)
    • Multiple errors: @Response<HttpErrorRes[]>('409', 'failed, one of list', [errorA, errorB])
  5. Use toHttpResBody() to supply the error examples, consistent with existing controllers.

Controller Example Pattern

ts
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.

Expand your agent's capabilities with these related and highly-rated skills.

shaowei-g/codex-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.

0 0
Explore
shaowei-g/codex-skills

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.

0 0
Explore
shaowei-g/codex-skills

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.

0 0
Explore
shaowei-g/codex-skills

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.

0 0
Explore
shaowei-g/codex-skills

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.

0 0
Explore
shaowei-g/codex-skills

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.

0 0
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results