api-documentation
API documentation standards and patterns
What this skill does
# API Documentation Skill
Standards for documenting REST and GraphQL APIs.
## REST API Documentation
### Endpoint Format
```markdown
## Endpoint Name
Brief description of what this endpoint does.
**Method:** `GET` | `POST` | `PUT` | `PATCH` | `DELETE`
**Path:** `/api/v1/resource/:id`
**Auth:** Bearer token | API key | None
### Path Parameters
| Parameter | Type | Description |
|-----------|------|-------------|
| id | string | Resource ID |
### Query Parameters
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| page | integer | No | 1 | Page number |
| limit | integer | No | 20 | Items per page |
| sort | string | No | -createdAt | Sort field |
### Request Body
\`\`\`json
{
"field1": "value",
"field2": 123
}
\`\`\`
### Response
**Success (200 OK)**
\`\`\`json
{
"data": { ... },
"meta": { ... }
}
\`\`\`
**Errors**
| Status | Code | Description |
|--------|------|-------------|
| 400 | VALIDATION_ERROR | Invalid input |
| 404 | NOT_FOUND | Resource not found |
```
### Authentication Section
```markdown
# Authentication
All API requests require authentication via one of:
## Bearer Token (Recommended)
\`\`\`bash
curl -H "Authorization: Bearer <token>" https://api.example.com/v1/users
\`\`\`
Tokens expire after 1 hour. Use the refresh token to obtain a new access token.
## API Key
\`\`\`bash
curl -H "X-API-Key: <api-key>" https://api.example.com/v1/users
\`\`\`
API keys don't expire but can be revoked in the dashboard.
## OAuth 2.0
For third-party integrations:
1. Redirect to `/oauth/authorize`
2. User grants permission
3. Receive authorization code
4. Exchange code for tokens
```
### Pagination Documentation
```markdown
# Pagination
List endpoints return paginated results.
## Request Parameters
| Parameter | Type | Default | Max | Description |
|-----------|------|---------|-----|-------------|
| page | integer | 1 | - | Page number (1-indexed) |
| limit | integer | 20 | 100 | Items per page |
## Response Format
\`\`\`json
{
"data": [...],
"pagination": {
"page": 1,
"limit": 20,
"total": 150,
"totalPages": 8,
"hasNext": true,
"hasPrev": false
}
}
\`\`\`
## Cursor-Based Pagination
For large datasets, use cursor pagination:
\`\`\`bash
GET /api/v1/events?cursor=abc123&limit=50
\`\`\`
\`\`\`json
{
"data": [...],
"cursors": {
"next": "def456",
"prev": null
}
}
\`\`\`
```
### Error Documentation
```markdown
# Error Handling
## Error Response Format
All errors return a consistent JSON structure:
\`\`\`json
{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable message",
"details": [
{
"field": "email",
"message": "Invalid email format"
}
],
"requestId": "req_abc123"
}
}
\`\`\`
## Error Codes
### Client Errors (4xx)
| Code | Status | Description | Resolution |
|------|--------|-------------|------------|
| VALIDATION_ERROR | 400 | Invalid input | Check request body |
| UNAUTHORIZED | 401 | No valid credentials | Include auth header |
| FORBIDDEN | 403 | Insufficient permissions | Request access |
| NOT_FOUND | 404 | Resource doesn't exist | Check resource ID |
| CONFLICT | 409 | Resource already exists | Use different values |
| RATE_LIMITED | 429 | Too many requests | Wait and retry |
### Server Errors (5xx)
| Code | Status | Description | Resolution |
|------|--------|-------------|------------|
| INTERNAL_ERROR | 500 | Server error | Contact support |
| SERVICE_UNAVAILABLE | 503 | Maintenance | Retry later |
```
## GraphQL Documentation
### Schema Documentation
```markdown
# GraphQL Schema
## Types
### User
\`\`\`graphql
type User {
"""Unique identifier"""
id: ID!
"""User's email address"""
email: String!
"""Display name"""
name: String
"""Account creation timestamp"""
createdAt: DateTime!
"""User's orders"""
orders(first: Int, after: String): OrderConnection!
}
\`\`\`
### Input Types
\`\`\`graphql
input CreateUserInput {
email: String!
name: String
role: UserRole = USER
}
\`\`\`
```
### Query Documentation
```markdown
## Queries
### user
Fetch a single user by ID.
\`\`\`graphql
query GetUser($id: ID!) {
user(id: $id) {
id
email
name
createdAt
}
}
\`\`\`
**Arguments:**
| Argument | Type | Required | Description |
|----------|------|----------|-------------|
| id | ID | Yes | User ID |
**Example:**
\`\`\`json
{
"id": "usr_123"
}
\`\`\`
**Response:**
\`\`\`json
{
"data": {
"user": {
"id": "usr_123",
"email": "[email protected]",
"name": "John Doe",
"createdAt": "2024-01-15T10:30:00Z"
}
}
}
\`\`\`
```
### Mutation Documentation
```markdown
## Mutations
### createUser
Create a new user account.
\`\`\`graphql
mutation CreateUser($input: CreateUserInput!) {
createUser(input: $input) {
user {
id
email
}
errors {
field
message
}
}
}
\`\`\`
**Input:**
\`\`\`json
{
"input": {
"email": "[email protected]",
"name": "Jane Smith"
}
}
\`\`\`
**Success Response:**
\`\`\`json
{
"data": {
"createUser": {
"user": {
"id": "usr_456",
"email": "[email protected]"
},
"errors": null
}
}
}
\`\`\`
**Error Response:**
\`\`\`json
{
"data": {
"createUser": {
"user": null,
"errors": [
{
"field": "email",
"message": "Email already exists"
}
]
}
}
}
\`\`\`
```
## SDK Examples
### Language-Specific Examples
```markdown
## SDK Examples
### JavaScript/TypeScript
\`\`\`typescript
import { Client } from '@api/sdk'
const client = new Client({ apiKey: 'your-key' })
// List users
const users = await client.users.list({ limit: 10 })
// Create user
const user = await client.users.create({
email: '[email protected]',
name: 'John Doe'
})
\`\`\`
### Python
\`\`\`python
from api_sdk import Client
client = Client(api_key='your-key')
# List users
users = client.users.list(limit=10)
# Create user
user = client.users.create(
email='[email protected]',
name='John Doe'
)
\`\`\`
### cURL
\`\`\`bash
# List users
curl -X GET "https://api.example.com/v1/users?limit=10" \
-H "Authorization: Bearer $API_KEY"
# Create user
curl -X POST "https://api.example.com/v1/users" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"email":"[email protected]","name":"John Doe"}'
\`\`\`
```
## Integration
Used by:
- `api-doc-writer` agent
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.