memory-defrag by basicmachines-co/basic-memory-skills
npx skills add https://github.com/basicmachines-co/basic-memory-skills --skill memory-defrag重组内存文件以实现清晰性、高效性和相关性。类似于文件系统的碎片整理,但针对的是知识。
清点所有内存文件:
MEMORY.md — 长期记忆
memory/ — 每日笔记、任务、主题文件
memory/tasks/ — 活动和已完成的任务
对于每个文件,记录:行数、最后修改时间、主题覆盖范围、陈旧程度。
寻找这些常见问题:
| 问题 | 信号 | 修复方案 |
|---|---|---|
| 文件臃肿 | >300 行,涵盖多个主题 | 拆分为专注的文件 |
| 信息重复 | 同一事实出现在多个位置 | 整合到一个位置 |
| 陈旧条目 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 引用已完成的工作、旧日期、已解决的问题 |
| 移除或归档 |
| 孤立文件 | memory/ 中从未被引用或更新的文件 | 审查、合并或移除 |
| 不一致性 | 跨文件的信息相互矛盾 | 根据事实进行解决 |
| 组织混乱 | 相关信息分散在多个文件中 | 按主题重组 |
| 递归嵌套 | memory/memory/memory/... 目录 | 删除嵌套目录(索引器错误的产物) |
在进行编辑之前,写一个简要的计划:
## 碎片整理计划
- [ ] 将 MEMORY.md 的 "关键人物" 部分拆分到 memory/people.md
- [ ] 从 memory/tasks/ 中移除超过 30 天的已完成任务
- [ ] 将 memory/bm-marketing-ideas.md 合并到 memory/competitive/
- [ ] 更新 MEMORY.md 中陈旧的项目状态条目
逐一应用更改:
更改后:
验证没有信息丢失(比较前后状态)
更新文件之间的任何交叉引用
在今天的每日笔记中记录所做的事情:
memory/YYYY-MM-DD.md 文件——它们是审计跟踪记录。people.md、project-status.md、competitive-landscape.md——而不是 notes-2.md。memory/tasks/ 和 memory/competitive/ 没问题;memory/work/projects/active/basic-memory/notes/ 则不行。status: done 且超过 14 天的任务可以移除。它们的见解应已通过反思记录在 MEMORY.md 中。(需要审查) 标签,而不是删除。每周安装次数
29
仓库
GitHub 星标数
4
首次出现
2026年2月22日
安全审计
安装于
codex26
github-copilot24
kimi-cli24
gemini-cli24
cursor24
amp24
Reorganize memory files for clarity, efficiency, and relevance. Like filesystem defragmentation but for knowledge.
Inventory all memory files:
MEMORY.md — long-term memory
memory/ — daily notes, tasks, topical files
memory/tasks/ — active and completed tasks
For each file, note: line count, last modified, topic coverage, staleness.
Look for these common issues:
| Problem | Signal | Fix |
|---|---|---|
| Bloated file | >300 lines, covers many topics | Split into focused files |
| Duplicate info | Same fact in multiple places | Consolidate to one location |
| Stale entries | References to completed work, old dates, resolved issues | Remove or archive |
| Orphan files | Files in memory/ never referenced or updated | Review, merge, or remove |
| Inconsistencies | Contradictory information across files | Resolve to ground truth |
| Poor organization | Related info scattered across files | Restructure by topic |
| Recursive nesting | memory/memory/memory/... directories | Delete nested dirs (indexer bug artifact) |
Before making edits, write a brief plan:
## Defrag Plan
- [ ] Split MEMORY.md "Key People" section → memory/people.md
- [ ] Remove completed tasks older than 30 days from memory/tasks/
- [ ] Merge memory/bm-marketing-ideas.md into memory/competitive/
- [ ] Update stale project status entries in MEMORY.md
Apply changes one at a time:
After changes:
Verify no information was lost (compare before/after)
Update any cross-references between files
Log what was done in today's daily note:
memory/YYYY-MM-DD.md files — they're the audit trail.people.md, project-status.md, competitive-landscape.md — not notes-2.md.memory/tasks/ and memory/competitive/ are fine; memory/work/projects/active/basic-memory/notes/ is not.Weekly Installs
29
Repository
GitHub Stars
4
First Seen
Feb 22, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex26
github-copilot24
kimi-cli24
gemini-cli24
cursor24
amp24
GitHub Actions 官方文档查询助手 - 精准解答 CI/CD 工作流问题
45,200 周安装
status: done(review needed) tag rather than deleting.