agentleFS
GhostekenGhosteken/agent-harness/skills/api-patterns/SKILL.md

api-patterns

Skill2 starsChanged 41 days agoMITView on GitHub

API design principles and decision-making. REST vs GraphQL vs tRPC selection, response formats, versioning, pagination.

14 other projects use a version of this, 10 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use intelligent-routing, nextjs-react-expert and 6 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • SKB3002Skill

    intelligent-routing

    Automatic agent selection and intelligent task routing. Analyzes user requests and automatically selects the best specialist agent(s) without requiring explicit user mentions.

    Also in 5 projects that use this

  • SKB3002Skill

    nextjs-react-expert

    React and Next.js performance optimization from Vercel Engineering. Use when building React components, optimizing performance, eliminating waterfalls, reducing bundle size, reviewing code for performance issues, or implementing server/client-side optimizations.

    Also in 3 projects that use this

  • xfstudioSkill

    rust-pro

    Master Rust 1.75+ with modern async patterns, advanced type system

    Also in 5 projects that use this

  • atuljha23Skill

    migration-patterns

    Safe schema-migration patterns for systems under live traffic — expand/contract, backfill, double-write, shadow-read, online DDL. Use when authoring, reviewing, or sequencing a migration that can't take a maintenance window.

    Also in 3 projects that use this

  • jornalistainclusivoSkill

    design-spec

    How to author a DESIGN.md file — the machine-readable design-token + human-rationale format that must exist before any UI is built. YAML front-matter token schema (colors, typography, spacing, rounded, components), type system, token references, and canonical section order.

    Also in 3 projects that use this

  • zzfancitizenSkill

    verify-changes

    Verify code changes do not break the project by running tests, linter checks, and import validation. Use after making any code changes, editing Python files, modifying imports, updating dependencies, or refactoring.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

9 rules. 6 are common, 3 are distinctive, and 0 are very specific to this project.

  • 6

    Common

    Most of the 14 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Common:

    Read ONLY files relevant to the request!: Check the content map, find what you need.

    line 13
  2. Common:

    Before designing an API:

    line 46
  3. Common:

    Default to REST for everything

    line 61
  4. Common:

    Use verbs in REST endpoints (/getUsers)

    line 62
  5. Common:

    Ask about client requirements

    line 69
  6. Common:

    Use appropriate status codes

    line 71
  7. Distinctive:

    Use this skill only when the task clearly matches the scope described above.

    line 85
  8. Distinctive:

    Do not treat the output as a substitute for environment-specific validation, testing, or expert review.

    line 86
  9. Distinctive:

    Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

    line 87

“Common” is measured: kept by at least 6 in 10 of the 14 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

FileDescriptionWhen to Read
api-style.mdREST vs GraphQL vs tRPC decision treeChoosing API type
rest.mdResource naming, HTTP methods, status codesDesigning REST API
response.mdEnvelope pattern, error format, paginationResponse structure
graphql.mdSchema design, when to use, securityConsidering GraphQL
trpc.mdTypeScript monorepo, type safetyTS fullstack projects
versioning.mdURI/Header/Query versioningAPI evolution planning
auth.mdJWT, OAuth, Passkey, API KeysAuth pattern selection
rate-limiting.mdToken bucket, sliding windowAPI protection
documentation.mdOpenAPI/Swagger best practicesDocumentation
security-testing.mdOWASP API Top 10, auth/authz testingSecurity audits

🔗 Related Skills

NeedSkill
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

DO:

  • Choose API style based on context
  • Ask about client requirements
  • Document thoroughly
  • Use appropriate status codes

Script

ScriptPurposeCommand
scripts/api_validator.pyAPI endpoint validationpython scripts/api_validator.py <project_path>

When to Use

This skill is applicable to execute the workflow or actions described in the overview.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.