Skills directory
BackendEssential5-point gate · Node / API · Python · Any stack

The honest API contract

Typed boundaries, one error envelope, no lying 200s.

Use this when

200 with { error } inside

A different error shape per endpoint

Retry logic 'to be added later'

The quality gate

  • Every endpoint has a typed request/response schema validated at the boundary
  • One error envelope everywhere: code, human message, correlation id
  • Status codes tell the truth — no 200 with { error } inside
  • Mutations are idempotent or explicitly guarded against replay
  • Timeouts, retries, and rate limits exist and are written down

Prove it: Send malformed input to every endpoint — every response uses the one envelope and an honest status code.

Install or copy

Save the download as honest-api/SKILL.md in your agent's supported skills directory, or copy the complete package below. Load it only when its description matches the work.

Portable SKILL.md
---
name: honest-api
description: "Applies “The honest API contract” as a repeatable product-quality gate. Use during backend work when typed boundaries, one error envelope, no lying 200s."
---

# The honest API contract

Apply this skill during **Backend** work. It supports Node / API, Python, Any stack.

Typed boundaries, one error envelope, no lying 200s.

## Instructions

Every API boundary validates input against a schema and rejects loudly — never trust the client. Responses use one consistent envelope; errors carry a machine code, a human-readable message, and a correlation id. Status codes must be honest: no 200-with-error-body, no silent catch-and-continue. Make mutations idempotent (idempotency keys or natural idempotence) and state the timeout/retry policy for every outbound call. If a failure path isn't handled, fail fast and visibly rather than guessing.

## Detect the problem

- 200 with { error } inside
- A different error shape per endpoint
- Retry logic 'to be added later'

## Hold the gate

Do not declare this phase complete until every item passes:

- [ ] Every endpoint has a typed request/response schema validated at the boundary
- [ ] One error envelope everywhere: code, human message, correlation id
- [ ] Status codes tell the truth — no 200 with { error } inside
- [ ] Mutations are idempotent or explicitly guarded against replay
- [ ] Timeouts, retries, and rate limits exist and are written down

## Verify the result

Send malformed input to every endpoint — every response uses the one envelope and an honest status code.

More backend skills

Want this quality gate applied to a real product decision?

Start a First Loop