mcpField
C
create-oo-component-documentation

create-oo-component-documentation

github.com/github開発40.5k7.0k 回インストール1 日前に更新
リポジトリ

create-oo-component-documentation について

オブジェクト指向コンポーネントの技術文書を生成するスキルです。開発者や保守担当者向けにソースコードを分析し、指定されたアーキテクチャおよび設計文書の基準に沿った Markdown を作成します。

主な機能

  1. 01コンポーネントのソースと構成の分析
  2. 02アーキテクチャ、パターン、依存関係の記録
  3. 03インターフェース、引数、戻り値、例外の記述
  4. 04セキュリティや保守性などの評価
  5. 05構造化された Markdown 文書の生成

活用シーン

  1. 01既存コンポーネントへの技術文書の追加
  2. 02公開 API と利用方法の記録
  3. 03コンポーネントの構成とデータフローの整理
  4. 04チーム内の文書構成の統一

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/github/awesome-copilot --skill create-oo-component-documentation

インストール後、Claude Code で/create-oo-component-documentationを入力して読み込まれたか確認します。

詳細

標準的なオブジェクト指向コンポーネントのドキュメントを生成する

次の場所にあるオブジェクト指向コンポーネントを包括的にドキュメント化してください:${input:ComponentPath}。

指定されたパス内のコードを調査して、コンポーネントを分析します。フォルダーの場合は、すべてのソースファイルを分析してください。単一ファイルの場合は、それを主要なコンポーネントとして扱い、同じディレクトリ内の関連ファイルも分析してください。

ドキュメント作成基準

  • DOC-001:C4 モデルのドキュメントレベル(コンテキスト、コンテナー、コンポーネント、コード)に従う
  • DOC-002:Arc42 ソフトウェアアーキテクチャドキュメントテンプレートに沿う
  • DOC-003:IEEE 1016 ソフトウェア設計記述標準に準拠する
  • DOC-004:アジャイルドキュメントの原則(価値をもたらす必要最小限のドキュメント)を適用する
  • DOC-005:主な対象読者を開発者と保守担当者とする

分析の指示

  • ANA-001:パスの種類(フォルダーまたは単一ファイル)を判定し、主要コンポーネントを特定する
  • ANA-002:ソースコードファイルを調査し、クラス構造と継承を確認する
  • ANA-003:デザインパターンとアーキテクチャ上の判断を特定する
  • ANA-004:公開 API、インターフェース、依存関係をドキュメント化する
  • ANA-005:生成・構造・振る舞いに関するパターンを認識する
  • ANA-006:メソッドのパラメーター、戻り値、例外をドキュメント化する
  • ANA-007:パフォーマンス、セキュリティ、信頼性、保守性を評価する
  • ANA-008:統合パターンとデータフローを推測する

言語別の最適化

  • LNG-001:C#/.NET — async/await、依存性注入、構成、破棄処理
  • LNG-002:Java — Spring フレームワーク、アノテーション、例外処理、パッケージ化
  • LNG-003:TypeScript/JavaScript — モジュール、非同期パターン、型、npm
  • LNG-004:Python — パッケージ、仮想環境、型ヒント、テスト

エラー処理

  • ERR-001:パスが存在しない場合 — 正しい形式を案内する
  • ERR-002:ソースファイルが見つからない場合 — 別の場所を提案する
  • ERR-003:構造が不明確な場合 — 調査結果をドキュメント化し、確認を求める
  • ERR-004:標準的でないパターンの場合 — 独自のアプローチをドキュメント化する
  • ERR-005:コードが不十分な場合 — 入手可能な情報に焦点を当て、不足箇所を明示する

出力形式

読みやすさと保守性を高めるため、明確な見出し階層、コードブロック、表、箇条書き、適切な書式を用いた、よく構成された Markdown を生成してください。

ファイルの保存場所

ドキュメントは /docs/components/ ディレクトリに保存し、次の規則に従って命名してください:[component-name]-documentation.md。

必須ドキュメント構成

ドキュメントファイルは、以下のテンプレートに従い、すべてのセクションを適切に記入してください。Markdown のフロントマターは、以下の例に従って適切に記述してください:

---
title: [Component Name] - Technical Documentation
component_path: `${input:ComponentPath}`
version: [Optional: e.g., 1.0, Date]
date_created: [YYYY-MM-DD]
last_updated: [Optional: YYYY-MM-DD]
owner: [Optional: Team/Individual responsible for this component]
tags: [Optional: List of relevant tags or categories, e.g., `component`,`service`,`tool`,`infrastructure`,`documentation`,`architecture` etc]
---

# [Component Name] Documentation

[A short concise introduction to the component and its purpose within the system.]

## 1. Component Overview

### Purpose/Responsibility
- OVR-001: State component's primary responsibility
- OVR-002: Define scope (included/excluded functionality)
- OVR-003: Describe system context and relationships

## 2. Architecture Section

- ARC-001: Document design patterns used (Repository, Factory, Observer, etc.)
- ARC-002: List internal and external dependencies with purposes
- ARC-003: Document component interactions and relationships
- ARC-004: Include visual diagrams (UML class, sequence, component)
- ARC-005: Create mermaid diagram showing component structure, relationships, and dependencies

### Component Structure and Dependencies Diagram

Include a comprehensive mermaid diagram that shows:
- **Component structure** - Main classes, interfaces, and their relationships
- **Internal dependencies** - How components interact within the system
- **External dependencies** - External libraries, services, databases, APIs
- **Data flow** - Direction of dependencies and interactions
- **Inheritance/composition** - Class hierarchies and composition relationships

```mermaid
graph TD
    subgraph "Component System"
        A[Main Component] --> B[Internal Service]
        A --> C[Internal Repository]
        B --> D[Business Logic]
        C --> E[Data Access Layer]
    end

    subgraph "External Dependencies"
        F[External API]
        G[Database]
        H[Third-party Library]
        I[Configuration Service]
    end

    A --> F
    E --> G
    B --> H
    A --> I

    classDiagram
        class MainComponent {
            +property: Type
            +method(): ReturnType
            +asyncMethod(): Promise~Type~
        }
        class InternalService {
            +businessOperation(): Result
        }
        class ExternalAPI {
            <<external>>
            +apiCall(): Data
        }

        MainComponent --> InternalService
        MainComponent --> ExternalAPI

3. インターフェースのドキュメント

  • INT-001:すべての公開インターフェースと使用パターンをドキュメント化する
  • INT-002:メソッド/プロパティのリファレンス表を作成する
  • INT-003:イベント/コールバック/通知の仕組みをドキュメント化する
メソッド/プロパティ目的パラメーター戻り値の型使用上の注意
[名前][目的][パラメーター][型][注意事項]

4. 実装の詳細

  • IMP-001:主要な実装クラスとその責務をドキュメント化する
  • IMP-002:構成要件と初期化について説明する
  • IMP-003:主要なアルゴリズムとビジネスロジックをドキュメント化する
  • IMP-004:パフォーマンスの特性とボトルネックを記載する

5. 使用例

基本的な使用方法
// Basic usage example
var component = new ComponentName();
component.DoSomething();
高度な使用方法
// Advanced configuration patterns
var options = new ComponentOptions();
var component = ComponentFactory.Create(options);
await component.ProcessAsync(data);
  • USE-001:基本的な使用例を提示する
  • USE-002:高度な構成パターンを示す
  • USE-003:ベストプラクティスと推奨パターンをドキュメント化する

6. 品質特性

  • QUA-001:セキュリティ(認証、認可、データ保護)
  • QUA-002:パフォーマンス(特性、スケーラビリティ、リソース使用量)
  • QUA-003:信頼性(エラー処理、フォールトトレランス、復旧)
  • QUA-004:保守性(標準、テスト、ドキュメント)
  • QUA-005:拡張性(拡張ポイント、カスタマイズの選択肢)

7. 参考情報

  • REF-001: 依存関係とバージョン、目的の一覧
  • REF-002: 設定オプションの完全なリファレンス
  • REF-003: テストガイドラインとモックのセットアップ
  • REF-004: トラブルシューティング (よくある問題、エラーメッセージ)
  • REF-005: 関連ドキュメントへのリンク
  • REF-006: 変更履歴と移行に関する注意事項

コメント