code-documentation
JSDocやPythonのdocstring、インラインコメントなどを活用し、関数やAPIに関する詳細な説明を加えながら、分かりやすく包括的なコードのドキュメントを作成するSkill。
📜 元の英語説明(参考)
Write comprehensive code documentation including JSDoc, Python docstrings, inline comments, function documentation, and API comments. Use when documenting code, writing docstrings, or creating inline documentation.
🇯🇵 日本人クリエイター向け解説
JSDocやPythonのdocstring、インラインコメントなどを活用し、関数やAPIに関する詳細な説明を加えながら、分かりやすく包括的なコードのドキュメントを作成するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o code-documentation.zip https://jpskill.com/download/21367.zip && unzip -o code-documentation.zip && rm code-documentation.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/21367.zip -OutFile "$d\code-documentation.zip"; Expand-Archive "$d\code-documentation.zip" -DestinationPath $d -Force; ri "$d\code-documentation.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
code-documentation.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
code-documentationフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 7
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
コードドキュメンテーション
目次
概要
JSDoc、Python docstrings、JavaDoc、インラインコメントなどの言語固有の標準を使用して、明確で包括的なコードドキュメンテーションを作成します。
使用場面
- 関数およびクラスのドキュメンテーション
- JavaScript/TypeScript 用の JSDoc
- Python docstrings
- Java 用の JavaDoc
- インラインコードコメント
- コードからの API ドキュメンテーション
- 型定義
- コード内の使用例
クイックスタート
最小限の動作例:
/**
* Calculates the total price including tax and discount.
*
* @param {number} basePrice - The base price before tax and discount
* @param {number} taxRate - Tax rate as a decimal (e.g., 0.08 for 8%)
* @param {number} [discount=0] - Optional discount amount
* @returns {number} The final price after tax and discount
* @throws {Error} If basePrice or taxRate is negative
*
* @example
* const price = calculateTotalPrice(100, 0.08, 10);
* console.log(price); // 98
*
* @example
* // Without discount
* const price = calculateTotalPrice(100, 0.08);
* console.log(price); // 108
*/
function calculateTotalPrice(basePrice, taxRate, discount = 0) {
if (basePrice < 0 || taxRate < 0) {
throw new Error("Price and tax rate must be non-negative");
}
return basePrice * (1 + taxRate) - discount;
}
// ... (see reference guides for full implementation)
リファレンスガイド
references/ ディレクトリにある詳細な実装:
| ガイド | 内容 |
|---|---|
| Function Documentation | 関数ドキュメンテーション |
| Class Documentation | クラスドキュメンテーション |
| Type Definitions | 型定義 |
| Function Documentation | 関数ドキュメンテーション |
| Class Documentation | クラスドキュメンテーション |
| Module Documentation | モジュールドキュメンテーション |
ベストプラクティス
✅ するべきこと
- パブリック API を徹底的にドキュメント化する
- 使用例を含める
- パラメータと戻り値をドキュメント化する
- スローされる例外/エラーを指定する
- 言語固有の標準(JSDoc、docstrings など)を使用する
- コメントを最新の状態に保つ
- 「何をするか」ではなく「なぜそうするのか」をドキュメント化する
- エッジケースと注意点を含める
- 関連する関数へのリンクを追加する
- 型定義をドキュメント化する
- 一貫した書式を使用する
❌ するべきではないこと
- コメントで自明なことを述べる
- コメントアウトされたコードを残す
- 誤解を招くコメントを書く
- 複雑な関数の例を省略する
- 曖昧なパラメータの説明を使用する
- コード変更時にドキュメントの更新を忘れる
- 単純なコードに過剰なコメントを付ける
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Code Documentation
Table of Contents
Overview
Create clear, comprehensive code documentation using language-specific standards like JSDoc, Python docstrings, JavaDoc, and inline comments.
When to Use
- Function and class documentation
- JSDoc for JavaScript/TypeScript
- Python docstrings
- JavaDoc for Java
- Inline code comments
- API documentation from code
- Type definitions
- Usage examples in code
Quick Start
Minimal working example:
/**
* Calculates the total price including tax and discount.
*
* @param {number} basePrice - The base price before tax and discount
* @param {number} taxRate - Tax rate as a decimal (e.g., 0.08 for 8%)
* @param {number} [discount=0] - Optional discount amount
* @returns {number} The final price after tax and discount
* @throws {Error} If basePrice or taxRate is negative
*
* @example
* const price = calculateTotalPrice(100, 0.08, 10);
* console.log(price); // 98
*
* @example
* // Without discount
* const price = calculateTotalPrice(100, 0.08);
* console.log(price); // 108
*/
function calculateTotalPrice(basePrice, taxRate, discount = 0) {
if (basePrice < 0 || taxRate < 0) {
throw new Error("Price and tax rate must be non-negative");
}
return basePrice * (1 + taxRate) - discount;
}
// ... (see reference guides for full implementation)
Reference Guides
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| Function Documentation | Function Documentation |
| Class Documentation | Class Documentation |
| Type Definitions | Type Definitions |
| Function Documentation | Function Documentation |
| Class Documentation | Class Documentation |
| Module Documentation | Module Documentation |
Best Practices
✅ DO
- Document public APIs thoroughly
- Include usage examples
- Document parameters and return values
- Specify thrown exceptions/errors
- Use language-specific standards (JSDoc, docstrings, etc.)
- Keep comments up-to-date
- Document "why" not "what"
- Include edge cases and gotchas
- Add links to related functions
- Document type definitions
- Use consistent formatting
❌ DON'T
- State the obvious in comments
- Leave commented-out code
- Write misleading comments
- Skip examples for complex functions
- Use vague parameter descriptions
- Forget to update docs when code changes
- Over-comment simple code
同梱ファイル
※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。
- 📄 SKILL.md (3,059 bytes)
- 📎 references/class-documentation-2.md (2,577 bytes)
- 📎 references/class-documentation.md (2,577 bytes)
- 📎 references/function-documentation-2.md (1,885 bytes)
- 📎 references/function-documentation.md (1,885 bytes)
- 📎 references/module-documentation.md (1,397 bytes)
- 📎 references/type-definitions.md (1,097 bytes)