api-first

api-first is a skill for Claude Code, Codex from bishopZ/2026-Boilerplate. It costs 32 tokens per session (555 once invoked), scanned A, original, MIT.

A workflow for keeping an OpenAPI file—the documented description of an HTTP API—in sync with the code that uses it, including generated TypeScript types.

In plain words
What is it for?
Use it when adding or changing HTTP API behavior, updating the OpenAPI specification, or regenerating shared API types.
Why use it?
It reduces mismatches between documented endpoints, server responses, and client code.

Skill for Claude CodeCodex

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

Good fit Use it when adding or changing HTTP API behavior, updating the OpenAPI specification, or regenerating shared API types.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bishopz/2026-boilerplate/api-first
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 bishopZ/2026-Boilerplate --skill api-first
Clone the repo
git clone --depth 1 https://github.com/bishopZ/2026-Boilerplate

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 api-first

README.md
[![agentmods](https://agentmods.dev/badge/skills/bishopz/2026-boilerplate/api-first/github.svg)](https://agentmods.dev/skills/bishopz/2026-boilerplate/api-first)
Your own site
<a href="https://agentmods.dev/skills/bishopz/2026-boilerplate/api-first"><img src="https://agentmods.dev/badge/skills/bishopz/2026-boilerplate/api-first/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 api-first

Your own site · 80×15
<a href="https://agentmods.dev/skills/bishopz/2026-boilerplate/api-first"><img src="https://agentmods.dev/badge/skills/bishopz/2026-boilerplate/api-first.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 555 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.00032 $0.00555
Opus 5.5 $0.00013 $0.00222
Sonnet 5.5 $0.00006 $0.00111
Haiku 4.5 $0.00003 $0.00056

Measured 1mo ago against content hash 6725ba927593, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

api-first 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/api-first/SKILL.md · 52 lines

How it starts

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

API-first OpenAPI workflow

Use this skill when a task adds or changes HTTP API behavior, updates docs/openapi.yaml, or adjusts how API types are generated and consumed.

Contract documentation (source of truth)

  • OpenAPI spec: docs/openapi.yaml — human-reviewed contract; keep in sync with Express routes and response shapes.
  • Narrative and conventions: docs/API.md — endpoint inventory, REST rules, migration guidance.

Do not treat generated TypeScript as documentation; treat the YAML + docs/API.md as the contract story.

Generated artifacts (pipeline)

  • Command: npm run gen:api-types
  • Input: docs/openapi.yaml
  • Output: src/generated/api/openapi.generated.ts (openapi-typescript; do not edit)
  • Hand-maintained aliases: src/generated/api/api-types.ts — re-exports friendly names from components['schemas'] for client and server imports.

After any YAML change, run gen:api-types and commit the updated openapi.generated.ts. Update api-types.ts when new schemas need stable export names.

Import paths

  • Prefer @/generated/api/api-types for shared DTOs (path alias @/* → src/*).
  • Never import openapi.generated.ts directly from feature code unless you need path-level types; prefer api-types.ts for schemas.

Tooling

  • Generator: openapi-typescript (devDependency)
  • Lint: openapi.generated.ts is ESLint-ignored (generated noise)

CI / pre-commit

  • Optional: add a CI step that runs npm run gen:api-types and fails if git diff --exit-code shows drift (stops committed spec from diverging from generated output). This boilerplate does not enforce that by default; add when the team wants strict parity checks.

Validation checklist

  • docs/openapi.yaml matches actual routes and status codes
  • npm run gen:api-types succeeds
  • npm run type-check passes
  • docs/API.md and docs/SCRIPTS.md still describe correct paths if you moved files

Done criteria

  • Contract changes are reflected in YAML and regenerated TS.
  • Client/server imports use @/generated/api/api-types (or documented exceptions).
  • No manual edits inside openapi.generated.ts.

Read the full file on GitHub · 52 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 · 52 lines · 32 tokens per session scan A 6725ba927593

Subscribe to this mod's changes

api-first is a skill published in the GitHub repository bishopZ/2026-Boilerplate (24 stars, last pushed 3mo ago), licensed MIT. It adds 32 tokens to every session and 555 once invoked, about $0.0001 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.

Related

Other skills, from other repositories

typescript-expert

Expert-level TypeScript development with modern tooling, advanced types, and best practices. Use this skill for TypeScript projects requiring type-safe code, modern bundling, and comprehensive testing.

personamanagmentlayer/pcl · 40 tokens

bun

Bun all-in-one JavaScript runtime and toolkit reference. Covers runtime APIs (file I/O, HTTP server, SQLite, shell), ultra-fast package manager, built-in bundler with plugins, test runner with mocking, TypeScript support, and Node.js compatibility.

bytesagain/ai-skills · 55 tokens

psl-ast-layers

How to use the PSL syntax tree layers (green tree, red tree, strongly-typed AST classes) correctly. Use for any PSL-related work: PSL interpreters (contract-psl), helpers inside the psl-parser package, the language server, formatters, or anything else that consumes parse() output from @internal/psl-parser.

prisma/orm · 78 tokens

ast-visitor-pattern

Use the frozen-class/visitor pattern for discriminated unions that have multiple dispatch sites. Use when creating a new set of variants (commands, IR nodes, factory calls) that will be switched over in 2+ places, or when refactoring an existing union type that has grown multiple switch sites.

prisma/orm · 65 tokens

no-bare-casts

Writing as in TypeScript or TSX production code, modifying a file that contains a bare as cast, silencing a type error with a cast, encountering as unknown as, or reviewing a cast site.

prisma/orm · 52 tokens

prisma-8

Use when working in a project that depends on @prisma/orm-postgres, @prisma/orm-sqlite, or @prisma/orm-mongo (Prisma 8, formerly Prisma Next): editing contract.prisma or a contract.ts builder, running prisma contract emit, planning or applying migrations, editing migration.ts, writing db.orm / db.sql / db.query…

prisma/orm · 220 tokens