home/coding/express-api-instructions-2

Express Api.instructions

GPTClaudeDeepSeek··1,338 copies·updated 2026-07-14
express-api-instructions-2.prompt
---
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