api-design-rest
Resource-oriented REST/OpenAPI contract design for URI/method semantics, idempotency, pagination, and HTTP status behavior. Trigger when REST contract diffs are detected in paths, methods, schemas, or status semantics, or when request-response transport choice is still unresolved before implementation. Do not use for GraphQL schema authoring, error-taxonomy-only changes, version lifecycle governance, or consumer-provider contract test implementation.
Works with
--- name: api-design-rest description: Resource-oriented REST/OpenAPI contract design for URI/method semantics, idempotency, pagination, and HTTP status behavior. Trigger when REST contract diffs are detected in paths, methods, schemas, or status semantics, or when request-response transport choice is still unresolved before implementation. Do not use for GraphQL schema authoring, error-taxonomy-only changes, version lifecycle governance, or consumer-provider contract test implementation. license: Apache-2.0 --- # API Design REST ## Scope Boundaries - Use when REST resources, URI structures, and HTTP behavior are being designed or changed. - Use proactively when route, method, status, or schema diffs appear in specs, manifests, or source. - Use when request-response transport options are being compared and REST is a candidate. - Do not use for GraphQL-first schema work; use `api-design-graphql`. - Do not use for storage internals; use `db-*`. ## Goal Deliver REST contracts that are stable, predictable, and operationally safe. ## Shared API Contract (Canonical) - Use `references/api-governance-contract.md` as the primary reference for recommended structure. - Optional consistency checks (only if your repository enforces manifest validation): - `python3 scripts/validate_api_contract.py --manifest <path/to/manifest.json>` - Start from valid templates in `assets/`. - Use transport decision reference: - `references/transport-selection-matrix.md` - Use threshold derivation reference: - `references/threshold-derivation-framework.md` - Do not define alternate ID formats, lifecycle states, or compatibility policies locally. ## Implementation Templates - REST OpenAPI template: - `assets/openapi-rest-template.yaml` - Queue/event API template: - `assets/asyncapi-queue-template.yaml` - WebSocket contract template: - `assets/websocket-message-contract-template.yaml` - SSE contract template: - `assets/sse-event-contract-template.yaml` ## Inputs - Product behavior and consumer integration requirements - Resource model candidates and domain invariants - Security, compliance, and SLO constraints - Interaction model candidates (`sync`, `async`, `streaming`, `bidirectional_realtime`) - Transport options (`rest`, `graphql`, `grpc`, `websocket`, `sse`, `queue`) ## Outputs - Resource map and endpoint matrix (`method`, `path`, `status`, `error`) - Request/response schema contract including pagination and filtering rules - Authorization, rate-limit, idempotency, and observability decisions ## Workflow 1. Model resources as nouns and define stable identifiers before endpoint naming. 2. Select interaction mode and primary transport with explicit rationale and rejected alternatives. 3. Define method semantics with explicit idempotency strategy for retry-sensitive writes. 4. Fix status and error semantics so clients can branch without string parsing. 5. Define naming conventions for paths, fields, and error codes. 6. Define authz scope, rate-limit policy, and trace/log fields for every operation class. 7. Derive threshold types and methods (latency, timeout, capacity, concurrency, retry, delivery). 8. Validate backward compatibility and publish deprecation/migration notes when behavior changes. 9. Validate the artifact against the canonical API contract before approval. ## Quality Gates - URI and method choices follow resource-oriented conventions and HTTP semantics. - Contract is backward compatible or includes approved version transition evidence. - Error contract is machine-actionable and trace-correlated. - Authz, rate-limit, and runbook updates are complete and reviewable. - Decision context captures internal/external audience and sync/async/real-time transport rationale. - Threshold derivation methods are explicit and tied to SLO/risk evidence. ## Failure Handling - Stop when URI design leaks internal implementation or method semantics are inconsistent. - Stop when compatibility impact is unknown. - Escalate when required approvers or compliance evidence are missing.
More API Design skills
lark-event
larksuite/cli
Lark/Feishu real-time event listening / subscribing / consuming: stream events as NDJSON via `lark-cli event consume <EventKey>` (covers IM messages/reactions/chat changes, Approval status changes, Task updates, VC meeting started/joined/ended, Minutes generated, Whiteboard updated, etc.). Use for Lark bots, real-time message processing, long-running subscribers, streaming webhook/push handlers. Supports `--max-events` / `--timeout` bounded runs and a stderr ready-marker contract — designed for AI agents running as subprocesses.
lark-contact
larksuite/cli
飞书 / Lark 通讯录:按姓名 / 邮箱解析成 open_id,或按 open_id 反查姓名 / 部门 / 邮箱 / 联系方式 / 个人状态 / 签名,以及按关键词搜索当前用户可见的机器人 / 智能体(agent)。当用户提到一个名字要下一步发消息 / 排日程,或拿到 open_id 想查具体信息时使用。不负责部门树遍历、按部门列员工、组织架构图,这类需求走原生 OpenAPI。
lark-openapi-explorer
larksuite/cli
飞书/Lark 原生 OpenAPI 探索:从官方文档库中挖掘未经 CLI 封装的原生 OpenAPI 接口。当用户的需求无法被现有 lark-* skill 或 lark-cli 已注册命令满足,需要查找并调用原生飞书 OpenAPI 时使用。

