add-api-endpoint

add-api-endpoint is a skill for Claude Code, Codex from tmj-90/gaffer. It costs 64 tokens per session (1,138 once invoked), scanned A, original, Apache-2.0.

A guide for adding or changing an HTTP API endpoint, the URL-based interface that lets software exchange requests and responses.

In plain words
What is it for?
Use it to add routes such as POST /things, expose list data, or add fields to an existing response, including validation, tests, and registration.
Why use it?
It helps keep the new endpoint consistent with the rest of the codebase and prevents malformed requests, incorrect responses, and missing access checks.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to add routes such as POST /things, expose list data, or add fields to an existing response, including validation, tests, and registration.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tmj-90/gaffer/add-api-endpoint
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 tmj-90/gaffer --skill add-api-endpoint
Clone the repo
git clone --depth 1 https://github.com/tmj-90/gaffer

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 add-api-endpoint

README.md
[![agentmods](https://agentmods.dev/badge/skills/tmj-90/gaffer/add-api-endpoint/github.svg)](https://agentmods.dev/skills/tmj-90/gaffer/add-api-endpoint)
Your own site
<a href="https://agentmods.dev/skills/tmj-90/gaffer/add-api-endpoint"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/add-api-endpoint/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 add-api-endpoint

Your own site · 80×15
<a href="https://agentmods.dev/skills/tmj-90/gaffer/add-api-endpoint"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/add-api-endpoint.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 64 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,138 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.
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.00064 $0.01138
Opus 5.5 $0.00026 $0.00455
Sonnet 5.5 $0.00013 $0.00228
Haiku 4.5 $0.00006 $0.00114

Measured 20d ago against content hash a9d4d8854800, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

add-api-endpoint 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 20d 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.

runner/skills/add-api-endpoint/SKILL.md · 76 lines

How it starts

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

Add an API endpoint

An endpoint is a contract: method, path, input schema, status codes, response and error bodies, auth rule, and behaviour under retries and concurrent writes. Copy the repo's conventions, validate at the boundary, and prove each acceptance criterion with a route-level test that exercises that criterion's own behaviour.

Steps

  1. Read the conventions. Call search_lore for the routing style, response envelope, error format, auth pattern, pagination and idempotency rules; honour any ADR. Find a sibling endpoint and copy its registration, handler, schema and test layout. If the repo has an OpenAPI document, update it in the same change (the openapi-contract skill).
  2. Pin the contract before coding. Write down, per AC: method and path, request schema, success status and body, every error status, and who may call it. Use HTTP semantics (RFC 9110):
    • 201 Created + Location for a create; 200 with a body or 204 without.
    • 400 malformed syntax, 422 well-formed but semantically invalid (or the repo's single validation status), 401 unauthenticated, 403 authenticated but not allowed, 404 absent (or hidden from this caller), 409 state conflict, 412 failed If-Match, 429 rate-limited.
    • Never 200 with an error body; never 500 for bad client input.
  3. Validate every input at the boundary with the repo's schema library (Zod, Pydantic, Bean Validation, serde): path, query, headers and body; types, ranges, lengths, enums. Reject unknown fields if the sibling endpoints do. Errors use the repo's envelope; if it has none, use RFC 9457 problem details (application/problem+json, type, title, status, detail, plus a field-level errors list) (the security-input-validation skill).
  4. Authorise the object, not just the route. Check that this caller may act on this specific resource (tenant, owner, role) in the handler or service; filter list queries by the caller's scope (the security-authz skill). Never return fields the caller may not see; build response DTOs explicitly rather than serialising the model.
  5. Keep the handler thin: parse → validate → authorise → call the service → map to the response. Business rules live in the service (the backend-service skill).
  6. Make writes safe under retries and concurrency. POST creates that clients may retry take an idempotency key or rely on a natural unique constraint (the idempotency-and-retries skill). Updates that read then write use a version or ETag/If-Match and return 409/412 on conflict instead of silently overwriting. Anything that writes a shared file or counter follows the concurrency-and-async skill. List endpoints are paginated and bounded (the pagination-and-filtering skill).
  7. Test through the route (the add-integration-test skill), one test per AC that exercises the AC's own behaviour, plus:
    • validation: each rejected input class returns the documented status and error body;
    • authz: unauthenticated → 401, other tenant/owner → 403/404;
    • happy path: status, headers (Location), exact body shape;
    • side effects: the row exists after a create, is unchanged after a rejected request;
    • where the AC involves writes: N concurrent requests to the same resource keep the invariant (no 500, no lost update, one row per idempotency key), built with the concurrency-and-async skill's step 9 recipe.
  8. Run the checks (the run-tests and run-lint skills), then evidence each AC with the record-evidence skill and stop.

Read the full file on GitHub · 76 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. 20d ago Changed · +38 lines a9d4d8854800
  2. 1mo ago First seen · 38 lines · 64 tokens per session scan A 2c8b2610fd41

Subscribe to this mod's changes

add-api-endpoint is a skill published in the GitHub repository tmj-90/gaffer (2 stars, last pushed 20d ago), licensed Apache-2.0. It adds 64 tokens to every session and 1,138 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-31.

Related

Other skills, from other repositories

bulwark-brainstorm

Role-based brainstorming with dual modes: --scoped (sequential Task tool, 5 roles) and --exploratory (Agent Teams peer debate, 4 roles). Use for feasibility assessment and idea validation.

QBall-Inc/the-bulwark · 50 tokens

plan-creation

Create structured implementation plans via a 4-role scrum team (Product Owner, Architect, Eng/Delivery Lead, QA/Critic) with optional Agent Teams peer debate mode.

QBall-Inc/the-bulwark · 38 tokens

anthropic-validator

Validates Claude Code assets (skills, hooks, agents, commands, MCP servers, plugins) against official Anthropic standards. Fetches latest docs dynamically and produces structured validation reports.

QBall-Inc/the-bulwark · 40 tokens

code-review

Comprehensive code review with distinct aspect based sections. Use when reviewing code, checking for security issues, finding type safety problems, auditing code quality, or when user asks to review code, PRs or changes. Three-phase workflow runs static tools, LLM judgment, and writes diagnostic log.

QBall-Inc/the-bulwark · 61 tokens

create-subagent

Generates single-purpose Claude Code sub-agents for use via the Task tool. Use when creating dedicated sub-agents, scaffolding agent definitions, or generating agents with diagnostics and permissions setup.

QBall-Inc/the-bulwark · 42 tokens

test-audit

Audit test suites for T1-T4 violations using AST analysis, mock detection, and multi-stage synthesis. Invoke when user asks to audit tests, check test quality, find mock violations, review test effectiveness, or inspect test suites for over-mocking. Triggers automatic rewrites when quality gates fail.

QBall-Inc/the-bulwark · 0 tokens