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

Written for no agent in particular: nothing here depends on one. Also seen: mentions Codex.

Good fit Writing API response contracts, standard error handling, pagination envelopes, validation errors, status-code rules, and trace-ID fields.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/j4flmao/agent-skills/api-response
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.

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/github.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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for backend-api-response

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00077 $0.05452
Opus 5.5 $0.00031 $0.02181
Sonnet 5.5 $0.00015 $0.01090
Haiku 4.5 $0.00008 $0.00545

Measured 1mo ago against content hash 1abdead84888, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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. 1mo 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 (33 stars, last pushed 10d ago), licensed MIT. It adds 77 tokens to every session and 5,452 once invoked, about $0.0003 per session on Opus 5.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.