express-api-contracts

Implements and reviews Express 5 endpoints with validation, authentication, and shared TypeScript contracts.

1|Updated Aug 24, 2026
One-click install
npx skills add https://github.com/danilonovaisv/DAN-IMAGES-PROMPTS-2 --skill express-api-contracts-danilonovaisv
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: express-api-contracts
Source: https://github.com/danilonovaisv/DAN-IMAGES-PROMPTS-2/tree/main/.agents/skills/express-api-contracts
Command: npx skills add https://github.com/danilonovaisv/DAN-IMAGES-PROMPTS-2 --skill express-api-contracts-danilonovaisv

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Express API routes often drift out of sync with their React clients, skip input validation, or mishandle authentication tokens, leading to security gaps and broken contracts. This Skill enforces consistent invariants when implementing or reviewing Express 5 endpoints so server and client stay aligned. ## Core Features & Use Cases - Endpoint Implementation & Review: Guides changes to Express 5 routes while inspecting the affected route and the shared client service layer (src/services/api.ts). - Validation & Security Invariants: Enforces validation of body, params, query, files, and model output, correct handling of Firebase identity tokens versus Google OAuth access tokens, and bounds on uploads and AI request costs. - Contract Compatibility: Ensures error responses stay structured and secret-free, and that any contract change is applied to both server and client together. - Use Case: When adding a new upload endpoint that calls an AI model, use this Skill to validate file size and count limits, verify the correct token type, and update the React client's API service in the same change. ## Quick Start Ask the assistant to implement or review an Express endpoint following the express-api-contracts invariants, including validation, token handling, and the matching client contract update.

Frequently Asked Questions about express-api-contracts

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement an Express 5 endpoint with proper input validation?▼

Validate body, params, query, files, and model output before any domain use, and treat client IDs, MIME types, filenames, and counters as untrusted. This Skill walks the affected route and the shared client API service to keep both sides consistent.

How to keep Express API contracts in sync with a React client?▼

Inspect both the affected route and src/services/api.ts for every change, and either preserve client compatibility or update the server and client contract together. Type-checks and API tests confirm the shared TypeScript contract still holds.

What is the difference between Firebase identity tokens and Google OAuth access tokens?▼

Firebase identity tokens prove user identity to your server, while Google OAuth access tokens authorize calls to Google APIs on the user's behalf. Each trust decision must verify the correct token type rather than treating them interchangeably.

How should Express APIs handle file upload limits securely?▼

Bound JSON payload size, decoded Base64 length, upload count, upload size, and AI request cost before processing. Return structured error responses that exclude secrets, stack traces, full prompts, and image data.

When should an Express route be refactored into separate layers?▼

Extract transport, operation, and persistence responsibilities when a route grows materially. Introducing Firebase, Postgres, or another backend during such work is an architecture migration, not a refactor, and should not be labeled as one.