api-patterns

api-patterns is a cursor rule for Cursor from MN-Lizard-Team/aiyu-multi-agent. It costs 24 tokens per session (591 once invoked), scanned A, original, Apache-2.0.

A guide to designing APIs, the interfaces through which software exchanges data and actions. It compares REST, GraphQL, and tRPC and covers responses, pagination, authentication, and documentation.

In plain words
What is it for?
Use it to plan API structure, response formats, authentication, rate limits, versioning, documentation, and API security tests.
Why use it?
It helps you choose an API style and create consistent, maintainable endpoints as the application grows.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: mentions Cursor.

Good fit Use it to plan API structure, response formats, authentication, rate limits, versioning…

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/mn-lizard-team/aiyu-multi-agent/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.

Clone the repo
git clone --depth 1 https://github.com/MN-Lizard-Team/aiyu-multi-agent

Made for: Cursor.

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/rules/mn-lizard-team/aiyu-multi-agent/api-patterns.svg)](https://agentmods.dev/rules/mn-lizard-team/aiyu-multi-agent/api-patterns)
Your own site
<a href="https://agentmods.dev/rules/mn-lizard-team/aiyu-multi-agent/api-patterns"><img src="https://agentmods.dev/badge/rules/mn-lizard-team/aiyu-multi-agent/api-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 591 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.00024 $0.00591
Opus 5 $0.00012 $0.00296
Sonnet 5 $0.00005 $0.00118
Haiku 4.5 $0.00002 $0.00059

Measured 3d ago against content hash 4fa796d631a2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 3d 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.

.cursor/rules/skills/api-patterns.mdc · 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.

Skill: api-patterns

Cursor Agent-Requested Rule — applied when AI determines relevance.


API Patterns

API design principles and decision-making for 2025. 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
rest.md Resource naming, HTTP methods, status codes Designing REST API
response.md Envelope pattern, error format, pagination Response structure
graphql.md Schema design, when to use, security Considering GraphQL
trpc.md TypeScript monorepo, type safety TS fullstack projects
versioning.md URI/Header/Query versioning API evolution planning
auth.md JWT, OAuth, Passkey, API Keys Auth pattern selection
rate-limiting.md Token bucket, sliding window API protection
documentation.md OpenAPI/Swagger best practices Documentation
security-testing.md OWASP API Top 10, auth/authz testing Security audits

Need Skill
API implementation @[skills/backend-development]
Data structure @[skills/database-design]
Security details @[skills/security-hardening]

✅ Decision Checklist

Before designing an API:

  • Asked user about API consumers?
  • Chosen API style for THIS context? (REST/GraphQL/tRPC)
  • Defined consistent response format?
  • Planned versioning strategy?
  • Considered authentication needs?
  • Planned rate limiting?
  • Documentation approach defined?

❌ Anti-Patterns

DON'T:

  • Default to REST for everything
  • Use verbs in REST endpoints (/getUsers)
  • Return inconsistent response formats
  • Expose internal errors to clients
  • Skip rate limiting

Read the full file on GitHub · 85 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. 3d ago First seen · 85 lines · 24 tokens per session scan A 4fa796d631a2

Subscribe to this mod's changes

api-patterns is a cursor rule published in the GitHub repository MN-Lizard-Team/aiyu-multi-agent (7 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 24 tokens to every session and 591 once invoked, about $0.0001 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-09-03.