Ling: Skill for Claude Code

.agents/skills/api-patterns/SKILL.md

api-patterns is a skill for Claude Code from MisonL/Ling. It costs 48 tokens per session (1,028 once invoked), scanned A, original, MIT.

A guide to designing application programming interfaces, which let software systems exchange data. It covers REST, GraphQL, and tRPC, along with responses, authentication, limits, and version changes.

In plain words
What is it for?
Selecting REST, GraphQL, or tRPC; naming resources and choosing HTTP methods; designing response and error formats; adding pagination and authentication; limiting traffic; and planning API versions.
Why use it?
It helps choose an API style and make its rules consistent as the software grows. It also addresses common design decisions such as errors, pagination, security, and keeping older clients working.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: installed under .agents/ (shared by several agents).

This is MisonL/Ling's own configuration. It tells Claude Code how to work on Ling itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything Ling configures →

Reuse

Borrowing it

Nothing to install: this file belongs to MisonL/Ling. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/MisonL/Ling/main/.agents/skills/api-patterns/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/MisonL/Ling

Made for: Claude Code.

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/misonl/ling/api-patterns/github.svg)](https://agentmods.dev/skills/misonl/ling/api-patterns)
Your own site
<a href="https://agentmods.dev/skills/misonl/ling/api-patterns"><img src="https://agentmods.dev/badge/skills/misonl/ling/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/misonl/ling/api-patterns"><img src="https://agentmods.dev/badge/skills/misonl/ling/api-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,028 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.00048 $0.01028
Opus 5.5 $0.00019 $0.00411
Sonnet 5.5 $0.00010 $0.00206
Haiku 4.5 $0.00005 $0.00103

Measured 1mo ago against content hash c40bb652d84c, 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 1mo ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/api_validator.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

.agents/skills/api-patterns/SKILL.md · 85 lines

How it starts

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

API Patterns(API 模式)

API design principles and decision-making for 2025(2025 年 API 设计原则与决策逻辑)。 Learn to THINK, not copy fixed patterns(学习如何思考,而非机械复制固定模式)。

选择性阅读规则(Selective Reading Rule)

仅阅读与当前请求相关的文件(Read ONLY files relevant to the request)! 查阅内容地图并定位所需章节(Check the content map, find what you need)。


内容地图(Content Map)

File(文件) Description(描述) When to Read(阅读时机)
api-style.md REST vs GraphQL vs tRPC decision tree(决策树) Choosing API type(选择 API 类型时)
rest.md Resource naming, HTTP methods, status codes(资源命名/HTTP 方法/状态码) Designing REST API(设计 REST API 时)
response.md Envelope pattern, error format, pagination(信封模式/错误格式/分页) Response structure(确定响应结构时)
graphql.md Schema design, when to use, security(模式设计/使用场景/安全性) Considering GraphQL(考虑 GraphQL 时)
trpc.md TypeScript monorepo, type safety(TS 单仓/类型安全) TS fullstack projects(TS 全栈项目)
versioning.md URI/Header/Query versioning(URI/请求头/查询参数版本控制) API evolution planning(规划 API 演进)
auth.md JWT, OAuth, Passkey, API Keys(认证方案) Auth pattern selection(选择认证模式)
rate-limiting.md Token bucket, sliding window(令牌桶/滑动窗口) API protection(API 保护机制)
documentation.md OpenAPI/Swagger best practices(文档规范) Documentation(编写 API 文档)
security-testing.md OWASP API Top 10, auth/authz testing(认证/授权测试) Security audits(安全审计)

Need(需求) Skill(技能)
API implementation(API 落地实现) @[skills/nodejs-best-practices]
Data structure(数据库结构设计) @[skills/database-design]
Security details(安全加固细节) @[skills/vulnerability-scanner]

[OK] 决策检查清单(Decision Checklist)

设计 API 之前(Before designing an API):

  • Asked user about API consumers?(是否询问 API 消费者?)
  • Chosen API style for THIS context?(是否为当前上下文选择 API 风格?) (REST/GraphQL/tRPC)
  • Defined consistent response format?(是否定义统一响应格式?)
  • Planned versioning strategy?(是否规划版本控制策略?)
  • Considered authentication needs?(是否考虑认证需求?)
  • Planned rate limiting?(是否规划频率限制?)
  • Documentation approach defined?(是否定义文档方案?)

Read the full file on GitHub · 85 lines

Files

What ships with it

11 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. 1mo ago First seen · 85 lines · 48 tokens per session scan A c40bb652d84c

Subscribe to this mod's changes

api-patterns is a skill published in the GitHub repository MisonL/Ling (8 stars, last pushed 7mo ago), licensed MIT. It adds 48 tokens to every session and 1,028 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-31.

Related

Other skills, from other repositories

mem0-oss-to-platform

Plan, then execute, a migration of a project from the mem0 open-source / self-hosted SDK (local Memory class) to the mem0 Platform / hosted SDK (MemoryClient). TRIGGER when: the developer wants to move, switch, or migrate mem0 off OSS/self-hosted to the hosted API, e.g. "migrate my mem0 setup to the platform", "switch…

mem0ai/mem0 · 217 tokens

agui-dotnet-protobuf

Use the protobuf wire transport (instead of the default Server-Sent Events) for an AG-UI connection with the AG-UI .NET SDK — a compact binary event stream negotiated via the Accept header. USE FOR: making an AGUIChatClient prefer protobuf by wiring an AGUIEventStreamHandler with ProtobufEventStreamFormatter (then…

ag-ui-protocol/ag-ui · 162 tokens

azure-mgmt-botservice-dotnet

Azure Resource Manager SDK for Bot Service in .NET. Management plane operations for creating and managing Azure Bot resources, channels (Teams, DirectLine, Slack), and connection settings. Triggers: "Bot Service", "BotResource", "Azure Bot", "DirectLine channel", "Teams channel", "bot management .NET", "create bot".

microsoft/skills · 78 tokens

fastapi-router-py

Create FastAPI routers with CRUD operations, authentication dependencies, and proper response models. Use when building REST API endpoints, creating new routes, implementing CRUD operations, or adding authenticated endpoints in FastAPI applications.

microsoft/skills · 46 tokens

dev-runtime

How the Node side of a dev stack runs without haven, and the backend host: pnpm dev (UI built once, backend reloading), pnpm dev:hmr (adds the Vite ui lane), tools/dev-runtime (api + worker in one Node process), backend reload on a file change, the debounce (quiet window + max wait), ports derived from PORT. Use when…

langwatch/langwatch · 172 tokens

api-design

Use when settling the contract of an API you expose, before implementation: resources/URLs, REST vs GraphQL, versioning, one RFC 9457 error envelope, pagination, idempotency — emitted as OpenAPI 3.1. NOT implementing the endpoints (that is fastapi/nestjs/go/nodejs), NOT auth hardening (that is secure-coding), NOT…

ericrisco/rsc-harness · 105 tokens