Logo Api Review

Api Review

Cộng đồng
robbyt
api-review

This skill should be used when reviewing API designs, auditing REST or gRPC endpoints, designing backend APIs, evaluating BFF architecture, or discussing API best practices. Also triggers on: "review this API", "API design review", "is this API correct", "REST API audit", "gRPC API review", "PATCH vs PUT", "etag", "idempotency", "pagination design", "API error handling", "backward compatibility", "BFF architecture", "resource-oriented design", "TOCTOU", "race condition", "optimistic concurrency", "field mask", "long-running operation", "custom method", "soft delete", "API naming conventions", "declarative-friendly"

Tổng quan

Nhà phát hànhrobbyt
Kho mãclaude-skills
Tên kỹ năngapi-review
Sao
42
Bản fork
2
Tệp đi kèm
37
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI là Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 37 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được robbyt công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Api Review trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/robbyt/claude-skills/tree/main/plugins/api-design/skills/api-review
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/robbyt/claude-skills.git /tmp/claude-skills
mkdir -p .claude/skills
cp -r /tmp/claude-skills/plugins/api-design/skills/api-review .claude/skills/api-review
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Api Review trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự tải Api Review ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên Api Review không bị giới hạn ở mô hình mà kỹ năng này được viết cho. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên kỹ năng chưa dùng không tốn chi phí.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

API Design Review

Expert guidance for API design based on Google's API Improvement Proposals (AIPs) — the same standards governing all public Google APIs. These principles are universal and apply to any organization building REST, gRPC, or BFF/backend APIs.

When to Use

Invoke this skill when:

  • Reviewing or auditing API endpoint designs (REST or gRPC)
  • Designing new backend service APIs
  • Evaluating BFF (Backend-for-Frontend) architecture boundaries
  • Resolving concurrency issues (TOCTOU, lost updates, race conditions)
  • Choosing between PATCH and PUT, or standard vs custom methods
  • Designing pagination, filtering, or error handling
  • Assessing backward compatibility of API changes

Always cite the AIP number (e.g., "Per AIP-154, ETags must use ABORTED on mismatch") when providing guidance. This gives teams an authoritative, linkable reference at https://google.aip.dev/{number}.

Query Routing

Match the user's concern to the right reference file:

User asks about...Primary referenceKey AIPs
PUT vs PATCH, partial update, field masksstandard-update.mdAIP-134
Race conditions, lost updates, concurrent edits, ETagsetags-and-freshness.mdAIP-154
Retry safety, duplicate requests, request IDsidempotency.mdAIP-155
Page tokens, cursor pagination, filtering, orderingpagination-and-filtering.mdAIP-158, 160
Breaking changes, backward compatibilitycompatibility.mdAIP-192
Alpha/beta/stable, API versioningversioning-and-stability.mdAIP-180, 181
Error codes, error responses, status detailserrors.mdAIP-193
Auth checks, permission denied vs not foundauthorization.mdAIP-211
BFF anti-patterns, layer boundaries, orchestrationbff-architecture.md--
Secrets, passwords, write-only fieldssensitive-fields.mdAIP-147
Soft delete, undelete, resource expiryresource-lifecycle.mdAIP-164, 216
Async tasks, long-running operationslong-running-operations.mdAIP-151
Recurring tasks, scheduled executionjobs.mdAIP-152
Bulk operations, batch requestsbatch-methods.mdAIP-235
Bulk data import/export, data portabilityimport-and-export.mdAIP-153
Dry run, preview, validate-onlychange-validation.mdAIP-163
Many-to-many, multi-parent resourcesresource-association.mdAIP-124
Field defaults, server-modified valuesserver-modified-values.mdAIP-129
Timestamps, durations, date fieldstime-and-duration.mdAIP-142
Unset vs zero, optional primitivesunset-field-values.mdAIP-149
Naming conventions, enums, standard fieldsnaming-and-fields.mdAIP-140, 148
Required/optional/immutable annotationsfield-behavior.mdAIP-203
Wildcard parent, cross-collection queriescross-collection-reads.mdAIP-159
Singleton resources, config objectssingletons.mdAIP-156
Management vs data planeplanes.mdAIP-111
Desired-state, reconciliation, declarativedeclarative-interfaces.mdAIP-128

Core Principles

These five principles form the foundation of well-designed APIs:

#PrincipleKey AIPsOne-liner
1Resource-oriented designAIP-121, 122, 123Model APIs as resource hierarchies with standard methods
2Business operations, not CRUDAIP-136Expose domain actions, not raw table access
3Idempotent, conflict-aware mutationsAIP-154, 155ETags prevent lost updates; request IDs enable safe retries
4Declarative desired-stateAIP-128Clients send intended state; server reconciles
5Explicit contractsAIP-192, 203Field behavior is documented; breaking changes are caught

Standard Methods Quick Reference

Per AIP-121, every resource should expose standard methods where appropriate:

MethodHTTPAIPNotes
GetGET /v1/{name=...}AIP-131Return single resource
ListGET /v1/{parent=...}/resourcesAIP-132Paginated collection; see AIP-158
CreatePOST /v1/{parent=...}/resourcesAIP-133Include {resource}_id for client-assigned names
UpdatePATCH /v1/{resource.name=...}AIP-134Always PATCH, never PUT; use field masks
DeleteDELETE /v1/{name=...}AIP-135Support etag, force, allow_missing

Custom methods use POST /v1/{name=...}:verb (AIP-136) for operations that don't fit standard methods — e.g., :archive, :merge, :approve.

Decision Tables

PATCH vs PUT (AIP-134)

ScenarioRecommendationRationale
Updating specific fieldsPATCH + field maskAdding fields later won't break existing clients
Full resource replacementPATCH with * maskEquivalent to PUT without the compatibility risk
Legacy system requires PUTDiscouragedDocument risks; plan migration to PATCH

Standard vs Custom Method (AIP-136)

OperationMethodReason
Get a resource by nameStandard GetFits AIP-131 exactly
Search with complex filtersStandard List + filterAIP-132 + AIP-160
Archive a resourceCustom :archiveState change, not a data update (AIP-136)
Merge two resourcesCustom :mergeMulti-resource operation with side effects
Approve a workflow stepCustom :approveDomain action, not a field update

Concurrency Control (AIP-154, AIP-155)

ProblemSolutionAIP
TOCTOU race conditionETags — server returns etag; client sends it back on mutationAIP-154
Lost updates from parallel writesETags — ABORTED (409) on mismatchAIP-154
Network retry causes duplicate creationRequest IDs — UUID4 request_id fieldAIP-155
Client unsure if mutation succeededRequest ID + idempotency — same ID returns same resultAIP-155

BFF Architecture Boundaries

A well-designed architecture separates concerns:

LayerOwnsDoes NOT Own
Frontend + BFFUI rendering, session management, request routing, lightweight response shapingBusiness logic, DB connections, data joins, authorization decisions
Backend APIsBusiness operations, domain logic, data integrity, validation, audit loggingUI concerns, session state, frontend formatting
AuthZ serviceCentralized access control, policy enforcementBusiness logic; answers "is this allowed?" not "what should happen?"

Red flags in BFF code: direct database queries, business rule enforcement, data assembly across multiple sources, independent authorization logic.

Audit Checklist

When reviewing an API, check these categories in order. For full details with examples and fix guidance, consult references/audit-checklist.md.

CRITICAL — Concurrency & Safety

  • Mutable resources include etag field (AIP-154)
  • Mutating endpoints accept request_id for idempotency (AIP-155)
  • Update uses PATCH, not PUT (AIP-134)
  • Delete supports etag for protected delete (AIP-135)

HIGH — Resource Design

  • Resources follow hierarchical naming: {parent}/{collection}/{id} (AIP-122)
  • Standard methods used where applicable (AIP-131–135)
  • Custom methods use :verb suffix, not faux resources (AIP-136)
  • Field behavior annotated (required, optional, output_only, immutable) (AIP-203)

MEDIUM — Usability & Evolution

  • List endpoints paginated with page_size + page_token (AIP-158)
  • Errors use standard codes with structured details (AIP-193)
  • Changes assessed for backward compatibility (AIP-192)
  • Long-running operations return Operation object (AIP-151)

LOW — Polish

  • Filtering uses common expression language (AIP-160)
  • Partial responses supported via field masks (AIP-161)
  • Soft delete available where appropriate (AIP-164)

Reference Files

Consult these for detailed guidance, full AIP text, and code examples:

Resource Design

  • references/resource-oriented-design.md — Resource hierarchies, naming, types, standard methods overview (AIP-121, 122, 123)
  • references/resource-association.md — Many-to-many, multi-parent, canonical parent selection (AIP-124)
  • references/planes.md — Management vs data plane, declarative client requirements, consistency rules (AIP-111)
  • references/singletons.md — Single-instance resources, no Create/Delete, config objects (AIP-156)

Standard Methods

  • references/standard-get-list.md — Get and List methods with pagination, filtering, ordering (AIP-131, 132, 158, 160)
  • references/standard-create.md — Create method, user-specified IDs, long-running create (AIP-133)
  • references/standard-update.md — Update/PATCH method, field masks, etags on update, why not PUT (AIP-134)
  • references/standard-delete.md — Delete method, soft delete, cascading delete, force/allow_missing (AIP-135, 164)

Design Patterns

  • references/etags-and-freshness.md — Optimistic concurrency, TOCTOU prevention, strong vs weak etags (AIP-154)
  • references/idempotency.md — Request IDs, safe retries, UUID4 format (AIP-155)
  • references/custom-methods.md — When and how to use custom methods for business operations (AIP-136)
  • references/declarative-interfaces.md — Desired-state pattern, reconciliation, declarative-friendly resources (AIP-128)
  • references/long-running-operations.md — LRO pattern, metadata, parallel operations, expiration (AIP-151)
  • references/jobs.md — Recurring tasks, Run method, Job vs LRO distinction (AIP-152)
  • references/import-and-export.md — Bulk data movement, inline sources, partial failures (AIP-153)
  • references/change-validation.md — Validate-only / dry-run pattern for previewing mutations (AIP-163)
  • references/cross-collection-reads.md — Wildcard parent reads, unique resource lookup, partial failures (AIP-159, 217)

Fields & Data Handling

  • references/naming-and-fields.md — Field naming conventions, standard fields, enums, standardized codes (AIP-140, 148, 126, 143)
  • references/field-behavior.md — Required, optional, output_only, input_only, immutable annotations (AIP-203)
  • references/server-modified-values.md — Field ownership, effective values, normalization rules (AIP-129)
  • references/time-and-duration.md — Timestamp/Duration/Date types, naming conventions (AIP-142)
  • references/unset-field-values.md — Optional primitives, unset vs default value distinction (AIP-149)
  • references/field-masks.md — Partial update and partial response with FieldMask (AIP-161)
  • references/sensitive-fields.md — Write-only secrets, INPUT_ONLY pattern, obfuscated fields (AIP-147)
  • references/repeated-fields.md — List fields, update strategies (read-modify-write vs Add/Remove), sub-resources (AIP-144)
  • references/partial-responses.md — View enums, field mask parameters, BASIC vs FULL views (AIP-157)
  • references/pagination-and-filtering.md — Page tokens, page size, filter expressions, ordering (AIP-158, 160)
  • references/batch-methods.md — Batch get, create, update, delete patterns (AIP-235)

Lifecycle & Errors

  • references/errors.md — Standard error codes, error details, PERMISSION_DENIED vs NOT_FOUND (AIP-193)
  • references/authorization.md — Auth-before-validation rule, information leakage prevention (AIP-211)
  • references/retry-strategy.md — Retryable vs non-retryable error codes, exponential backoff (AIP-194)
  • references/resource-lifecycle.md — State enums, soft delete/undelete, resource expiry/TTL (AIP-216, 164, 214)
  • references/compatibility.md — Backward compatibility rules, breaking vs non-breaking changes (AIP-192)
  • references/versioning-and-stability.md — Alpha/Beta/Stable levels, major versions, compatibility rules (AIP-180, 181, 185)

Architecture

  • references/bff-architecture.md — BFF layer boundaries, anti-patterns, migration guidance
  • references/http-transcoding.md — HTTP/JSON to gRPC mapping, URI conventions (AIP-127)
  • references/audit-checklist.md — Full audit checklist with severity, examples, and fix patterns

Tệp đi kèm

Mô hình đọc các tệp này khi cần trong lúc kỹ năng được tải. Các tệp được cung cấp ở dạng có thể đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Api Review làm được gì?

This skill should be used when reviewing API designs, auditing REST or gRPC endpoints, designing backend APIs, evaluating BFF architecture, or discussing API best practices. Also triggers on: "review this API", "API design review", "is this API correct", "REST API audit", "gRPC API review", "PATCH vs PUT", "etag", "idempotency", "pagination design", "API error handling", "backward compatibility", "BFF architecture", "resource-oriented design", "TOCTOU", "race condition", "optimistic concurrency", "field mask", "long-running operation", "custom method", "soft delete", "API naming conventions...

Vì sao nên dùng Api Review trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Api Review là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Api Review trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/robbyt/claude-skills/tree/main/plugins/api-design/skills/api-review. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm và cài đặt thành một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Api Review?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Bạn có thể dùng Api Review với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Api Review với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Api Review có miễn phí không?

Kỹ năng này được robbyt phát hành trên GitHub. Hãy xem điều khoản giấy phép trong kho mã. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp cho mô hình các công cụ mới để gọi — mã được chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và tiêu chí của đầu ra tốt. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇