Claude.md ファイルの監査と改善に対応しています。 **次のような場合に使用:** - ユーザーが Claude.md ファイルのチェック、監査、更新、改善、修正をリクエストした場合 - 「Claude.md メンテナンス」や「プロジェクトメモリの最適化」に関する言及があった場合 **動作内容:** すべての Claude.md ファイルをスキャンし、テンプレートに照らして品質を評価した上で品質レポートを出力します。その後、必要な箇所を効率的に修正・改善します。
Audit and improve CLAUDE.md files in repositories. Use when user asks to check, audit, update, improve, or fix CLAUDE.md files. Scans for all CLAUDE.md files, evaluates quality against templates, outputs quality report, then makes targeted updates. Also use when the user mentions "CLAUDE.md maintenance" or "project memory optimization".
コードベース全体の CLAUDE.md ファイルを監査・評価・改善し、Claude Code が最適なプロジェクトコンテキストを持てるようにします。
このスキルは CLAUDE.md ファイルへの書き込みが可能です。 品質レポートを提示してユーザーの承認を得た後、CLAUDE.md ファイルに的を絞った改善を加えます。
リポジトリ内のすべての CLAUDE.md ファイルを探索します:
find . -name "CLAUDE.md" -o -name ".claude.md" -o -name ".claude.local.md" 2>/dev/null | head -50
ファイルの種類と配置場所:
| 種類 | 配置場所 | 用途 |
|---|---|---|
| プロジェクトルート | ./CLAUDE.md |
プロジェクトの主要コンテキスト(git 管理対象、チーム共有) |
| ローカルオーバーライド | ./.claude.local.md |
個人・ローカル設定(gitignore 対象、非共有) |
| グローバルデフォルト | ~/.claude/CLAUDE.md |
全プロジェクト共通のユーザー設定 |
| パッケージ固有 | ./packages/*/CLAUDE.md |
モノレポにおけるモジュールレベルのコンテキスト |
| サブディレクトリ | 任意のネストされた場所 | 機能・ドメイン固有のコンテキスト |
注意: Claude は親ディレクトリの CLAUDE.md ファイルを自動的に探索するため、モノレポ構成でも自動的に機能します。
各 CLAUDE.md ファイルを品質基準に照らして評価します。 詳細な評価ルーブリックは references/quality-criteria.md を参照してください。
簡易評価チェックリスト:
| 評価基準 | 重要度 | 確認内容 |
|---|---|---|
| コマンド・ワークフローの記述 | 高 | ビルド・テスト・デプロイのコマンドが記載されているか |
| アーキテクチャの明確さ | 高 | コードベースの構造を Claude が理解できるか |
| 非自明なパターン | 中 | 落とし穴や特有の癖が記載されているか |
| 簡潔さ | 中 | 冗長な説明や自明な情報が含まれていないか |
| 最新性 | 高 | 現在のコードベースの状態を反映しているか |
| 実行可能性 | 高 | 指示が曖昧でなく実行可能な内容になっているか |
品質スコア:
更新を行う前に、必ず品質レポートを出力してください。
出力フォーマット:
## CLAUDE.md 品質レポート
### サマリー
- 検出ファイル数: X
- 平均スコア: X/100
- 更新が必要なファイル数: X
### ファイル別評価
#### 1. ./CLAUDE.md(プロジェクトルート)
**スコア: XX/100(グレード: X)**
| 評価基準 | スコア | 備考 |
|----------|--------|------|
| コマンド・ワークフロー | X/20 | ... |
| アーキテクチャの明確さ | X/20 | ... |
| 非自明なパターン | X/15 | ... |
| 簡潔さ | X/15 | ... |
| 最新性 | X/15 | ... |
| 実行可能性 | X/15 | ... |
**問題点:**
- [具体的な問題をリストアップ]
**推奨追加事項:**
- [追加すべき内容をリストアップ]
#### 2. ./packages/api/CLAUDE.md(パッケージ固有)
...
品質レポートを出力した後、更新を行う前にユーザーへ確認を求めます。
更新ガイドライン(重要):
的を絞った追加のみを提案する — 本当に有用な情報に絞ること:
最小限に保つ — 以下は避けること:
差分を提示する — 各変更について以下を示すこと:
差分フォーマット:
### 更新: ./CLAUDE.md
**理由:** ビルドコマンドが記載されておらず、プロジェクトの起動方法が不明瞭だったため。
```diff
+ ## クイックスタート
+
+ ```bash
+ npm install
+ npm run dev # 開発サーバーをポート 3000 で起動
+ ```
---
### フェーズ 5: 更新の適用
ユーザーの承認後、Edit ツールを使用して変更を適用します。
既存のコンテキスト構造は維持してください。
---
## テンプレート
プロジェクトタイプ別の CLAUDE.md テンプレートは [references/templates.md](references/templates.md) を参照してください。
---
## 共通の問題フラグ
1. **古くなったコマンド**: 現在は動作しないビルドコマンド
2. **依存関係の記載漏れ**: 必要なツールが記載されていない
3. **古くなったアーキテクチャ**: 変更されたファイル構造の記述
4. **環境構築手順の欠落**: 必要な環境変数や設定の記載なし
5. **テストコマンドの破損**: 変更されたテストスクリプトの記述
6. **未記載の落とし穴**: 記録されていない非自明なパターン
---
## ユーザーへのヒント
推奨事項を提示する際に、以下の点をユーザーに伝えてください:
- **`#` キーショートカット**: Claude セッション中に `#` を押すと、Claude がセッションで得た知見を自動的に CLAUDE.md に反映します
- **簡潔に保つ**: CLAUDE.md は人間が読めるものにしてください。冗長よりも密度のある記述が望ましいです
- **実行可能なコマンド**: 記載するコマンドはすべてコピー&ペーストですぐに使えるものにしてください
- **`.claude.local.md` を活用する**: チームで共有しない個人的な設定には `.claude.local.md` を使い、`.gitignore` に追加してください
- **グローバルデフォルト**: ユーザー全体の設定は `~/.claude/CLAUDE.md` に記載してください
---
## 優れた CLAUDE.md の条件
**基本原則:**
- 簡潔で人間が読みやすい
- コピー&ペーストで実行できる実用的なコマンド
- 一般的なアドバイスではなく、プロジェクト固有のパターン
- 非自明な落とし穴と注意事項
**推奨セクション**(必要なものだけ使用):
- コマンド(ビルド・テスト・開発・リント)
- アーキテクチャ(ディレクトリ構造)
- 主要ファイル(エントリポイント・設定ファイル)
- コードスタイル(プロジェクト固有の規約)
- 環境(必要な環境変数・セットアップ手順)
- テスト(コマンド・パターン)
- 落とし穴(特有の癖・よくあるミス)
- ワークフロー(何をいつ行うか)
Audit, evaluate, and improve CLAUDE.md files across a codebase to ensure Claude Code has optimal project context.
This skill can write to CLAUDE.md files. After presenting a quality report and getting user approval, it updates CLAUDE.md files with targeted improvements.
Find all CLAUDE.md files in the repository:
find . -name "CLAUDE.md" -o -name ".claude.md" -o -name ".claude.local.md" 2>/dev/null | head -50
File Types & Locations:
| Type | Location | Purpose |
|---|---|---|
| Project root | ./CLAUDE.md |
Primary project context (checked into git, shared with team) |
| Local overrides | ./.claude.local.md |
Personal/local settings (gitignored, not shared) |
| Global defaults | ~/.claude/CLAUDE.md |
User-wide defaults across all projects |
| Package-specific | ./packages/*/CLAUDE.md |
Module-level context in monorepos |
| Subdirectory | Any nested location | Feature/domain-specific context |
Note: Claude auto-discovers CLAUDE.md files in parent directories, making monorepo setups work automatically.
For each CLAUDE.md file, evaluate against quality criteria. See references/quality-criteria.md for detailed rubrics.
Quick Assessment Checklist:
| Criterion | Weight | Check |
|---|---|---|
| Commands/workflows documented | High | Are build/test/deploy commands present? |
| Architecture clarity | High | Can Claude understand the codebase structure? |
| Non-obvious patterns | Medium | Are gotchas and quirks documented? |
| Conciseness | Medium | No verbose explanations or obvious info? |
| Currency | High | Does it reflect current codebase state? |
| Actionability | High | Are instructions executable, not vague? |
Quality Scores:
ALWAYS output the quality report BEFORE making any updates.
Format:
## CLAUDE.md Quality Report
### Summary
- Files found: X
- Average score: X/100
- Files needing update: X
### File-by-File Assessment
#### 1. ./CLAUDE.md (Project Root)
**Score: XX/100 (Grade: X)**
| Criterion | Score | Notes |
|-----------|-------|-------|
| Commands/workflows | X/20 | ... |
| Architecture clarity | X/20 | ... |
| Non-obvious patterns | X/15 | ... |
| Conciseness | X/15 | ... |
| Currency | X/15 | ... |
| Actionability | X/15 | ... |
**Issues:**
- [List specific problems]
**Recommended additions:**
- [List what should be added]
#### 2. ./packages/api/CLAUDE.md (Package-specific)
...
After outputting the quality report, ask user for confirmation before updating.
Update Guidelines (Critical):
Propose targeted additions only - Focus on genuinely useful info:
Keep it minimal - Avoid:
Show diffs - For each change, show:
Diff Format:
### Update: ./CLAUDE.md
**Why:** Build command was missing, causing confusion about how to run the project.
```diff
+ ## Quick Start
+
+ ```bash
+ npm install
+ npm run dev # Start development server on port 3000
+ ```
### Phase 5: Apply Updates
After user approval, apply changes using the Edit tool. Preserve existing content structure.
## Templates
See [references/templates.md](references/templates.md) for CLAUDE.md templates by project type.
## Common Issues to Flag
1. **Stale commands**: Build commands that no longer work
2. **Missing dependencies**: Required tools not mentioned
3. **Outdated architecture**: File structure that's changed
4. **Missing environment setup**: Required env vars or config
5. **Broken test commands**: Test scripts that have changed
6. **Undocumented gotchas**: Non-obvious patterns not captured
## User Tips to Share
When presenting recommendations, remind users:
- **`#` key shortcut**: During a Claude session, press `#` to have Claude auto-incorporate learnings into CLAUDE.md
- **Keep it concise**: CLAUDE.md should be human-readable; dense is better than verbose
- **Actionable commands**: All documented commands should be copy-paste ready
- **Use `.claude.local.md`**: For personal preferences not shared with team (add to `.gitignore`)
- **Global defaults**: Put user-wide preferences in `~/.claude/CLAUDE.md`
## What Makes a Great CLAUDE.md
**Key principles:**
- Concise and human-readable
- Actionable commands that can be copy-pasted
- Project-specific patterns, not generic advice
- Non-obvious gotchas and warnings
**Recommended sections** (use only what's relevant):
- Commands (build, test, dev, lint)
- Architecture (directory structure)
- Key Files (entry points, config)
- Code Style (project conventions)
- Environment (required vars, setup)
- Testing (commands, patterns)
- Gotchas (quirks, common mistakes)
- Workflow (when to do what)
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。