xiaohongshu
xiaohongshu
api-spec
API仕様書作成エージェント。OpenAPI/Swagger形式のAPI定義、リクエスト/レスポンス仕様、認証仕様を作成。キーワード: API仕様, api spec, OpenAPI, Swagger, REST API, エンドポイント.
Full skill instructions
RESTful APIの仕様書をOpenAPI形式で作成します。
docs/api/
├── openapi.yaml # メインOpenAPI定義
├── schemas/ # スキーマ定義
│ ├── user.yaml
│ ├── order.yaml
│ └── common.yaml
├── paths/ # エンドポイント定義
│ ├── auth.yaml
│ ├── users.yaml
│ └── orders.yaml
└── examples/ # リクエスト/レスポンス例
├── user-examples.yaml
└── order-examples.yaml
openapi: 3.0.3
info:
title: [プロジェクト名] API
description: |
[プロジェクトの説明]
## 認証
Bearer Tokenによる認証を使用します。
`Authorization: Bearer <token>` ヘッダーを付与してください。
version: 1.0.0
contact:
name: API Support
email: [email protected]
servers:
- url: https://api.example.com/v1
description: Production
- url: https://api.staging.example.com/v1
description: Staging
- url: http://localhost:8000/v1
description: Development
tags:
- name: auth
description: 認証関連
- name: users
description: ユーザー管理
- name: orders
description: 注文管理
security:
- bearerAuth: []
paths:
$ref: './paths/_index.yaml'
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
schemas:
$ref: './schemas/_index.yaml'
responses:
BadRequest:
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
Unauthorized:
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
NotFound:
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/users:
get:
tags:
- users
summary: ユーザー一覧取得
description: 登録されているユーザーの一覧を取得します
operationId: getUsers
parameters:
- name: page
in: query
description: ページ番号
schema:
type: integer
default: 1
minimum: 1
- name: limit
in: query
description: 1ページあたりの件数
schema:
type: integer
default: 20
minimum: 1
maximum: 100
- name: status
in: query
description: ステータスでフィルタ
schema:
type: string
enum: [active, inactive, suspended]
responses:
'200':
description: 成功
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '../schemas/user.yaml#/User'
pagination:
$ref: '../schemas/common.yaml#/Pagination'
'401':
$ref: '../openapi.yaml#/components/responses/Unauthorized'
post:
tags:
- users
summary: ユーザー作成
description: 新規ユーザーを作成します
operationId: createUser
security: [] # 認証不要
requestBody:
required: true
content:
application/json:
schema:
$ref: '../schemas/user.yaml#/CreateUserRequest'
example:
email: [email protected]
password: SecurePass123!
name: 山田太郎
responses:
'201':
description: 作成成功
content:
application/json:
schema:
$ref: '../schemas/user.yaml#/User'
'400':
$ref: '../openapi.yaml#/components/responses/BadRequest'
'409':
description: メールアドレス重複
content:
application/json:
schema:
$ref: '../schemas/common.yaml#/Error'
/users/{userId}:
get:
tags:
- users
summary: ユーザー詳細取得
operationId: getUser
parameters:
- name: userId
in: path
required: true
description: ユーザーID
schema:
type: string
format: uuid
responses:
'200':
description: 成功
content:
application/json:
schema:
$ref: '../schemas/user.yaml#/User'
'404':
$ref: '../openapi.yaml#/components/responses/NotFound'
put:
tags:
- users
summary: ユーザー更新
operationId: updateUser
parameters:
- name: userId
in: path
required: true
schema:
type: string
format: uuid
requestBody:
required: true
content:
application/json:
schema:
$ref: '../schemas/user.yaml#/UpdateUserRequest'
responses:
'200':
description: 更新成功
content:
application/json:
schema:
$ref: '../schemas/user.yaml#/User'
delete:
tags:
- users
summary: ユーザー削除
operationId: deleteUser
parameters:
- name: userId
in: path
required: true
schema:
type: string
format: uuid
responses:
'204':
description: 削除成功
User:
type: object
properties:
id:
type: string
format: uuid
description: ユーザーID
example: 550e8400-e29b-41d4-a716-446655440000
email:
type: string
format: email
description: メールアドレス
example: [email protected]
name:
type: string
description: 表示名
example: 山田太郎
status:
type: string
enum: [active, inactive, suspended]
description: ステータス
example: active
createdAt:
type: string
format: date-time
description: 作成日時
updatedAt:
type: string
format: date-time
description: 更新日時
required:
- id
- email
- name
- status
- createdAt
- updatedAt
CreateUserRequest:
type: object
properties:
email:
type: string
format: email
description: メールアドレス
maxLength: 255
password:
type: string
format: password
description: パスワード(8文字以上、英数字記号混在)
minLength: 8
maxLength: 100
name:
type: string
description: 表示名
minLength: 1
maxLength: 100
required:
- email
- password
- name
UpdateUserRequest:
type: object
properties:
name:
type: string
minLength: 1
maxLength: 100
status:
type: string
enum: [active, inactive]
Error:
type: object
properties:
error:
type: object
properties:
code:
type: string
description: エラーコード
example: "2001"
message:
type: string
description: エラーメッセージ
example: "Validation failed"
details:
type: array
items:
type: object
properties:
field:
type: string
message:
type: string
traceId:
type: string
description: トレースID
example: "abc123-def456"
Pagination:
type: object
properties:
page:
type: integer
description: 現在のページ
example: 1
limit:
type: integer
description: 1ページあたりの件数
example: 20
totalItems:
type: integer
description: 総件数
example: 100
totalPages:
type: integer
description: 総ページ数
example: 5
| パターン | 用途 | 例 |
|---|---|---|
| GET /resources | 一覧取得 | GET /users |
| GET /resources/{id} | 詳細取得 | GET /users/123 |
| POST /resources | 作成 | POST /users |
| PUT /resources/{id} | 全体更新 | PUT /users/123 |
| PATCH /resources/{id} | 部分更新 | PATCH /users/123 |
| DELETE /resources/{id} | 削除 | DELETE /users/123 |
| コード | 用途 |
|---|---|
| 200 | 成功(GET, PUT, PATCH) |
| 201 | 作成成功(POST) |
| 204 | 成功・レスポンスなし(DELETE) |
| 400 | バリデーションエラー |
| 401 | 認証エラー |
| 403 | 認可エラー |
| 404 | リソース未発見 |
| 409 | 競合(重複など) |
| 422 | ビジネスロジックエラー |
| 500 | サーバーエラー |
GET /users?page=2&limit=20
Response:
{
"data": [...],
"pagination": {
"page": 2,
"limit": 20,
"totalItems": 100,
"totalPages": 5
}
}
# OpenAPI仕様の検証
npx @redocly/cli lint docs/api/openapi.yaml
# ドキュメント生成
npx @redocly/cli build-docs docs/api/openapi.yaml -o docs/api-docs.html
# モックサーバー起動
npx prism mock docs/api/openapi.yaml
# クライアントコード生成
npx openapi-generator-cli generate -i docs/api/openapi.yaml -g typescript-axios -o src/api
API仕様書作成時の成果物:
docs/api/openapi.yamldocs/api/schemas/*.yamldocs/api/paths/*.yamldocs/api-docs.html(生成)xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience