The Agent Skills Directory
npx skills add https://smithery.ai/skills/hongbietcode/project-memory-store⚠️ 执行上下文:此技能必须使用 subagent_type="general-purpose" 的 Task 工具执行。在独立的上下文中运行,以避免污染主对话。
目的:提取并存储项目特定的洞察(情景/程序/语义)到基于文件的记忆中,位置为 .claude/skills/project-memory-store/。
关键架构:此 SKILL.md 文件 + 子目录中的 README.md 文件构成了一个树状指南结构,用于渐进式披露信息——顶层为概述,细节在深层。这对于信息检索非常有效。
保持 SKILL.md 简洁:提供概述并引用其他文件。当此文件变得臃肿时,将内容拆分到单独的文件中并引用它们。相信 Claude 只在需要时读取详细文件。
使用时机:
关键:存储成功和失败的轨迹。失败同样重要——通常比成功更有价值。本项目中的失败方法教导了不该做什么以及原因。
不应使用的时机:
选择标准:大多数对话产生 0-1 个项目特定洞察。专注于未来对此代码库的工作有益的细节。
检查记忆目录是否存在于 .claude/skills/project-memory-store/:
episodic/ - 此项目中的具体事件procedural/ - 项目特定的工作流程semantic/ - 项目模式和原则如果缺失,则创建目录并初始化每个目录为单个文件:
episodic/episodic.mdprocedural/procedural.mdsemantic/semantic.md当结构发生变化时,根据需要更新 SKILL.md(此文件)——修改任何部分以保持其准确性和实用性。
分析对话并提取 0-3 个洞察(大多数产生 0-1 个)。
将每个分类为:
提取标准(所有必须为真):
拒绝:
对于每个提取的洞察:
步骤 1:确定目标记忆类型(情景/程序/语义)
步骤 2(可选):首先尝试向量搜索
如果 Qdrant MCP 服务器可用,尝试对相似记忆进行语义搜索:
从新记忆构造查询 - 使用完整格式化的记忆文本以获得更好的匹配:
调用 search_memory MCP 工具:
search_memory( query="<full formatted memory text>", memory_level="project", limit=5 )
提取 file_path 提示和相似度分数
如果结果 <3 个或工具不可用:继续下面的基于文件的搜索
重要:向量结果可能已过时。将其用作指导文件搜索的提示,而非绝对真理。
步骤 3:基于文件的搜索(主要方法)
.claude/skills/project-memory-store/episodic/)步骤 4:检查相似性
决策矩阵(基于文件的整合):
| 相似性 | 操作 | 理由 |
|---|---|---|
| 重复/非常相似 | 合并 | 合并为单个更强的条目 |
| 相关(相同主题) | 更新 | 用新信息更新现有记忆 |
| 模式出现 | 泛化 | 提取模式 → 将情景记忆提升为语义记忆 |
| 不同 | 创建 | 新文件或独立部分 |
操作:
合并(重复或非常相似):
更新(相关,相同主题):
泛化(从多个情景记忆中出现模式):
创建(不同主题):
关键:使用紧凑格式以防止记忆膨胀。每个记忆 = 最多 3-5 句话。
通用格式(适用于所有记忆类型):
**标题:** <简洁的标题>
**描述:** <一句话总结>
**内容:** <3-5 句话涵盖:此项目中发生了什么,尝试了什么(包括失败),什么有效/失败,关键教训,相关文件/组件>
**标签:** #tag1 #tag2 #success OR #failure
格式化规则:
确定存储位置:
episodic/authentication/ 是最深的)执行存储:
写入文件(单一事实来源):
可选:双重写入到 Qdrant:
如果 Qdrant MCP 服务器可用,也存储到向量数据库:
store_memory(
document="<full formatted memory text>",
metadata={
"memory_level": "project",
"memory_type": "<episodic|procedural|semantic>",
"file_path": "<relative path from project-memory-store/>",
"skill_root": "project-memory-store",
"tags": ["<tag1>", "<tag2>"],
"title": "<memory title>",
"created_at": "<ISO timestamp>",
"last_synced": "<ISO timestamp>"
},
memory_level="project"
)
* 如果双重写入失败:记录警告但继续(文件写入已成功)
* 如果工具不可用:静默跳过
3. 交叉提升检查:如果泛化的模式是通用的(非项目特定):
* 调用 coder-memory-store 技能来存储通用版本
* 将项目特定版本保留在 project-memory 中,并注明:"**另见:** coder-memory 中的通用模式"
4. 如果文件因不相关信息变得"过长":
* 创建以主题命名的子目录
* 将相关记忆移动到子目录中的新文件
* 在子目录中创建 README.md 作为概述
5. 更新父级 README.md 以引用新结构
如果目录结构发生变化(创建了新的子目录):
description格式:
✅ 项目记忆存储完成
**项目:** <项目名称>
**提取的洞察:** <数量> 个项目特定细节
- 情景:<数量>
- 程序:<数量>
- 语义:<数量>
**存储操作:**
- 合并:<数量>
- 更新:<数量>
- 泛化:<数量>
- 创建:<数量>
**交叉提升:**
- 提升到 coder-memory(通用模式):<数量>
**质量检查:**
- ✓ 所有洞察都是项目特定的
- ✓ 所有洞察都是非显而易见的
- ✓ 保持了文件组织(最多 2 级深度)
- ✓ 通用模式已提升到 coder-memory
如果提取了 0 个洞察:
✅ 项目记忆存储完成
**提取的洞察:** 0(对话包含通用模式或常规工作)
考虑使用 coder-memory-store 处理通用模式。
当组织变得不清晰时,此技能的记忆文件可以由 project-memory-recall 进行重构。如果需要,回忆技能将调用通用代理来重组结构。
关键:通过 Task 工具调用通用代理。切勿在主上下文中直接执行。
每周安装次数
–
来源
首次出现
–
⚠️ EXECUTION CONTEXT : This Skill MUST be executed using Task tool with subagent_type="general-purpose". Runs in separate context to avoid polluting main conversation.
Purpose : Extract and store project-specific insights (episodic/procedural/semantic) into file-based memory at .claude/skills/project-memory-store/.
Key Architecture : This SKILL.md + subdirectory README.md files form a tree guideline structure for progressive disclosure - overview at top, details deeper. This is very effective for information retrieval.
Keep SKILL.md lean : Provide overview and reference other files. When this file becomes unwieldy, split content into separate files and reference them. Trust Claude to read detailed files only when needed.
When to Use :
CRITICAL : Store BOTH successful AND failed trajectories. Failures are equally important - often MORE valuable than successes. Failed approaches in this project teach what NOT to do and why.
When NOT to Use :
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
Selection Criteria : Most conversations yield 0-1 project-specific insights. Focus on details future work on THIS codebase would benefit from.
Check if memory directories exist at .claude/skills/project-memory-store/:
episodic/ - Concrete events in this projectprocedural/ - Project-specific workflowssemantic/ - Project patterns and principlesIf missing, create directories and initialize each with single file:
episodic/episodic.mdprocedural/procedural.mdsemantic/semantic.mdUpdate SKILL.md (this file) as needed when structure changes - modify ANY part to keep it accurate and useful.
Analyze conversation and extract 0-3 insights (most yield 0-1).
Classify each as :
Extraction Criteria (ALL must be true):
Reject :
For each extracted insight:
Step 1: Determine target memory type (episodic/procedural/semantic)
Step 2 (Optional): Try Vector Search First
If Qdrant MCP server available , try semantic search for similar memories:
Construct query from new memory - Use full formatted memory for better matching:
Call search_memory MCP tool:
search_memory( query="<full formatted memory text>", memory_level="project", limit=5 )
Extract file_path hints and similarity scores
If <3 results or tool unavailable: Continue to file-based search below
IMPORTANT : Vector results may be outdated. Use as hints to guide file search, not as absolute truth.
Step 3: File-Based Search (Primary Method)
.claude/skills/project-memory-store/episodic/)Step 4: Check similarity
Decision Matrix (file-based consolidation):
| Similarity | Action | Rationale |
|---|---|---|
| Duplicate/Very Similar | MERGE | Combine into single stronger entry |
| Related (same topic) | UPDATER | Update existing memory with new information |
| Pattern Emerges | GENERALIZE | Extract pattern → promote episodic to semantic |
| Different | CREATE | New file or separate section |
Actions :
MERGE (duplicate or very similar):
UPDATER (related, same topic):
GENERALIZE (pattern emerges from multiple episodic memories):
CREATE (different topic):
CRITICAL: Use COMPACT format to prevent memory bloat. Each memory = 3-5 sentences MAX.
Universal Format (works for ALL memory types):
**Title:** <concise title>
**Description:** <one sentence summary>
**Content:** <3-5 sentences covering: what happened in this project, what was tried (including failures), what worked/failed, key lesson, relevant files/components>
**Tags:** #tag1 #tag2 #success OR #failure
Formatting Rules :
Determine storage location :
episodic/authentication/ is deepest)Execute storage :
Write to file (Source of Truth) :
Optional: Dual-Write to Qdrant :
If Qdrant MCP server available , also store to vector database:
store_memory(
document="<full formatted memory text>",
metadata={
"memory_level": "project",
"memory_type": "<episodic|procedural|semantic>",
"file_path": "<relative path from project-memory-store/>",
"skill_root": "project-memory-store",
"tags": ["<tag1>", "<tag2>"],
"title": "<memory title>",
"created_at": "<ISO timestamp>",
"last_synced": "<ISO timestamp>"
},
memory_level="project"
)
* If dual-write fails: Log warning but continue (file write already succeeded)
* If tool unavailable: Skip silently
3. Cross-promotion check : If generalized pattern is universal (not project-specific):
* Invoke coder-memory-store skill to store universal version
* Keep project-specific version in project-memory with note: "**See also:** coder-memory for universal pattern"
4. If file becomes "too long" with unrelated info:
* Create subdirectory with topic name
* Move related memories to new file in subdirectory
* Create README.md in subdirectory as overview
5. Update parent README.md to reference new structure
If directory structure changed (new subdirectories created):
description if neededFormat :
✅ Project Memory Storage Complete
**Project**: <project name>
**Insights Extracted**: <number> project-specific details
- Episodic: <number>
- Procedural: <number>
- Semantic: <number>
**Storage Actions**:
- Merged: <number>
- Updated: <number>
- Generalized: <number>
- Created: <number>
**Cross-Promotion**:
- Promoted to coder-memory (universal patterns): <number>
**Quality Check**:
- ✓ All insights are project-specific
- ✓ All insights are non-obvious
- ✓ File organization maintained (max 2-level depth)
- ✓ Universal patterns promoted to coder-memory
If 0 insights extracted :
✅ Project Memory Storage Complete
**Insights Extracted**: 0 (conversation contained universal patterns or routine work)
Consider using coder-memory-store for universal patterns.
This skill's memory files can be refactored by project-memory-recall when organization becomes unclear. The recall skill will invoke general-purpose agent to reorganize structure if needed.
CRITICAL : Invoke via Task tool with general-purpose agent. Never execute directly in main context.
Weekly Installs
–
Source
First Seen
–
超能力技能使用指南:AI助手技能调用优先级与工作流程详解
45,100 周安装