claude-md-improver by anthropics/claude-plugins-official
npx skills add https://github.com/anthropics/claude-plugins-official --skill claude-md-improver审核、评估并改进代码库中的 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 | 个人/本地设置(被 git 忽略,不共享) |
| 全局默认值 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
~/.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:应用更新
获得用户批准后,使用编辑工具应用更改。保留现有的内容结构。
## 模板
按项目类型划分的 CLAUDE.md 模板,请参阅 [references/templates.md](references/templates.md)。
## 需要标记的常见问题
1. **过时的命令**:不再有效的构建命令
2. **缺失的依赖项**:未提及所需的工具
3. **过时的架构**:已更改的文件结构
4. **缺失的环境设置**:所需的环境变量或配置
5. **损坏的测试命令**:已更改的测试脚本
6. **未记录的陷阱**:未捕获的非显而易见模式
## 与用户分享的技巧
在提出建议时,提醒用户:
- **`#` 快捷键**:在 Claude 会话期间,按 `#` 键可以让 Claude 自动将学习到的内容整合到 CLAUDE.md 中
- **保持简洁**:CLAUDE.md 应易于人类阅读;内容密集比冗长更好
- **可操作的命令**:所有记录的命令都应可直接复制粘贴使用
- **使用 `.claude.local.md`**:用于不共享给团队的个人偏好(添加到 `.gitignore`)
- **全局默认值**:将用户范围的偏好放在 `~/.claude/CLAUDE.md` 中
## 什么造就了一个优秀的 CLAUDE.md
**关键原则:**
- 简洁且易于人类阅读
- 可复制粘贴的可操作命令
- 项目特定的模式,而非通用建议
- 非显而易见的陷阱和警告
**推荐章节**(仅使用相关部分):
- 命令(构建、测试、开发、代码检查)
- 架构(目录结构)
- 关键文件(入口点、配置)
- 代码风格(项目约定)
- 环境(必需的变量、设置)
- 测试(命令、模式)
- 陷阱(特殊之处、常见错误)
- 工作流(何时做什么)
每周安装数
1.3K
代码仓库
GitHub 星标数
9.7K
首次出现
2026年1月21日
安全审计
安装于
claude-code1.1K
codex1.0K
opencode974
gemini-cli933
github-copilot872
cursor752
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)
Weekly Installs
1.3K
Repository
GitHub Stars
9.7K
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
claude-code1.1K
codex1.0K
opencode974
gemini-cli933
github-copilot872
cursor752
97,600 周安装