API Patterns: Making Reusable Design Decisions Between REST, GraphQL, and tRPC

Foreword

Choosing an API interface is often bottlenecked by questions like “Is REST enough?”, “Should we use GraphQL?”, or “Should we adopt tRPC for full-stack TypeScript?”. While documentation highlights the benefits of each, there is often a lack of a decision-making framework that can be repeatedly invoked during conversations for practical implementation. The following introduces the API Patterns (@org-02qudk26/api-patterns) on SkillHub: it organizes design decisions related to REST, GraphQL, and tRPC into an Agent Skill, providing coding assistants with a consistent reference during solution discussions, reviews, and the drafting of interface conventions.

What is this

API Patterns is an enterprise-sourced Skill (enterprise) published by Zhiyu Technology on SkillHub. The current version is 1.0.0, categorized under dev-programming. The official description is: API design decision patterns for REST / GraphQL / tRPC. It does not replace specific framework documentation but rather consolidates common design trade-offs across these three API styles into Skill instructions. This allows Agents supporting SKILL.md to invoke them based on specific scenarios after installation. The page is marked with requires_api_key=false, meaning installation and usage do not require additional API keys.

SkillHub Display Page: https://www.skillhub.cn/skills/org-02qudk26/api-patterns
Skill Metadata Address: https://api.skillhub.cn/org-02qudk26/api-patterns (Direct browser access may return a 405 error; refer to the store page and installation documentation for details.)

Core Features

Based on publicly available information, the verifiable capability boundaries are as follows:

  1. Multi-paradigm Coverage: The Skill explicitly covers design decision patterns for REST, GraphQL, and tRPC. It is suitable for comparison during selection or hybrid architecture design, rather than favoring a single style.
  2. Decision-Oriented: Positioned as “design decision patterns,” it addresses questions such as “which exposure method to choose,” “how to model resources,” and “how to divide boundaries,” rather than serving as a template for single-point code generation.
  3. Agent-Loadable: Following the general SKILL.md ecosystem, once installed into the skills directory of a corresponding Agent, the assistant reads the Skill content during relevant tasks and follows the patterns and constraints within it.

If a more detailed chapter directory or example list is not listed on the public page, it is inappropriate to speculate on the specific number or naming of patterns; refer to the local SKILL.md after installation.

Installation and Activation

The installation process follows the official SkillHub documentation: https://skillhub.cn/install/skillhub.md.

1. Verify SkillHub CLI

First, check if skillhub is available on your local machine:

command -v skillhub && skillhub --version

If not installed, you can perform a complete installation (CLI + default Skills) according to the documentation:

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

If only the CLI is needed:

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash -s -- --cli-only

2. Install to the current Agent’s skills directory

The documentation requires using --dir to point to the skills directory recognized by the current Agent during installation. Otherwise, defaulting to ./skills/ may result in the Skill not being loaded.

The coordinate is @org-02qudk26/api-patterns. In Cursor, the common path is ~/.cursor/skills/:

skillhub install org-02qudk26/api-patterns --dir ~/.cursor/skills/

Other client paths (excerpted from the same installation documentation, select based on your actual environment):

  • Claude Code: ~/.claude/skills/
  • Codex: ~/.codex/skills/ or .agents/skills/ under the project
  • Gemini CLI: ~/.gemini/skills/

After installation, restart or refresh the Agent according to the respective client’s instructions to enable the new Skill.

3. Let AI install via natural language (Optional)

The prompt provided on the SkillHub skill page is: Ask the AI to install @org-02qudk26/api-patterns based on https://skillhub.cn/install/skillhub.md. This is suitable for scenarios where the CLI is not configured, but you wish for the assistant to complete the installation steps on your behalf.

Typical Usage

No complete conversation samples were provided in the public data, but the reproducible usage is as follows.

After installation and activation via CLI, explicitly reference the Skill in tasks related to interface design, for example:

  • “We need to provide user and order data externally to Web and mobile clients. Please compare the trade-offs between REST and GraphQL and provide a recommendation based on the installed API Patterns Skill.”
  • “The existing service is a Node + TypeScript monolith, and we plan to share types between frontend and backend. Please evaluate whether to introduce tRPC based on the API Patterns Skill and list the boundary conditions.”

If installed without specifying --dir, the Skill may not be within the Agent’s search path. If the assistant does not reflect the Skill content, first verify that the installation directory matches the current client.

Applicable Scenarios & Notes

Who is it for

  • Small teams or independent developers making architectural or interface layer selections between REST, GraphQL, and tRPC.
  • Those who want to solidify API design discussions into Agent workflows, reducing the need to research from scratch every time and minimizing inconsistencies.
  • Toolchains using Cursor, Claude Code, Codex, etc., that support project-level or user-level skills directories.

Limitations and Notes

  • Rating and download counts are subject to real-time display on the SkillHub page (at the time of capture, the page showed a rating of 100000 and 1321 downloads; if the numbers in the clues are inconsistent, refer to the store page).
  • The source is enterprise; updates and licensing in enterprise scenarios are subject to SkillHub and the publisher’s instructions.
  • This Skill provides decision patterns and constraints; it cannot replace security reviews, performance stress testing, or specific deliverables like OpenAPI / Schemas. Review according to team standards before going live.
  • The metadata URL on api.skillhub.cn is not suitable as a manual browsing entry; rely primarily on the skillhub CLI and https://www.skillhub.cn/skills/org-02qudk26/api-patterns for installation and retrieval.

Conclusion

API Patterns consolidates design decisions for REST, GraphQL, and tRPC into an installable Agent Skill, suitable for unifying interface selection and design standards within coding assistant sessions. Installation coordinates: @org-02qudk26/api-patterns, Version 1.0.0, Official Introduction Page: https://www.skillhub.cn/skills/org-02qudk26/api-patterns.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye