mcpField
M
memory-md-management

memory-md-management

github.com/giuseppe-trisciuoglioAgent 工作流3653.5k 次安装7 周前更新
代码仓库

关于 memory-md-management

面向编码 Agent 的技能,用于发现、评估和改进 `CLAUDE.md` 等项目记忆文件。它按标准评分,并要求先报告质量结果、获得确认后再修改。

主要功能

  1. 01查找项目记忆文件
  2. 02按六项标准评估质量
  3. 03生成逐文件建议
  4. 04提出针对性差异
  5. 05编辑前征求确认

适用场景

  1. 01检查 CLAUDE.md 质量
  2. 02更新过时的项目上下文
  3. 03从头创建项目记忆文件
  4. 04将会话所得纳入记忆文件

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill memory-md-management

安装后在 Claude Code 中输入/memory-md-management确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

references/
quality-criteria.md
templates.md
update-guidelines.md

详细介绍

Memory.md 管理

提供全面的项目记忆文件管理功能,包括审计、质量评估和有针对性的改进。此技能通过维护 CLAUDE.md 等高质量文档文件,确保编码 Agent 获得最佳项目上下文。

概述

CLAUDE.md 等项目记忆文件是向编码 Agent 会话提供项目专属上下文的主要方式。此技能管理其完整生命周期:发现、质量评估、报告和改进。它遵循 5 阶段工作流,确保文档及时、实用且简洁。

此技能根据 6 个维度的标准化质量标准评估 CLAUDE.md 文件:命令/工作流、架构清晰度、非显而易见的模式、简洁性、时效性和可执行性。每个文件都会获得一个分数(0-100)和一个等级(A-F),并附有具体的改进建议。

使用时机

在以下情况下使用此技能:

  • 用户明确要求“检查”“审计”“更新”“改进”“修复”或“维护”CLAUDE.md
  • 用户提到“CLAUDE.md 质量”“文档审查”或“项目记忆优化”
  • 需要为新项目从头创建项目记忆文件
  • 用户询问如何改善 Claude 对代码库的理解
  • 文档已经过时或不再适用
  • 开始处理新的代码库,需要了解现有文档
  • 用户在会话期间按下 #,将所学内容纳入记忆文件

触发短语:“审计 CLAUDE.md”“检查文档质量”“改进项目上下文”“审查 CLAUDE.md”“验证文档”

说明

阶段 1:发现

在仓库中查找所有 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 忽略,不共享)
全局默认项~/.claude/CLAUDE.md用户在所有项目中的全局默认设置
包专属文件./packages/*/CLAUDE.md单体仓库中的模块级上下文
子目录文件任意嵌套位置特定功能/领域的上下文
阶段 2:质量评估

对于每个 CLAUDE.md 文件,阅读 references/quality-criteria.md,并根据以下标准进行评估:

标准权重检查内容
命令/工作流20 分是否包含可用的构建/测试/部署命令?
架构清晰度20 分Claude 能否理解代码库结构?
非显而易见的模式15 分是否记录了易踩坑之处和特殊情况?
简洁性15 分内容是否信息密集且没有冗余?
时效性15 分内容是否反映了当前代码库的状态?
可执行性15 分指令是否可执行且可直接复制粘贴?

**质量评分:**A(90-100)、B(70-89)、C(50-69)、D(30-49)、F(0-29)

阶段 3:输出质量报告

重要:始终先输出质量报告,再进行任何更新。

格式:

## 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]
阶段 4:有针对性的更新

输出报告后,先征求用户确认,再进行更新。

有关详细的更新原则,请阅读 references/update-guidelines.md。

主要原则:

  1. 只提出有针对性的补充——命令、易踩坑之处、模式、配置
  2. 保持精简——避免显而易见的信息、通用建议和一次性修复
  3. 展示差异——文件、变更(diff 格式)、说明

差异格式:

### Update: ./CLAUDE.md
**Why:** [Brief explanation of why this helps]

```diff
+ ## Quick Start
+
+ ```bash
+ npm install
+ npm run dev
+ ```

### Phase 5: Apply Updates

After user approval, use Edit tool to apply changes. Preserve existing content structure.

## Examples

### Example 1: Quality Assessment

**User request:** "Check if my CLAUDE.md is good"

**Response:**
~~~markdown
## CLAUDE.md Quality Report

### Summary
- Files found: 1
- Average score: 65/100
- Files needing update: 1

### File-by-File Assessment

#### 1. ./CLAUDE.md
**Score: 65/100 (Grade: C)**

| Criterion | Score | Notes |
|-----------|-------|-------|
| Commands/workflows | 10/20 | Only npm install documented |
| Architecture clarity | 15/20 | Basic tree, missing module relationships |
| Non-obvious patterns | 5/15 | No gotchas documented |
| Conciseness | 15/15 | Concise and dense |
| Currency | 10/15 | Some outdated paths |
| Actionability | 10/15 | Some vague instructions |

**Issues:**
- Missing test command
- Missing build command
- No documentation of auth flow complexity
- References to old src/structure

**Recommended additions:**
- Add Commands section with test/build
- Document auth module gotcha
- Update architecture paths
示例 2:从头创建

用户请求:“为这个 React 项目创建一个 CLAUDE.md”

回复:

I'll create a CLAUDE.md for your React project. Let me first analyze the codebase structure.

[Scans package.json, src/, and key config files]

## CLAUDE.md Quality Report

### Summary
- Files found: 0
- Creating new CLAUDE.md at project root

### Proposed CLAUDE.md Content:

# Project Name

## Commands

| Command | Description |
|---------|-------------|
| `npm install` | Install dependencies |
| `npm run dev` | Start dev server (Vite on port 5173) |
| `npm run build` | Production build |
| `npm run test` | Run Vitest tests |
| `npm run lint` | ESLint check |

## Architecture

src/ ├── components/ # 可复用的 UI 组件 ├── pages/ # 路由页面 ├── hooks/ # 自定义 React hooks ├── lib/ # 实用工具和 API 客户端 └── main.tsx # 入口点


## Gotchas

- Vite requires files in `public/` for static assets
- State updates in `useEffect` need proper dependency arrays

要创建此文件吗?


### Example 3: Update Proposal

**User request:** "Update my CLAUDE.md with what you learned"

**Response:**
```markdown
### Update: ./CLAUDE.md

**Why:** Discovered that tests require database setup which wasn't documented.

```diff
## Testing

+ **Prerequisites:** Start test database first with `docker-compose up -d test-db`
+ `npm run test` - Run all tests
+ `npm run test:unit` - Unit tests only (no DB required)

还发现 API_BASE_URL 存在问题:

## Environment

- `API_BASE_URL` - API endpoint (default: localhost:3000)
+ `API_BASE_URL` - API endpoint (required for production, defaults to http://localhost:3000 in dev)

要应用这些更改吗?


## Best Practices

1. **Always read references before acting**: Quality criteria, templates, and update guidelines contain essential details
2. **Report before editing**: Never modify CLAUDE.md without first presenting a quality report
3. **Preserve existing structure**: When updating, maintain the existing organization and style
4. **Be project-specific**: Only add information specific to this codebase, not generic advice
5. **Verify commands work**: Before suggesting commands, mentally or actually verify they execute correctly
6. **Use progressive disclosure**: Keep SKILL.md lean, reference detailed rubrics in separate files
7. **Score consistently**: Apply the same scoring standards across all files for fair comparison

## Constraints and Warnings

1. **Never modify without approval**: Always get user confirmation before editing CLAUDE.md files
2. **Don't remove content without asking**: If suggesting deletions, explicitly mark them and get approval
3. **Respect `.claude.local.md`**: These are personal settings; never suggest modifying them in shared docs
4. **Avoid generic advice**: Do not add "write good code" type content - focus on project-specific patterns
5. **Keep diffs concise**: Show only the actual changes, not entire file contents
6. **Verify file paths**: Ensure all referenced files exist before documenting them
7. **Score objectively**: Use the rubric consistently; don't inflate scores for incomplete documentation

评论

支持 Markdown