content/skills/research-learning-knowledge/memory-system/SKILL.md
本地记忆系统,将 Markdown 文件索引到 SQLite 实现跨会话语义搜索。当用户提到:记忆、memory、知识库、索引笔记、搜索记忆、跨会话记忆、记住这个、memory search、memory index、memory status、回忆、查找记忆 时触发。支持增量索引、混合搜索(向量+全文)、记忆添加和清理;不适用于云同步或跨设备共享。
npx skillsauth add bahayonghang/my-claude-code-settings memory-systemInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
脚本路径:$SKILL_DIR/scripts/memory.py
这个 skill 负责三件事:把笔记存下来、把笔记建立索引、把相关记忆重新找回来。
如果首次运行报依赖缺失,提示用户手动安装 Python 依赖,不要在主流程里自动安装:
python -m pip install sentence-transformers numpy
all-MiniLM-L6-v2当用户说“搜索记忆”“在记忆中查找 X”或相近表达时:
python "$SKILL_DIR/scripts/memory.py" search "用户查询" \
--db ./memory/memory.sqlite --json --top 6
执行前检查:
index回答时不要只贴 JSON。要给用户:
当用户说“记住这个”“添加到记忆”时:
python "$SKILL_DIR/scripts/memory.py" add "内容" \
--file 合适的文件名.md --dir ./memory --db ./memory/memory.sqlite
执行后报告:
当用户说“索引记忆”“更新记忆索引”时:
python "$SKILL_DIR/scripts/memory.py" index \
--dir ./memory --db ./memory/memory.sqlite
如果还要索引额外文件:
python "$SKILL_DIR/scripts/memory.py" index \
--dir ./memory --db ./memory/memory.sqlite --memory-file ./MEMORY.md
当用户说“记忆状态”或 memory status:
python "$SKILL_DIR/scripts/memory.py" status \
--db ./memory/memory.sqlite -v
把技术输出翻译成用户看得懂的状态说明,例如:
当用户说“清理记忆”时:
python "$SKILL_DIR/scripts/memory.py" cleanup \
--days 90 --dir ./memory --force
在执行前先确认这是删除旧记忆,不是仅重建索引。
./memory/ 和 --db 路径都相对于当前项目工作目录./memory/ 目录,先创建再执行| 问题 | 解决方案 |
|------|----------|
| ModuleNotFoundError: sentence_transformers | 运行 python -m pip install sentence-transformers numpy |
| ModuleNotFoundError: numpy | 运行 python -m pip install numpy |
| 搜索无结果 | 先运行 index 建立索引,再缩短或改写查询 |
| FTS5 不可用 | 向量搜索仍可用,仅全文搜索降级 |
| 索引后数据库损坏 | 删除 .sqlite 后重新索引 |
tools
文献深度解读助手,像研究生导师一样交互式解读 Zotero 库中的学术论文,面向计算机科学、深度学习、自动化等方向(个人向)。当用户提供文献题目、DOI、PDF 或要求解读某篇论文时触发,通过 Zotero MCP 优先获取全文,并根据用户意图自动选择快速筛选、导师深读或研究复盘模式。完整深读时先完成叙事类型判断、阅读前预检、novelty 校准和作者思考路径重建,再整体概览,并基于图例、正文和表格逐图详细解读(Zotero MCP 无法提取 PDF 图片,解读基于文字信息,必要时提醒上传图片)。适用于:(1)快速判断文献是否值得深读 (2)深入理解某篇论文 (3)学习文章中的方法和技术 (4)批判性分析研究设计 (5)寻找研究灵感。需要多篇论文综合、对比或找研究空白,或 arXiv/DOI 批量规范化时,改用 paper-workbench。
development
Review Codex, Claude, OpenAI, or other agent skill directories as reusable capability packages. Use when asked to audit, review, improve, score, rewrite, debrand, package, or document a SKILL.md, skill package, marketplace skill, or agent skill directory, especially when the user wants a comprehensive findings-first report with concrete patch recommendations and validation steps.
development
Turn vague or complex Codex tasks into strong `/goal` commands with outcome, verification, constraints, boundaries, iteration policy, completion evidence, and pause/block conditions. Use when the user asks for Codex goal instructions, Goal 指令, 目标指令, `/goal` prompts, 中文 Goal 模板, plan-to-goal interviews, success criteria, verification commands, or bounded agent work definitions.
tools
Write, debug, and validate ast-grep structural code search rules. Use this skill when the user needs syntax-aware code search, AST pattern matching, structural refactor discovery, language-construct queries, or searches that plain text tools like rg can miss, such as finding functions with particular descendants, calls inside specific contexts, missing error handling, React hook shapes, decorators, or other Tree-sitter-backed code structures.