api-contract-draft

A design-writing skill that creates an OpenAPI 3.1 description for a new web API from a feature brief. OpenAPI is a standard format that describes how software sends requests to and receives data from an API.

In plain words
What is it for?
Use it to define API resources, paths, request and response examples, error responses, pagination, idempotency, versioning, and the design decisions behind them.
Why use it?
It makes the API rules clear before implementation begins, so different teams can build against the same contract. It also records key choices about errors, pagination, repeated requests, and versioning.

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/sananthanarayan/skilldrop/api-contract-draft
Any agent
npx skills add sananthanarayan/skilldrop --skill api-contract-draft
Clone the repo
git clone --depth 1 https://github.com/sananthanarayan/skilldrop

Made for: Claude Code, Codex.

Per session 99 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,566 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.00099 $0.01566
Opus 5 $0.00049 $0.00783
Sonnet 5 $0.00020 $0.00313
Haiku 4.5 $0.00010 $0.00157

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

Security

Grade A, and why

api-contract-draft 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 2d 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-contract-draft/SKILL.md · 70 lines

How it starts

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

api-contract-draft

Produces the contract before the code — a valid OpenAPI 3.1 document two teams can argue about and then build against in parallel. The YAML is half the artifact; the other half is the decisions log, because reviewers should debate "cursor vs offset pagination", not line 240. Designs new contracts; documenting an existing API is guide-builder's job.

How to respond

  1. Extract the resources from the brief. Nouns the API owns, their relationships, and their lifecycle (who creates, what mutates, is delete real or soft). Ask at most 2 questions, and spend them on consumer shape ("who calls this — our SPA, partners, both?") and write semantics ("can a refund be requested twice?") — the two answers that change the contract most. Everything else: pick the convention from reference.md and tag the choice [assumption] in the decisions log.

  2. Apply the house conventions (full detail in reference.md) — deviate only when the brief forces it, and log the deviation:

    • Paths: plural-noun resources, no verbs — ✅ POST /refundsPOST /createRefund; nesting one level max, then flatten with filters
    • Errors: RFC 9457 application/problem+json, every 4xx the operation can return enumerated with a stable machine-readable code; no bare unexplained 500
    • Pagination: cursor-based by default (cursor + limit, response carries next_cursor); offset only with a logged reason
    • Idempotency: every unsafe POST takes Idempotency-Key; PUT/DELETE idempotent by construction
    • Versioning: URL major version (/v1/), additive changes don't bump, breaking changes do — the policy sentence goes in the spec's description
    • Auth: a securityScheme exists and every operation declares its requirement — including the explicitly-public ones
  3. Type every field like a reviewer will reject sloppiness. Formats (uuid, date-time, int64), constraints (maxLength, minimum, enum, pattern for codes), required vs optional explicit on every schema, money as integer minor units (never float), timestamps UTC ISO-8601. A schema that's all bare type: string is a draft of a draft.

Read the full file on GitHub · 70 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 2d ago First seen · 70 lines · 99 tokens per session scan A 271f627af5c3

Subscribe to this mod's changes

api-contract-draft is a skill published in the GitHub repository sananthanarayan/skilldrop (2 stars, last pushed 18d ago), licensed MIT. It adds 99 tokens to every session and 1,566 once invoked, about $0.0005 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-31.

Related

Other skills, from other repositories

openlore-plan-refactor

Identify a high-priority refactoring target, assess its blast radius, and write .openlore/refactor-plan.md without changing code. Use when asked to plan or prioritize a refactor.

clay-good/OpenLore · 46 tokens

openlore-brainstorm

Transform a feature idea into an annotated story using a Domain Sketch or Constrained Option Tree. Use when asked to brainstorm, explore, or shape a feature before implementation.

clay-good/OpenLore · 40 tokens

openlore-debug

Debug with OpenLore structural context, an explicit root-cause hypothesis, and RED/GREEN verification. Use when a bug, failure, or regression needs diagnosis and repair.

clay-good/OpenLore · 39 tokens

openlore-execute-refactor

Apply a confirmed .openlore/refactor-plan.md with a test gate after each change. Use when asked to execute or continue an OpenLore refactoring plan.

clay-good/OpenLore · 41 tokens

openlore-analyze-codebase

Run a full static OpenLore analysis and summarize architecture, call graph, refactoring issues, and duplicate code. Use when asked to analyze, map, or assess a codebase without LLM inference.

clay-good/OpenLore · 48 tokens

team-repair

Re-index OKF v0.2 index.md/log.md files, derive CDR.md, rebuild .skills.json and AGENTS.md in team-ai-directives, migrate v0.1→v0.2 frontmatter, scan for rule conflicts, and verify directive freshness. Use when indexes are inconsistent, orphans are detected, after bulk changes, or for periodic team AI directives…

tikalk/adlc-team-skills · 84 tokens