backend-api-response

backend-api-response is a skill for Claude Code, Codex from j4flmao/agent-skills. It costs 77 tokens per session (5,452 once invoked), scanned A, original, MIT.

A set of instructions for defining consistent responses from web APIs, which are services that applications call over the internet. It covers successful results, errors, validation problems, and paginated lists.

In plain words
What is it for?
Writing API response contracts, standard error handling, pagination envelopes, validation errors, status-code rules, and trace-ID fields.
Why use it?
It prevents different endpoints from returning confusingly different data shapes, error codes, or date formats.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/j4flmao/agent-skills/api-response
Any agent
npx skills add j4flmao/agent-skills --skill api-response
Clone the repo
git clone --depth 1 https://github.com/j4flmao/agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for backend-api-response

README.md
[![agentmods](https://agentmods.dev/badge/skills/j4flmao/agent-skills/api-response.svg)](https://agentmods.dev/skills/j4flmao/agent-skills/api-response)
Your own site
<a href="https://agentmods.dev/skills/j4flmao/agent-skills/api-response"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/api-response.svg" alt="Measured on agentmods" height="20"></a>
Per session 77 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,452 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00077 $0.05452
Opus 5 $0.00039 $0.02726
Sonnet 5 $0.00015 $0.01090
Haiku 4.5 $0.00008 $0.00545

Measured 5d ago against content hash 1abdead84888, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

backend-api-response scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/backend/universal/api-response/SKILL.md · 659 lines

How it starts

The opening of the file, as written. The whole thing — 659 lines — stays where its author put it; the contents beside it link to each section on GitHub.

API Response Design

Purpose

Define and enforce a universal API response contract with standardized envelopes, error codes, and pagination. Every response must be predictable regardless of success or failure.

Agent Protocol

Trigger

User request includes: api response, response envelope, response<T>, api error, exception handling, error code, api contract, pagination response, api standard.

Input Context

  • Current API response format (if refactoring)
  • Technology stack (language/framework)
  • Error handling strategy (exceptions, result types, error codes)
  • Pagination requirements

Output Artifact

A markdown document containing:

  • Response envelope structure (Response with status, data, error, metadata)
  • Error response format (error code, message, details, trace ID)
  • Exception handling strategy (global handler, middleware, filter)
  • Pagination envelope (page, pageSize, totalCount, totalPages)
  • Validation error format (field-level errors)
  • Success response rules (HTTP status codes per operation)

Response Format

Produce the artifact directly. No preamble, no postamble, no explanations. No filler, no hedging, no transitions. Strip articles a/an/the where unambiguous. Compress output. If response format already standardized, output API response standard already defined at: [path]. and stop.

Completion Criteria

  • Envelope structure defined for success, error, validation, pagination
  • Exception-to-response mapping defined for all common exception types
  • HTTP status code mapping defined per operation type
  • Pagination contract defined with required/optional fields

Max Response Length

4096 tokens

Architecture Decision Trees

Response Envelope Style

What is the primary client type?
├── Browser SPA / Mobile app
│   ├── Need minimal payload overhead?
│   │   ├── Yes → Wrapper envelope (success+data+error+meta)
│   │   └── No → Standard envelope with full metadata
│   └── Need GraphQL-style flexibility?
│       ├── Yes → Single endpoint with error array pattern
│       └── No → RESTful per-endpoint envelope
├── Service-to-service (internal)
│   ├── Use OpenAPI-generated clients?
│   │   ├── Yes → Full envelope with requestId for tracing
│   │   └── No → Result type pattern (monads/railway)
└── Third-party / Public API
    ├── Use standard envelope with domain-prefixed error codes
    └── Include rate limit headers in every response

Read the full file on GitHub · 659 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 659 lines · 77 tokens per session scan A 1abdead84888

Subscribe to this mod's changes

backend-api-response is a skill published in the GitHub repository j4flmao/agent-skills (20 stars, last pushed today), licensed MIT. It adds 77 tokens to every session and 5,452 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

nestjs-api-standards

Create standardized API response envelopes, paginated endpoints, and error interceptors in NestJS. Use when implementing response wrappers, pagination DTOs, or global error formats.

FilippoDeSilva/skills · 39 tokens

APIMon

Monitor API endpoints and track response times to catch outages. Use when checking uptime, validating schemas, or generating status reports.

bytesagain/ai-skills · 28 tokens

sandbox-bench

Benchmark React or Next.js changes on Vercel Sandbox VMs with paired A/B statistics: react PR/commit vs base, or Next.js PR/commit vs base, measured end-to-end through the bench/render-pipeline app (rps, latency, p95; TTFB, RSS and document/Flight bytes when the Next side captures them) and, for React changes, through…

vercel/next.js · 212 tokens

v8-jit

V8 JIT optimization patterns for writing high-performance JavaScript in Next.js server internals. Use when writing or reviewing hot-path code in app-render, stream-utils, routing, caching, or any per-request code path. Covers hidden classes / shapes, monomorphic call sites, inline caches, megamorphic deopt, closure…

vercel/next.js · 88 tokens

dce-edge

DCE-safe require() patterns and edge runtime constraints. Use when writing conditional require() calls, guarding Node-only imports (node:stream etc.), or editing define-env-plugin.ts / app-render / stream-utils for edge builds. Covers if/else branching for webpack DCE, TypeScript definite assignment, the NEXTRUNTIME…

vercel/next.js · 84 tokens

nextjs-pages-router

Set up tRPC in Next.js Pages Router with createNextApiHandler, createTRPCNext, withTRPC HOC, SSR via ssr option and ssrPrepass, SSG via createServerSideHelpers with getStaticProps, and server-side helpers for getServerSideProps prefetching.

trpc/trpc · 67 tokens