content/skills/workflow-skills/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
如果首次运行报依赖缺失,提示用户手动安装 Python 依赖:
pip3 install sentence-transformers numpy
all-MiniLM-L6-v2(~80MB,首次运行自动下载)python3 "$SKILL_DIR/scripts/memory.py" search "用户的查询" \
--db ./memory/memory.sqlite --json --top 6
读取 JSON 结果后,用搜索到的上下文回答用户问题。如果数据库不存在,先执行索引。
将内容写入 memory/ 目录的 .md 文件:
python3 "$SKILL_DIR/scripts/memory.py" add "内容" \
--file 合适的文件名.md --dir ./memory --db ./memory/memory.sqlite
python3 "$SKILL_DIR/scripts/memory.py" index \
--dir ./memory --db ./memory/memory.sqlite
可选:通过 --memory-file 指定额外索引的文件:
python3 "$SKILL_DIR/scripts/memory.py" index \
--dir ./memory --db ./memory/memory.sqlite --memory-file ./MEMORY.md
python3 "$SKILL_DIR/scripts/memory.py" status \
--db ./memory/memory.sqlite -v
python3 "$SKILL_DIR/scripts/memory.py" cleanup \
--days 90 --dir ./memory --force
./memory/ 和 --db 路径相对于项目工作目录--json 输出适合程序解析,不加则人类可读| 问题 | 解决方案 |
|------|----------|
| ModuleNotFoundError: sentence_transformers | 运行 pip3 install sentence-transformers numpy |
| ModuleNotFoundError: numpy | 运行 pip3 install numpy |
| 搜索无结果 | 先运行 index 命令建立索引 |
| FTS5 不可用 | 不影响使用,向量搜索仍可工作,仅全文搜索降级 |
| 索引后数据库损坏 | 删除 .sqlite 文件后重新索引 |
development
Implement safe, behavior-preserving code refactors after inspecting the existing project. Use when the user asks to refactor code, split large files or modules, extract functions or methods, reduce duplicated logic, rename confusing classes/functions/variables, improve code comments, remove unused or dead code, or says 重构代码, 拆分模块, 提取方法, 减少重复代码, 优化命名, 优化注释, 删除未调用代码. For broad refactor requests, plan safe slices and wait for approval; for narrow scoped requests, directly implement the smallest verifiable slice.
development
Use only when the user explicitly asks for swarm, subagents, parallel agents, dynamic workflow, multi-agent orchestration, 多智能体编排, or when the task truly needs coordinated research plus implementation plus review plus verification packets. Do not use for ordinary code review, planning-only work, single-line bugfixes, routine audits, or migrations unless orchestration is requested or at least two independent workflow dimensions are present.
development
Run a code quality review focused on maintainability, structure, abstraction quality, file growth, branching complexity, boundary cleanliness, and refactoring opportunities. Use when the user asks for code quality review, code review, maintainability review, architecture quality review, PR code quality feedback, 代码质量审查, 代码质量 review, 可维护性审查, 架构质量审查, or review comments about code structure. Do not use for pure security review, formatting-only review, performance profiling, or implementation tasks unless the user also asks for a code quality review.
development
Plan-first brainstorming workflow that turns an idea into an approved Markdown implementation plan by default. Use when the user wants to brainstorm, design, scope, or plan a feature/spec before implementation. Spark explores project context, asks only blocking questions, writes the plan under the project root's .plannings/YYYY-MM-DD-feature-slug.md path, self-reviews it, and waits for user approval. Create an HTML or visual plan/spec only when the user explicitly asks for HTML, browser-viewable, or visual output; save the paired .html beside the Markdown plan.