/cook:update-doc-string runs instead · from cook
Systematically manages docstrings and comments in Python, JS/TS, Go, Rust, and more. Supports multilingual output, style enforcement, and Claude marker addition. Trigger: 'update docstrings' or 'add JSDoc'.
This skill never runs in Claude Code
It ships in cook at skills/, but /cook:update-doc-string (a command, or a skill Claude Code finds first) has the same name: typing it, or Claude choosing it, runs that one instead.
多言語対応の docstring/コメントを体系的に管理し、高品質なドキュメントを維持します。
# 言語を自動検出して実行
「docstring がないクラス・関数に追加し、基準を満たさないコメントを更新してください」
# 言語を指定して実行
/update-doc-string --lang python
「Python ファイルの docstring を PEP 257 準拠で更新してください」
# 特定ディレクトリのドキュメント整備
「src/components/ 配下の関数に JSDoc を追加してください」
--lang <en|ja> : ドキュメントの記述言語 (デフォルト: 既存コメントから自動判定、なければ en)--style <スタイル> : ドキュメントスタイルを指定 (言語固有のデフォルトあり)--marker <true|false> : Claude マーカーを付与するか (デフォルト: true)# 1. 対象ファイルの分析 (プログラミング言語は自動検出)
find . -type f \( -name "*.py" -o -name "*.js" -o -name "*.ts" -o -name "*.dart" -o -name "*.go" -o -name "*.rs" \) | grep -v test
「docstring が不足している要素 (コメント行数 0 または 30 文字未満) を特定してください」
# 2. ドキュメント追加 (言語自動判定)
「特定された要素に言語固有の必須要素を含む docstring を追加してください」
# → 既存コメントに日本語があれば日本語で、なければ英語で記述
# 3. ドキュメント追加 (明示的に英語指定)
/update-doc-string --lang en
「Add docstrings with required elements to the identified elements」
# 4. マーカー確認
「追加・更新したすべての docstring に Claude マーカーがあることを確認してください」
対象要素 (言語共通):
Python (PEP 257):
# 日本語版 (デフォルト)
def calculate_total(items: List[Item]) -> float:
"""アイテムリストの合計金額を計算します。(30-60 文字)
各アイテムの価格と数量を掛け合わせ、税込み合計を返します。
空のリストの場合は 0.0 を返します。(50-200 文字)
Args:
items: 計算対象のアイテムリスト
Returns:
税込み合計金額
Generated by Claude 🤖
"""
# 英語版 (--lang en)
def calculate_total(items: List[Item]) -> float:
"""Calculate the total amount for a list of items. (30-60 chars)
Multiplies the price and quantity of each item and returns
the total with tax. Returns 0.0 for empty lists. (50-200 chars)
Args:
items: List of items to calculate
Returns:
Total amount with tax
Generated by Claude 🤖
"""
JavaScript/TypeScript (JSDoc):
/**
* ユーザープロフィールを表示するコンポーネントです。(30-60 文字)
*
* アバター画像、ユーザー名、ステータス情報を表示し、
* クリック時にプロフィール詳細画面へ遷移します。(50-200 文字)
*
* @param {Object} props - コンポーネントのプロパティ
* @param {string} props.userId - ユーザー ID
* @param {boolean} [props.showStatus=true] - ステータス表示フラグ
* @returns {JSX.Element} レンダリングされたコンポーネント
*
* @generated by Claude 🤖
*/
const UserProfile = ({ userId, showStatus = true }) => {
Go:
// CalculateTotal はアイテムリストの合計金額を計算します。(30-60 文字)
//
// 各アイテムの価格と数量を掛け合わせ、税込み合計を返します。
// 空のスライスの場合は 0.0 を返します。(50-200 文字)
//
// Generated by Claude 🤖
func CalculateTotal(items []Item) float64 {
Rust:
/// アイテムリストの合計金額を計算します。(30-60 文字)
///
/// 各アイテムの価格と数量を掛け合わせ、税込み合計を返します。
/// 空のベクタの場合は 0.0 を返します。(50-200 文字)
///
/// Generated by Claude 🤖
pub fn calculate_total(items: &[Item]) -> f64 {
Dart (DartDoc):
/// ユーザープロフィールを表示する Widget です。(30-60 文字)
///
/// アバター画像、ユーザー名、ステータス情報を縦に配置し、
/// タップ時にプロフィール詳細画面へ遷移します。(50-200 文字)
///
/// Generated by Claude 🤖
class UserProfileWidget extends StatelessWidget {
保持すべき重要情報:
See also:, @see, 参照: などTODO:, FIXME:, XXX: 形式Note:, Warning:, 注意: などExample:, 例:, # Examples など# 言語別デフォルト設定
languages:
python:
style: "google" # google, numpy, sphinx
indent: 4
quotes: '"""'
javascript:
style: "jsdoc"
indent: 2
prefix: "/**"
suffix: "*/"
typescript:
style: "tsdoc"
indent: 2
prefix: "/**"
suffix: "*/"
go:
style: "godoc"
indent: 0
prefix: "//"
rust:
style: "rustdoc"
indent: 0
prefix: "///"
dart:
style: "dartdoc"
indent: 0
prefix: "///"
🔴 絶対禁止事項:
実行と検証:
# 実行結果の記録
ADDED_COMMENTS=0
UPDATED_COMMENTS=0
ERRORS=0
# 既存コメントから言語を自動判定
# 日本語文字 (ひらがな・カタカナ・漢字) を検出したら ja、それ以外は en
DOC_LANGUAGE="en" # デフォルト
if grep -r '[ぁ-んァ-ヶー一-龠]' --include="*.py" --include="*.js" --include="*.ts" --include="*.dart" --include="*.go" --include="*.rs" . 2>/dev/null | head -n 1; then
DOC_LANGUAGE="ja"
fi
# プログラミング言語の自動検出と静的解析
if [ -f "*.py" ]; then
pylint --disable=all --enable=missing-docstring .
elif [ -f "*.js" ] || [ -f "*.ts" ]; then
eslint . --rule 'jsdoc/require-jsdoc: error'
elif [ -f "*.go" ]; then
golint ./...
elif [ -f "*.rs" ]; then
cargo doc --no-deps
elif [ -f "*.dart" ]; then
melos analyze
fi
if [ $? -ne 0 ]; then
echo "🔴 エラー: 静的解析が失敗しました"
exit 1
fi
# 実行サマリーの出力
echo "📊 実行結果:"
echo "- ドキュメント言語: $DOC_LANGUAGE"
echo "- 追加したコメント: $ADDED_COMMENTS 件"
echo "- 更新したコメント: $UPDATED_COMMENTS 件"
echo "- エラー発生数: $ERRORS 件"
完了判定: 以下をすべて満たす場合に成功
部分成功: 以下の場合
失敗: 以下の場合
# プロジェクト全体の分析 (言語自動判定)
find . -type f \( -name "*.py" -o -name "*.js" -o -name "*.ts" \)
/update-doc-string
「このプロジェクトの docstring を言語別のベストプラクティスに従って更新して」
# → 既存コメントに日本語があれば ja、なければ en で実行
# 明示的に英語ドキュメントで実行
/update-doc-string --lang en
"Update docstrings following language-specific best practices"
# 明示的に日本語ドキュメントで実行
/update-doc-string --lang ja
「このプロジェクトの docstring を言語別のベストプラクティスに従って更新して」
# マーカーなしで実行 (言語自動判定)
/update-doc-string --marker false
"Improve existing docstrings without adding Claude markers"
# 英語ドキュメント、マーカーなし
/update-doc-string --lang en --marker false
"Improve existing docstrings without adding Claude markers"
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Python, JavaScript, TypeScript, Go, Rust
docstring, jsdoc, multilingual, comment-management, code-documentation
npx claudepluginhub wasabeef/claude-code-cookbook --plugin cook39 skills in this plugin
/analyze-dependenciesプロジェクトの依存関係を分析し健全性を評価プロジェクトの依存関係を分析しアーキテクチャの健全性を評価する。「依存関係を分析して」「循環依存を検出して」「アーキテクチャの問題は?」「モジュールの依存を確認」「dependency を調べて」「結合度をチェックして」「レイヤー違反を見つけて」などで起動。依存関係マトリックス、ファンイン/ファンアウト、循環依存、レイヤー違反を検出し、修正優先度付きの改善提案を生成する。/analyze-performanceCore Web Vitals に基づくパフォーマンス分析Core Web Vitals に基づくパフォーマンス分析と UX スコア算出。「パフォーマンスを分析して」「速度を改善したい」「Core Web Vitals をチェック」「ページ速度を調べて」「LCP を改善」「パフォーマンス問題を特定して」などで起動。/check-factコードベースとドキュメントで情報の正誤を確認コードベースとドキュメントを参照し情報の正誤を確認する。「この情報正しい?」「事実確認して」「ファクトチェックして」「この記述合ってる?」「情報の正確性を検証」などで起動。/check-promptAI プロンプトの品質評価と改善提案AI プロンプトの品質を評価し改善提案を行う。「プロンプトをチェックして」「プロンプトの品質を評価」「プロンプトを改善して」「このプロンプト大丈夫?」などで起動。/commit-messageステージング変更からコミットメッセージを生成ステージングされた変更からコミットメッセージを生成する。「コミットメッセージ考えて」「良いメッセージ生成して」「commit message を作って」「適切なコミットメッセージは?」「メッセージを提案して」「コミット文を書いて」「変更内容をメッセージに」などで起動。プロジェクト規約を自動検出し、適切なメッセージを提案。/context7Context7 MCP で技術ドキュメントを検索Context7 MCP で技術ドキュメントを検索する。「ドキュメント調べて」「公式ドキュメントを確認」「ライブラリの使い方は?」「API リファレンスを見て」「Context7 で検索」などで起動。2 plugins ship this exact skill · first indexed Jul 16, 2026
Other plugins' skills for the same job