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

doc-generator

Pythonのソースコードを解析し、docstringや型ヒント、コード構造からMarkdown形式のドキュメントを自動生成することで、APIドキュメントやREADMEファイル作成を効率化するSkill。

📜 元の英語説明(参考)

Generate markdown documentation from Python codebases by analyzing source files, extracting docstrings, type hints, and code structure. Use when the user asks to document Python code, create API docs, or generate README files from source code.

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

一言でいうと

Pythonのソースコードを解析し、docstringや型ヒント、コード構造からMarkdown形式のドキュメントを自動生成することで、APIドキュメントやREADMEファイル作成を効率化するSkill。

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

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

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

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

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

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して doc-generator.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → doc-generator フォルダができる
  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 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

Pythonドキュメンテーションジェネレーター

Pythonのソースコードから包括的なMarkdownドキュメントを生成します。

このSkillの利用場面

  • ユーザーが「このコードをドキュメント化して」または「ドキュメントを生成して」と依頼した場合
  • PythonモジュールからAPIドキュメントを作成する場合
  • 使用例を含むREADMEファイルを生成する場合
  • docstringと型シグネチャを読みやすい形式で抽出する場合
  • ユーザーが「documentation」、「docstrings」、または「API reference」に言及した場合

入力

以下のいずれかを受け付けます。

  • 単一のPythonファイルパス
  • ディレクトリパス(.pyファイルを再帰的に処理)
  • 特定のファイルのリスト

出力形式

以下の標準的なMarkdownを生成します。

# Module Name

モジュールのdocstringからの簡単な説明。

## Classes

### ClassName

クラスのdocstringからの説明。

**Methods:**
- `method_name(param: type) -> return_type`: 簡単な説明

## Functions

### function_name(param: type) -> return_type

docstringからの説明。

**Parameters:**
- `param` (type): 説明

**Returns:**
- type: 説明

## Usage Examples

```python
# docstringの例から抽出するか、基本的な使用法を生成


## 分析アプローチ

1. ASTまたはinspectionを使用して**Pythonファイルを解析**します。
2. **キーとなる要素を抽出**します。
   - モジュールレベルのdocstring
   - クラス定義とdocstring
   - 型ヒント付きの関数/メソッドのシグネチャ
   - docstringの内容(Google、NumPy、Sphinx形式をサポート)
3. **階層的に整理**します(モジュール -> クラス -> メソッド -> 関数)。
4. 一貫したフォーマットで**クリーンなMarkdownを生成**します。

## 品質ガイドライン

- 意味がある場合は、元のdocstringのフォーマットを保持します。
- 型ヒントをシグネチャに目立つように含めます。
- 関連する項目をグループ化します(すべてのクラスをまとめ、すべての関数をまとめます)。
- 大きなモジュールには目次を追加します。
- 明示的に要求されない限り、プライベートメンバー(先頭にアンダースコア)をスキップします。
- docstringが見つからない場合は、適切に処理します(「No description provided」と注記)。

## Pythonツール

標準ライブラリを優先します。
- 解析用の`ast`モジュール
- ランタイムイントロスペクション用の`inspect`モジュール
- ファイル処理用の`pathlib`

基本的なドキュメント生成には、外部依存関係は必要ありません。

## エラー処理

- 構文エラーのあるファイルはスキップします(警告をログに記録)。
- 型ヒントが見つからない場合は、適切に処理します。
- docstringが見つからない場合は警告しますが、処理を続行します。
- 処理する前に、ファイルパスが存在することを確認します。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Python Documentation Generator

Generate comprehensive markdown documentation from Python source code.

When to Use This Skill

  • User asks to "document this code" or "generate docs"
  • Creating API documentation from Python modules
  • Generating README files with usage examples
  • Extracting docstrings and type signatures into readable format
  • User mentions "documentation", "docstrings", or "API reference"

Input

Accept either:

  • Single Python file path
  • Directory path (recursively process .py files)
  • List of specific files

Output Format

Generate standard markdown with:

# Module Name

Brief description from module docstring.

## Classes

### ClassName

Description from class docstring.

**Methods:**
- `method_name(param: type) -> return_type`: Brief description

## Functions

### function_name(param: type) -> return_type

Description from docstring.

**Parameters:**
- `param` (type): Description

**Returns:**
- type: Description

## Usage Examples

```python
# Extract from docstring examples or generate basic usage


## Analysis Approach

1. **Parse Python files** using AST or inspection
2. **Extract key elements:**
   - Module-level docstrings
   - Class definitions and docstrings
   - Function/method signatures with type hints
   - Docstring content (support Google, NumPy, Sphinx formats)
3. **Organize hierarchically** (modules -> classes -> methods -> functions)
4. **Generate clean markdown** with consistent formatting

## Quality Guidelines

- Preserve original docstring formatting when meaningful
- Include type hints prominently in signatures
- Group related items (all classes together, all functions together)
- Add table of contents for large modules
- Skip private members (leading underscore) unless explicitly requested
- Handle missing docstrings gracefully (note "No description provided")

## Python Tools

Prefer standard library:
- `ast` module for parsing
- `inspect` module for runtime introspection
- `pathlib` for file handling

No external dependencies required for basic documentation generation.

## Error Handling

- Skip files with syntax errors (log warning)
- Handle missing type hints gracefully
- Warn if no docstrings found but continue processing
- Validate file paths exist before processing