api-patterns

api-patterns is a skill for Claude Code from softspark/ai-toolkit. It costs 52 tokens per session (3,396 once invoked), scanned A, original, Apache-2.0.

Guidance for designing REST and GraphQL APIs, which let software systems exchange data over the web, including their names, versions, responses, and errors.

In plain words
What is it for?
Use it when defining routes, HTTP status codes, pagination, idempotency, rate limits, and OpenAPI documentation.
Why use it?
It helps teams make API behaviour consistent and predictable as the service grows or clients make repeated and large requests.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the ai-toolkit plugin — 115 skills, 44 agents, 14 hooks shipped together

Good fit Use it when defining routes, HTTP status codes, pagination, idempotency, rate limits, and OpenAPI documentation.

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

Made for: Claude Code.

Or install ai-toolkit, the plugin that ships this one along with the rest of its 115 skills, 44 agents, 14 hooks.

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-patterns

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/softspark/ai-toolkit/api-patterns"><img src="https://agentmods.dev/badge/skills/softspark/ai-toolkit/api-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,396 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 warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Tool Misuse · line 24
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
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.00052 $0.03396
Opus 5.5 $0.00021 $0.01358
Sonnet 5.5 $0.00010 $0.00679
Haiku 4.5 $0.00005 $0.00340

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

Security

Grade A, and why

api-patterns 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 2mo 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.

app/skills/api-patterns/SKILL.md · 437 lines

How it starts

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

API Patterns Skill

REST API Design

Resource Naming

# Collection
GET    /api/v1/documents        # List documents
POST   /api/v1/documents        # Create document

# Single resource
GET    /api/v1/documents/{id}   # Get document
PUT    /api/v1/documents/{id}   # Replace document
PATCH  /api/v1/documents/{id}   # Update document
DELETE /api/v1/documents/{id}   # Delete document

# Nested resources
GET    /api/v1/users/{id}/documents  # User's documents

HTTP Status Codes

Code Meaning When to Use
200 OK Successful GET/PUT/PATCH
201 Created Successful POST
204 No Content Successful DELETE
400 Bad Request Malformed request or an established domain refusal
401 Unauthorized Missing/invalid auth
403 Forbidden No permission
404 Not Found Resource doesn't exist
405 Method Not Allowed Unsupported method; preserve Allow
409 Conflict Duplicate resource or current-state conflict
412 Precondition Failed Supplied concurrency version is stale
422 Unprocessable Validation error
428 Precondition Required Required concurrency precondition is missing
429 Too Many Requests Rate limited
500 Internal Error Server error
503 Service Unavailable Dependency temporarily unavailable

Response Format

Follow the host's existing resource and collection contract. This envelope is illustrative; do not impose it on a framework that already defines another shape.

{
  "data": {
    "id": "123",
    "type": "document",
    "attributes": {
      "title": "Example",
      "content": "..."
    }
  },
  "meta": {
    "total": 100,
    "page": 1,
    "per_page": 10
  }
}

Error Response

Use the established error representation, which may be problem details, framework validation errors, or a domain-specific envelope like this example:

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid input",
    "details": [
      {"field": "title", "message": "Title is required"},
      {"field": "limit", "message": "Must be between 1 and 100"}
    ]
  }
}

Read the full file on GitHub · 437 lines

Files

What ships with it

1 file 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. 2mo ago Changed · +26 lines · +4 tokens per session 83362ca5b0ec
  2. 3mo ago First seen · 411 lines · 48 tokens per session scan A f28df25626ea

Subscribe to this mod's changes

api-patterns is a skill published in the GitHub repository softspark/ai-toolkit (180 stars, last pushed 12d ago), licensed Apache-2.0. It adds 52 tokens to every session and 3,396 once invoked, about $0.0002 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

api-patterns compared with skills from other repositories

api-patterns next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
api-patternssoftspark/ai-toolkitSkill18012d agoApache-2.0A52Claude Code
plugin-systemellmos-ai/skillsSkill10yesterdayMITA99Claude Code, Codex
api-designjohnqtcg/awesome-skillsSkill311mo agoMITA123Claude Code, Codex
kafka-event-driven-designjohnqtcg/awesome-skillsSkill311mo agoMITA191Claude Code, Codex
thirdparty-api-integration-testjohnqtcg/awesome-skillsSkill311mo agoMITA47Claude Code
message-protocolkhalilbenaz/claude-skills-collectionSkill273mo agoMITA90Claude Code, Codex
tool-calling-architectkhalilbenaz/claude-skills-collectionSkill273mo agoMITA96Claude Code, Codex