ワンクリックで
loom-api-design
Designs RESTful APIs, GraphQL schemas, and RPC interfaces for consistency, usability, and scalability. Use when defining endpoints, resource models, HTTP semantics, pagination, versioning, or RPC service contracts.
メニュー
Designs RESTful APIs, GraphQL schemas, and RPC interfaces for consistency, usability, and scalability. Use when defining endpoints, resource models, HTTP semantics, pagination, versioning, or RPC service contracts.
REQUIRED skill for creating Loom execution plans. Designs DAG-based plans with mandatory knowledge-bootstrap and integration-verify bookends, parallel subagent execution within stages, and concurrent worktree stages for maximum throughput.
Web accessibility patterns, WCAG compliance, and inclusive design. Use when implementing accessible UI, keyboard navigation, screen reader support, focus management, semantic HTML, ARIA patterns, or auditing for compliance.
Document REST APIs with OpenAPI/Swagger specifications, endpoint references, authentication flows, error handling, and SDK guides. Use for API reference docs, Swagger specs, interactive explorers, and client library documentation.
GitOps continuous delivery with Argo CD for Kubernetes. Use when implementing declarative GitOps workflows, application sync/rollback, multi-cluster deployments, progressive delivery, or CD automation.
Authentication and authorization patterns including OAuth2, JWT, RBAC/ABAC, session management, API keys, password hashing, and MFA. Use for login flows, access control, identity management, tokens, permissions, and API key authentication. Do not use for vulnerability scanning (use loom-security-scan), audits (loom-security-audit), or threat modeling (loom-threat-model).
Background job processing patterns including job queues, scheduled jobs, worker pools, retry strategies, and delivery guarantees. Use when implementing async processing, ETL pipelines, ML training jobs, cron schedules, or dead letter queues.
| name | loom-api-design |
| description | Designs RESTful APIs, GraphQL schemas, and RPC interfaces for consistency, usability, and scalability. Use when defining endpoints, resource models, HTTP semantics, pagination, versioning, or RPC service contracts. |
| allowed-tools | ["Read","Grep","Glob","Edit","Write"] |
| triggers | ["api design","REST","RESTful","REST API","GraphQL","GraphQL schema","gRPC","OpenAPI","Swagger","endpoint","route","resource","CRUD","HTTP method","GET","POST","PUT","PATCH","DELETE","status code","pagination","filtering","sorting","versioning","HATEOAS","API versioning","schema design","RPC","service design"] |
This skill guides the design of well-structured APIs that are intuitive, consistent, and scalable. It covers REST, GraphQL, and gRPC patterns with focus on developer experience and long-term maintainability.
/users, not /getUsers?status=active&sort=-created_at)/v1/users, /v2/users (explicit, simple, cacheable)API-Version: 2 or Accept: application/vnd.api.v2+json (cleaner URLs)?version=2 (fallback option, less recommended)# OpenAPI 3.0 Specification
openapi: 3.0.0
info:
title: E-Commerce API
version: 1.0.0
paths:
/products:
get:
summary: List all products
parameters:
- name: category
in: query
schema:
type: string
- name: min_price
in: query
schema:
type: number
- name: page
in: query
schema:
type: integer
default: 1
- name: per_page
in: query
schema:
type: integer
default: 20
maximum: 100
responses:
"200":
description: Paginated list of products
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: "#/components/schemas/Product"
pagination:
$ref: "#/components/schemas/Pagination"
post:
summary: Create a new product
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ProductInput"
responses:
"201":
description: Product created
"400":
description: Validation error
/products/{id}:
get:
summary: Get a specific product
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
"200":
description: Product details
"404":
description: Product not found
type Query {
"""
Fetch a user by ID
"""
user(id: ID!): User
"""
List users with optional filtering
"""
users(filter: UserFilter, first: Int = 20, after: String): UserConnection!
}
type Mutation {
"""
Create a new user account
"""
createUser(input: CreateUserInput!): CreateUserPayload!
"""
Update an existing user
"""
updateUser(id: ID!, input: UpdateUserInput!): UpdateUserPayload!
}
type User {
id: ID!
email: String!
name: String!
createdAt: DateTime!
orders(first: Int, after: String): OrderConnection!
}
input CreateUserInput {
email: String!
name: String!
password: String!
}
type CreateUserPayload {
user: User
errors: [UserError!]!
}
type UserError {
field: String
message: String!
code: UserErrorCode!
}
syntax = "proto3";
package ecommerce.v1;
import "google/protobuf/timestamp.proto";
service ProductService {
// Fetch a single product by ID
rpc GetProduct(GetProductRequest) returns (GetProductResponse);
// List products with filtering and pagination
rpc ListProducts(ListProductsRequest) returns (ListProductsResponse);
// Create a new product
rpc CreateProduct(CreateProductRequest) returns (CreateProductResponse);
// Update an existing product
rpc UpdateProduct(UpdateProductRequest) returns (UpdateProductResponse);
// Delete a product
rpc DeleteProduct(DeleteProductRequest) returns (DeleteProductResponse);
}
message Product {
string id = 1;
string name = 2;
string description = 3;
int64 price_cents = 4;
string category = 5;
google.protobuf.Timestamp created_at = 6;
google.protobuf.Timestamp updated_at = 7;
}
message ListProductsRequest {
// Optional category filter
string category = 1;
// Minimum price filter (in cents)
optional int64 min_price_cents = 2;
// Maximum number of items to return
int32 page_size = 3;
// Page token from previous response
string page_token = 4;
}
message ListProductsResponse {
repeated Product products = 1;
string next_page_token = 2;
int32 total_count = 3;
}
message CreateProductRequest {
string name = 1;
string description = 2;
int64 price_cents = 3;
string category = 4;
}
message CreateProductResponse {
Product product = 1;
}
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Request validation failed",
"details": [
{
"field": "email",
"code": "INVALID_FORMAT",
"message": "Email must be a valid email address"
},
{
"field": "age",
"code": "OUT_OF_RANGE",
"message": "Age must be between 18 and 120"
}
],
"request_id": "req_abc123xyz",
"documentation_url": "https://api.example.com/docs/errors#VALIDATION_ERROR"
}
}
# Request with API version header
GET /users/123 HTTP/1.1
Host: api.example.com
Accept: application/vnd.api.v2+json
Authorization: Bearer eyJ...
# Response includes deprecation warning
HTTP/1.1 200 OK
Content-Type: application/vnd.api.v2+json
Sunset: Sat, 31 Dec 2026 23:59:59 GMT
Deprecation: true
Link: <https://api.example.com/v3/users/123>; rel="successor-version"
{
"id": "123",
"email": "user@example.com",
"name": "John Doe"
}