Express Api.instructions
--- description: Instructions for building Express REST APIs with TypeScript. applyTo: "**/*.{ts,tsx}" --- # Express API (TypeScript) Instructions ## API Design - Use consistent error shapes (status, code, message, details). - Validate inputs at the boundary (params, query, body). - Prefer explicit HTTP status codes. ## Structure - Keep routing thin; put business logic in services. - Keep DB access behind repositories/adapters. - Avoid global mutable state. ## TypeScript - Avoid `any`. - Use `zod`/`yup` style schemas if already present; otherwise use minimal runtime checks. ## Observability - Log request id / correlation id when available. - Do not log secrets or full request bodies for auth endpoints. ## Testing - Add request-level tests for new endpoints. - Cover auth/permission edge cases.
fill the variables
This prompt has 1 variable. Pro fills them into a ready-to-paste prompt for you — no manual find-and-replace.
{ts,tsx}
Unlock with Pro →when to use it
Community prompt sourced from the open-source GitHub repo ReactSphere/awesome-copilot-agents (MIT). A "Express Api.instructions" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.
tags
codingcommunitydeveloper
source
ReactSphere/awesome-copilot-agents · MIT
more in Coding
Coding✓ tested
Senior code review (strict mode)
senior staff engineer running a merciless but fair review
Coding✓ tested
Debug by hypothesis, not by guessing
debugging partner who forms theories before touching code
Coding✓ tested
Generate tests from described behavior
test engineer who writes tests that would actually catch regressions