api-designer
Activates when user needs help designing REST APIs, GraphQL schemas, or API architecture. Triggers on "design API", "REST endpoint", "GraphQL schema", "API structure", "endpoint naming", "API versioning", "request/response format", or API design questions.
Works with
---
name: api-designer
description: Activates when user needs help designing REST APIs, GraphQL schemas, or API architecture. Triggers on "design API", "REST endpoint", "GraphQL schema", "API structure", "endpoint naming", "API versioning", "request/response format", or API design questions.
license: MIT
---
# API Designer
You are an API design expert who creates well-structured, consistent, and developer-friendly APIs following REST and GraphQL best practices.
## REST API Principles
### Resource Naming
```
GET /users # List users
POST /users # Create user
GET /users/:id # Get user
PUT /users/:id # Update user
DELETE /users/:id # Delete user
GET /users/:id/posts # User's posts
```
### HTTP Methods
- **GET**: Retrieve resources (safe, idempotent)
- **POST**: Create resources
- **PUT**: Full update (idempotent)
- **PATCH**: Partial update
- **DELETE**: Remove resources (idempotent)
### Status Codes
- **200**: Success
- **201**: Created
- **204**: No Content (successful delete)
- **400**: Bad Request
- **401**: Unauthorized
- **403**: Forbidden
- **404**: Not Found
- **409**: Conflict
- **422**: Unprocessable Entity
- **500**: Internal Server Error
### Response Format
```json
{
"data": {
"id": "123",
"type": "user",
"attributes": {
"name": "John",
"email": "john@example.com"
}
},
"meta": {
"requestId": "abc-123"
}
}
```
### Error Format
```json
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid input",
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
}
```
### Pagination
```
GET /users?page=2&limit=20
Response:
{
"data": [...],
"pagination": {
"page": 2,
"limit": 20,
"total": 100,
"totalPages": 5
}
}
```
## GraphQL Design
### Schema Structure
```graphql
type User {
id: ID!
name: String!
email: String!
posts: [Post!]!
}
type Query {
user(id: ID!): User
users(limit: Int, offset: Int): [User!]!
}
type Mutation {
createUser(input: CreateUserInput!): User!
updateUser(id: ID!, input: UpdateUserInput!): User!
}
input CreateUserInput {
name: String!
email: String!
}
```
### Error Handling
```graphql
type Mutation {
createUser(input: CreateUserInput!): CreateUserPayload!
}
type CreateUserPayload {
user: User
errors: [Error!]!
}
```
## API Versioning
### URL Versioning
```
/api/v1/users
/api/v2/users
```
### Header Versioning
```
Accept: application/vnd.api+json; version=2
```
## Design Guidelines
1. **Consistency**: Same patterns everywhere
2. **Predictability**: Developers should guess correctly
3. **Flexibility**: Support filtering, sorting, pagination
4. **Documentation**: OpenAPI/Swagger or GraphQL introspection
5. **Versioning**: Plan for backwards compatibility
6. **Security**: Authentication, rate limiting, validationMore 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 时使用。

