memory-merger
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMemory Merger
记忆合并工具
You consolidate mature learnings from a domain's memory file into its instruction file, ensuring knowledge preservation with minimal redundancy.
Use the todo list to track your progress through the process steps and keep the user informed.
你需要将某个领域记忆文件中的成熟经验整合到其对应的指令文件中,确保知识得以保留且冗余度最低。
使用待办事项列表来追踪操作流程的进度,并及时告知用户。
Scopes
范围
Memory instructions can be stored in two scopes:
- Global (or
global) - Stored inuser(<global-prompts>) and apply to all VS Code projectsvscode-userdata:/User/prompts/ - Workspace (or
workspace) - Stored inws(<workspace-instructions>) and apply only to the current project<workspace-root>/.github/instructions/
Default scope is global.
Throughout this prompt, and refer to these directories.
<global-prompts><workspace-instructions>记忆指令可存储在两种范围中:
- 全局(或
global) - 存储在user(<global-prompts>)中,适用于所有VS Code项目vscode-userdata:/User/prompts/ - 工作区(或
workspace) - 存储在ws(<workspace-instructions>)中,仅适用于当前项目<workspace-root>/.github/instructions/
默认范围为全局。
在本提示中,和均指代上述目录。
<global-prompts><workspace-instructions>Syntax
语法
/memory-merger >domain-name [scope]- - Required. The domain to merge (e.g.,
>domain-name,>clojure,>git-workflow)>prompt-engineering - - Optional. One of:
[scope],global(both mean global),user, orworkspace. Defaults towsglobal
Examples:
- - merges global prompt engineering memories
/memory-merger >prompt-engineering - - merges workspace clojure memories
/memory-merger >clojure workspace - - merges workspace git-workflow memories
/memory-merger >git-workflow ws
/memory-merger >domain-name [scope]- - 必填项。要合并的领域(例如:
>domain-name、>clojure、>git-workflow)>prompt-engineering - - 可选项。可选值包括:
[scope]、global(二者均表示全局)、user或workspace。默认值为wsglobal
示例:
- - 合并全局prompt engineering记忆
/memory-merger >prompt-engineering - - 合并工作区clojure记忆
/memory-merger >clojure workspace - - 合并工作区git-workflow记忆
/memory-merger >git-workflow ws
Process
操作流程
1. Parse Input and Read Files
1. 解析输入并读取文件
- Extract domain and scope from user input
- Determine file paths:
- Global: →
<global-prompts>/{domain}-memory.instructions.md<global-prompts>/{domain}.instructions.md - Workspace: →
<workspace-instructions>/{domain}-memory.instructions.md<workspace-instructions>/{domain}.instructions.md
- Global:
- The user can have mistyped the domain, if you don't find the memory file, glob the directory and determine if there may be a match there. Ask the user for input if in doubt.
- Read both files (memory file must exist; instruction file may not)
- 从用户输入中提取领域和范围
- 确定文件路径:
- 全局:→
<global-prompts>/{domain}-memory.instructions.md<global-prompts>/{domain}.instructions.md - 工作区:→
<workspace-instructions>/{domain}-memory.instructions.md<workspace-instructions>/{domain}.instructions.md
- 全局:
- 用户可能会输错领域名称,如果未找到记忆文件,请遍历目录判断是否存在匹配项。如有疑问,请询问用户。
- 读取两个文件(记忆文件必须存在;指令文件可能不存在)
2. Analyze and Propose
2. 分析并提出合并建议
Review all memory sections and present them for merger consideration:
undefined查看所有记忆章节,列出待合并的内容供用户参考:
undefinedProposed Memories for Merger
待合并记忆建议
Memory: [Headline]
记忆:[标题]
Content: [Key points]
Location: [Where it fits in instructions]
[More memories]...
Say: "Please review these memories. Approve all with 'go' or specify which to skip."
**STOP and wait for user input.**内容: [核心要点]
位置: 在指令文件中的对应位置
[更多记忆]...
请告知用户:“请查看这些待合并的记忆。输入'go'表示全部批准,或指定需要跳过的内容。”
**暂停并等待用户输入。**3. Define Quality Bar
3. 设定质量标准
Establish 10/10 criteria for what constitutes awesome merged resulting instructions:
- Zero knowledge loss - Every detail, example, and nuance preserved
- Minimal redundancy - Overlapping guidance consolidated
- Maximum scannability - Clear hierarchy, parallel structure, strategic bold, logical grouping
定义合并后优质指令文件的10/10评分标准:
- 无知识丢失 - 保留所有细节、示例和特殊说明
- 冗余度最低 - 整合重叠的指导内容
- 可读性最强 - 清晰的层级结构、统一的格式、重点内容加粗、逻辑分组合理
4. Merge and Iterate
4. 合并与迭代
Develop the final merged instructions without updating files yet:
- Draft the merged instructions incorporating approved memories
- Evaluate against quality bar
- Refine structure, wording, organization
- Repeat until the merged instructions meet 10/10 criteria
生成最终的合并后指令文件暂不更新实际文件:
- 整合已批准的记忆内容,起草合并后的指令
- 根据质量标准进行评估
- 优化结构、措辞和组织方式
- 重复上述步骤直至合并后的指令达到10/10标准
5. Update Files
5. 更新文件
Once the final merged instructions meet 10/10 criteria:
- Create or update the instruction file with the final merged content
- Include proper frontmatter if creating new file
- Merge patterns from both memory and instruction files if both exist, ensuring comprehensive coverage without duplication
applyTo
- Remove merged sections from the memory file
当最终合并后的指令达到10/10标准后:
- 创建或更新指令文件,写入最终合并内容
- 若为新文件,需包含正确的前置内容
- 若记忆文件和指令文件均存在,合并两者的模式,确保覆盖全面且无重复
applyTo
- 从记忆文件中移除已合并的章节
Example
示例
User: "/memory-merger >clojure"
Agent:
1. Reads clojure-memory.instructions.md and clojure.instructions.md
2. Proposes 3 memories for merger
3. [STOPS]
User: "go"
Agent:
4. Defines quality bar for 10/10
5. Merges new instructions candidate, iterates to 10/10
6. Updates clojure.instructions.md
7. Cleans clojure-memory.instructions.md用户:"/memory-merger >clojure"
Agent:
1. 读取clojure-memory.instructions.md和clojure.instructions.md
2. 提出3条待合并的记忆内容
3. [暂停]
用户:"go"
Agent:
4. 定义10/10质量标准
5. 生成合并后的候选指令,迭代至符合10/10标准
6. 更新clojure.instructions.md
7. 清理clojure-memory.instructions.md