jpskill.com
✍️ ライティング コミュニティ

update-api-docs

本番環境から最新のAPI定義書を取得し、Docusaurus形式のAPIドキュメントを自動生成・更新することで、常に正確で最新のAPI情報を開発者や利用者に提供するSkill。

📜 元の英語説明(参考)

Update the API reference documentation by downloading the latest OpenAPI spec from production and regenerating the Docusaurus API docs

🇯🇵 日本人クリエイター向け解説

一言でいうと

本番環境から最新のAPI定義書を取得し、Docusaurus形式のAPIドキュメントを自動生成・更新することで、常に正確で最新のAPI情報を開発者や利用者に提供するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o update-api-docs.zip https://jpskill.com/download/10077.zip && unzip -o update-api-docs.zip && rm update-api-docs.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/10077.zip -OutFile "$d\update-api-docs.zip"; Expand-Archive "$d\update-api-docs.zip" -DestinationPath $d -Force; ri "$d\update-api-docs.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して update-api-docs.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → update-api-docs フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

APIドキュメントの更新

このスキルは、本番環境のOpenAPI仕様からAPIリファレンスドキュメントを更新する手順を案内します。

概要

APIドキュメントは、docusaurus-plugin-openapi-docsを使用してOpenAPI仕様から生成されます。ワークフローには以下が含まれます。

  1. 本番環境から最新のopenapi.jsonをダウンロードする
  2. ローカルの仕様ファイルを置き換える
  3. APIドキュメントページを再生成する

ファイルの場所

目的 パス
OpenAPI仕様 (ソース) docs/docs/reference/openapi.json
生成されたAPIドキュメント docs/docs/reference/api/*.api.mdx
生成されたサイドバー docs/docs/reference/api/sidebar.ts
Docusaurus設定 docs/docusaurus.config.ts

手順

1. 本番環境からOpenAPI仕様をダウンロードする

curl -s "https://cloud.agenta.ai/api/openapi.json" -o docs/docs/reference/openapi.json

重要: ファイルは、リポジトリ内の既存の形式と一致するように、minifyされた形式(単一行、pretty-printingなし)で保存する必要があります。上記のcurlコマンドは、サーバーからの元の形式を保持します。

2. 依存関係のインストール (必要な場合)

これが新規のクローンであるか、依存関係がまだインストールされていない場合は、以下を実行します。

cd docs
npm install

3. 既存の生成されたAPIドキュメントをクリーンアップする

cd docs
npm run clean-api-docs -- agenta

agenta引数は、docusaurus.config.tsで定義されたOpenAPI設定IDを参照します。

4. APIドキュメントを再生成する

cd docs
npm run gen-api-docs -- agenta

これにより、以下が生成されます。

  • 各エンドポイントの個別の.api.mdxファイル
  • APIカテゴリの.tag.mdxファイル
  • ナビゲーション用のsidebar.ts

5. 変更を確認する

オプションで、開発サーバーを起動してプレビューします。

cd docs
npm run start

次に、http://localhost:5000/docs/reference/apiにアクセスして、APIドキュメントが正しくレンダリングされることを確認します。

コミットのガイドライン

これらの変更をコミットする場合:

  1. 最初のコミット - APIドキュメントの更新:

    docs(api): update OpenAPI spec from production
  2. 変更されたすべてのファイルを含めます:

    • docs/docs/reference/openapi.json
    • docs/docs/reference/api/*.api.mdx
    • docs/docs/reference/api/*.tag.mdx
    • docs/docs/reference/api/sidebar.ts

トラブルシューティング

"'id'という必須引数がありません" エラー

cleanコマンドとgenerateコマンドには設定IDが必要です。以下を使用してください:

npm run clean-api-docs -- agenta
npm run gen-api-docs -- agenta

"docusaurus: 見つかりません" エラー

最初にdocs/ディレクトリでnpm installを実行します。

onBrokenMarkdownLinksに関する非推奨警告

これは既知の警告であり、安全に無視できます。これは、将来のDocusaurus v4移行で対処される予定です。

関連する設定

OpenAPIプラグインはdocs/docusaurus.config.tsで設定されています:

[
  "docusaurus-plugin-openapi-docs",
  {
    id: "openapi",
    docsPluginId: "classic",
    config: {
      agenta: {
        specPath: "docs/reference/openapi.json",
        outputDir: "docs/reference/api",
        downloadUrl: "https://raw.githubusercontent.com/Agenta-AI/agenta/refs/heads/main/docs/docs/reference/openapi.json",
        sidebarOptions: {
          groupPathsBy: "tag",
          categoryLinkSource: "tag",
        },
      },
    },
  },
],
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Update API Documentation

This skill guides you through updating the API reference documentation from the production OpenAPI specification.

Overview

The API documentation is generated from an OpenAPI spec using docusaurus-plugin-openapi-docs. The workflow involves:

  1. Downloading the latest openapi.json from production
  2. Replacing the local spec file
  3. Regenerating the API documentation pages

File Locations

Purpose Path
OpenAPI spec (source) docs/docs/reference/openapi.json
Generated API docs docs/docs/reference/api/*.api.mdx
Generated sidebar docs/docs/reference/api/sidebar.ts
Docusaurus config docs/docusaurus.config.ts

Steps

1. Download the OpenAPI spec from production

curl -s "https://cloud.agenta.ai/api/openapi.json" -o docs/docs/reference/openapi.json

Important: The file should be saved in minified format (single line, no pretty-printing) to match the existing format in the repository. The curl command above preserves the original format from the server.

2. Install dependencies (if needed)

If this is a fresh clone or dependencies haven't been installed:

cd docs
npm install

3. Clean existing generated API docs

cd docs
npm run clean-api-docs -- agenta

The agenta argument refers to the OpenAPI config ID defined in docusaurus.config.ts.

4. Regenerate API docs

cd docs
npm run gen-api-docs -- agenta

This will generate:

  • Individual .api.mdx files for each endpoint
  • .tag.mdx files for API categories
  • sidebar.ts for navigation

5. Verify the changes

Optionally, start the dev server to preview:

cd docs
npm run start

Then visit http://localhost:5000/docs/reference/api to verify the API docs render correctly.

Commit Guidelines

When committing these changes:

  1. First commit - API docs update:

    docs(api): update OpenAPI spec from production
  2. Include all changed files:

    • docs/docs/reference/openapi.json
    • docs/docs/reference/api/*.api.mdx
    • docs/docs/reference/api/*.tag.mdx
    • docs/docs/reference/api/sidebar.ts

Troubleshooting

"missing required argument 'id'" error

The clean and generate commands require the config ID. Use:

npm run clean-api-docs -- agenta
npm run gen-api-docs -- agenta

"docusaurus: not found" error

Run npm install in the docs/ directory first.

Deprecation warning about onBrokenMarkdownLinks

This is a known warning and can be safely ignored. It will be addressed in a future Docusaurus v4 migration.

Related Configuration

The OpenAPI plugin is configured in docs/docusaurus.config.ts:

[
  "docusaurus-plugin-openapi-docs",
  {
    id: "openapi",
    docsPluginId: "classic",
    config: {
      agenta: {
        specPath: "docs/reference/openapi.json",
        outputDir: "docs/reference/api",
        downloadUrl: "https://raw.githubusercontent.com/Agenta-AI/agenta/refs/heads/main/docs/docs/reference/openapi.json",
        sidebarOptions: {
          groupPathsBy: "tag",
          categoryLinkSource: "tag",
        },
      },
    },
  },
],