Files
Luong NGUYEN 3337f0df5e fix(plugins): address review (drop k8s MCP, pin GitHub server, tighten deploy hooks)
- devops-automation: remove the Kubernetes MCP server (.mcp.json in en/uk/vi)
  and every README mention of it; keep the deploy hooks.
- Pin GitHub's MCP server image to ghcr.io/github/github-mcp-server:v2.1.0.
- pre-deploy/post-deploy: detect deploys by command word (after &&, ;, |,
  newlines), skipping quoted strings and heredoc bodies, and allow global
  flags before the verb; document the limits.
- post-deploy: kubectl rollout status when DEPLOY_DEPLOYMENT is set, else the
  pod-ready wait on DEPLOY_APP_LABEL; clear message when kubectl is missing.
- pre-review: handle repos with no commits and detached HEAD; matcher accepts
  both pr-review:<cmd> and the bare name; hooks use exec form (args).
- INDEX.md, QUICK_REFERENCE.md, README.md and concepts guides (all locales):
  drop deleted mcp/*.json files and use /<plugin>:<command> names.

Refs #260
2026-11-12 14:01:32 +00:00

4.7 KiB
Raw Permalink Blame History

Claude How To

Documentation プラグイン

プロジェクトのドキュメント生成と保守を包括的に行うプラグイン。

機能

✅ API ドキュメント生成 ✅ README の作成と更新 ✅ ドキュメント同期 ✅ コードコメントの改善 ✅ サンプルコード生成

インストール

claude --plugin-dir ./07-plugins/documentation

読み込む前にプラグインをチェックする:

claude plugin validate ./07-plugins/documentation

同梱内容

スラッシュコマンド

プラグインのコマンドは、plugin.json のプラグイン name で名前空間が付く:

  • /documentation:generate-api-docs — API ドキュメントを生成
  • /documentation:generate-readme — README を作成または更新
  • /documentation:sync-docs — コード変更にドキュメントを同期
  • /documentation:validate-docs — ドキュメントを検証

サブエージェント

  • api-documenter — API ドキュメンテーションのスペシャリスト
  • code-commentator — コードコメントの改善
  • example-generator — コード例の作成

テンプレート

  • api-endpoint.md — API エンドポイントのドキュメントテンプレート
  • function-docs.md — 関数ドキュメントのテンプレート
  • adr-template.md — Architecture Decision Record(ADR)テンプレート

MCP サーバー

.mcp.json は github という 1 つのサーバーを宣言する。GitHub 公式の MCP サーバー(ghcr.io/github/github-mcp-server)を Docker で読み取り専用モードで実行する。イメージは v2.1.0 リリース に固定されている。アップグレードするには .mcp.json のタグを変更する。/mcp では plugin:documentation:github として表示される。

使い方

API ドキュメントを生成

/documentation:generate-api-docs

README を作成

/documentation:generate-readme

ドキュメントを同期

/documentation:sync-docs

ドキュメントを検証

/documentation:validate-docs

必要要件

  • Claude Code 1.0 以上
  • Docker と GitHub の personal access token(任意。GitHub MCP サーバー用)

ワークフロー例

User: /documentation:generate-api-docs

Claude:
1. Scans all API endpoints in /src/api/
2. Delegates to api-documenter subagent
3. Extracts function signatures and JSDoc
4. Organizes by module/endpoint
5. Uses api-endpoint.md template
6. Generates comprehensive markdown docs
7. Includes curl, JavaScript, and Python examples

Result:
✅ API documentation generated
📄 Files created:
   - docs/api/users.md
   - docs/api/auth.md
   - docs/api/products.md
📊 Coverage: 23/23 endpoints documented

テンプレートの使い方

API Endpoint テンプレート

REST API エンドポイントを完全な例つきでドキュメント化する。

Function Documentation テンプレート

個々の関数 / メソッドのドキュメント化に使う。

ADR テンプレート

アーキテクチャ判断のドキュメント化に使う。

設定

ドキュメント同期用の GitHub トークンを設定する:

export GITHUB_TOKEN="your_github_token"

.mcp.json はこれを、サーバーが読み取る変数である GITHUB_PERSONAL_ACCESS_TOKEN としてサーバーに渡す。/mcp を実行して plugin:documentation:github が接続されていることを確認する。トークンがなくても、コマンドはローカルファイルに対しては動作する。

ベストプラクティス

  • ドキュメントはコードの近くに置く
  • コード変更とともにドキュメントも更新する
  • 実用的な例を含める
  • 定期的に検証する
  • 一貫性のためにテンプレートを使う

最終更新: 2026 年 10 月 18 日 Claude Code バージョン: 2.1.302 出典: