Skip to content

Commit 7bd1620

Browse files
authored
Update-memory-prompts (#304)
* Update Memory Keeper prompt * Make memory keeper handle workspace scope too * Add prompt for merging memories saved by memory keeper/remember * Fix missing domain syntax * node ./update-readme.js
1 parent 230c081 commit 7bd1620

File tree

3 files changed

+159
-24
lines changed

3 files changed

+159
-24
lines changed

README.prompts.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ Ready-to-use prompt templates for specific development scenarios and tasks, defi
6262
| [Java Documentation (Javadoc) Best Practices](prompts/java-docs.prompt.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fjava-docs.prompt.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fjava-docs.prompt.md) | Ensure that Java types are documented with Javadoc comments and follow best practices for documentation. |
6363
| [Javascript Typescript Jest](prompts/javascript-typescript-jest.prompt.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fjavascript-typescript-jest.prompt.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fjavascript-typescript-jest.prompt.md) | Best practices for writing JavaScript/TypeScript tests using Jest, including mocking strategies, test structure, and common patterns. |
6464
| [JUnit 5+ Best Practices](prompts/java-junit.prompt.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fjava-junit.prompt.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fjava-junit.prompt.md) | Get best practices for JUnit 5 unit testing, including data-driven tests |
65-
| [Memory Keeper](prompts/remember.prompt.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fremember.prompt.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fremember.prompt.md) | Contemplates repeated mistakes and success patterns, and transforms lessons learned into domain-organized Copilot instructions. Automatically discovers existing memory domains, intelligently categorizes new learnings, and creates domain-specific instruction files in VS Code User Data Directory. You can make the categorization/domain designation specific by using `>domain-name` as the first thing in your request. Like so: `/remember >domain-name lesson content here` |
65+
| [Memory Keeper](prompts/remember.prompt.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fremember.prompt.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fremember.prompt.md) | Transforms lessons learned into domain-organized memory instructions (global or workspace). Syntax: `/remember [>domain [scope]] lesson clue` where scope is `global` (default), `user`, `workspace`, or `ws`. |
66+
| [Memory Merger](prompts/memory-merger.prompt.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fmemory-merger.prompt.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fmemory-merger.prompt.md) | Merges mature lessons from a domain memory file into its instruction file. Syntax: `/memory-merger >domain [scope]` where scope is `global` (default), `user`, `workspace`, or `ws`. |
6667
| [Microsoft 365 Declarative Agents Development Kit](prompts/declarative-agents.prompt.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fdeclarative-agents.prompt.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fdeclarative-agents.prompt.md) | Complete development kit for Microsoft 365 Copilot declarative agents with three comprehensive workflows (basic, advanced, validation), TypeSpec support, and Microsoft 365 Agents Toolkit integration |
6768
| [Migration and Code Evolution Instructions Generator](prompts/generate-custom-instructions-from-codebase.prompt.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fgenerate-custom-instructions-from-codebase.prompt.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fgenerate-custom-instructions-from-codebase.prompt.md) | Migration and code evolution instructions generator for GitHub Copilot. Analyzes differences between two project versions (branches, commits, or releases) to create precise instructions allowing Copilot to maintain consistency during technology migrations, major refactoring, or framework version upgrades. |
6869
| [MkDocs AI Translator](prompts/mkdocs-translations.prompt.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fmkdocs-translations.prompt.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fmkdocs-translations.prompt.md) | Generate a language translation for a mkdocs documentation stack. |

prompts/memory-merger.prompt.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
---
2+
description: 'Merges mature lessons from a domain memory file into its instruction file. Syntax: `/memory-merger >domain [scope]` where scope is `global` (default), `user`, `workspace`, or `ws`.'
3+
---
4+
5+
# Memory Merger
6+
7+
You consolidate mature learnings from a domain's memory file into its instruction file, ensuring knowledge preservation with minimal redundancy.
8+
9+
**Use the todo list** to track your progress through the process steps and keep the user informed.
10+
11+
## Scopes
12+
13+
Memory instructions can be stored in two scopes:
14+
15+
- **Global** (`global` or `user`) - Stored in `<global-prompts>` (`vscode-userdata:/User/prompts/`) and apply to all VS Code projects
16+
- **Workspace** (`workspace` or `ws`) - Stored in `<workspace-instructions>` (`<workspace-root>/.github/instructions/`) and apply only to the current project
17+
18+
Default scope is **global**.
19+
20+
Throughout this prompt, `<global-prompts>` and `<workspace-instructions>` refer to these directories.
21+
22+
## Syntax
23+
24+
```
25+
/memory-merger >domain-name [scope]
26+
```
27+
28+
- `>domain-name` - Required. The domain to merge (e.g., `>clojure`, `>git-workflow`, `>prompt-engineering`)
29+
- `[scope]` - Optional. One of: `global`, `user` (both mean global), `workspace`, or `ws`. Defaults to `global`
30+
31+
**Examples:**
32+
- `/memory-merger >prompt-engineering` - merges global prompt engineering memories
33+
- `/memory-merger >clojure workspace` - merges workspace clojure memories
34+
- `/memory-merger >git-workflow ws` - merges workspace git-workflow memories
35+
36+
## Process
37+
38+
### 1. Parse Input and Read Files
39+
40+
- **Extract** domain and scope from user input
41+
- **Determine** file paths:
42+
- Global: `<global-prompts>/{domain}-memory.instructions.md``<global-prompts>/{domain}.instructions.md`
43+
- Workspace: `<workspace-instructions>/{domain}-memory.instructions.md``<workspace-instructions>/{domain}.instructions.md`
44+
- 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.
45+
- **Read** both files (memory file must exist; instruction file may not)
46+
47+
### 2. Analyze and Propose
48+
49+
Review all memory sections and present them for merger consideration:
50+
51+
```
52+
## Proposed Memories for Merger
53+
54+
### Memory: [Headline]
55+
**Content:** [Key points]
56+
**Location:** [Where it fits in instructions]
57+
58+
[More memories]...
59+
```
60+
61+
Say: "Please review these memories. Approve all with 'go' or specify which to skip."
62+
63+
**STOP and wait for user input.**
64+
65+
### 3. Define Quality Bar
66+
67+
Establish 10/10 criteria for what constitutes awesome merged resulting instructions:
68+
1. **Zero knowledge loss** - Every detail, example, and nuance preserved
69+
2. **Minimal redundancy** - Overlapping guidance consolidated
70+
3. **Maximum scannability** - Clear hierarchy, parallel structure, strategic bold, logical grouping
71+
72+
### 4. Merge and Iterate
73+
74+
Develop the final merged instructions **without updating files yet**:
75+
76+
1. Draft the merged instructions incorporating approved memories
77+
2. Evaluate against quality bar
78+
3. Refine structure, wording, organization
79+
4. Repeat until the merged instructions meet 10/10 criteria
80+
81+
### 5. Update Files
82+
83+
Once the final merged instructions meet 10/10 criteria:
84+
85+
- **Create or update** the instruction file with the final merged content
86+
- Include proper frontmatter if creating new file
87+
- **Merge `applyTo` patterns** from both memory and instruction files if both exist, ensuring comprehensive coverage without duplication
88+
- **Remove** merged sections from the memory file
89+
90+
## Example
91+
92+
```
93+
User: "/memory-merger >clojure"
94+
95+
Agent:
96+
1. Reads clojure-memory.instructions.md and clojure.instructions.md
97+
2. Proposes 3 memories for merger
98+
3. [STOPS]
99+
100+
User: "go"
101+
102+
Agent:
103+
4. Defines quality bar for 10/10
104+
5. Merges new instructions candidate, iterates to 10/10
105+
6. Updates clojure.instructions.md
106+
7. Cleans clojure-memory.instructions.md
107+
```

prompts/remember.prompt.md

Lines changed: 50 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
---
2-
description: 'Contemplates repeated mistakes and success patterns, and transforms lessons learned into domain-organized Copilot instructions. Automatically discovers existing memory domains, intelligently categorizes new learnings, and creates domain-specific instruction files in VS Code User Data Directory. You can make the categorization/domain designation specific by using `>domain-name` as the first thing in your request. Like so: `/remember >domain-name lesson content here`'
2+
description: 'Transforms lessons learned into domain-organized memory instructions (global or workspace). Syntax: `/remember [>domain [scope]] lesson clue` where scope is `global` (default), `user`, `workspace`, or `ws`.'
33
---
44

55
# Memory Keeper
66

7-
You are an expert keeper of **domain-organized Memory Instructions** that persist across all VS Code projects. You maintain a self-organizing knowledge base that automatically categorizes learnings by domain and creates new memory files as needed in the `vscode-userdata:/User/prompts/` folder.
7+
You are an expert prompt engineer and keeper of **domain-organized Memory Instructions** that persist across VS Code contexts. You maintain a self-organizing knowledge base that automatically categorizes learnings by domain and creates new memory files as needed.
8+
9+
## Scopes
10+
11+
Memory instructions can be stored in two scopes:
12+
13+
- **Global** (`global` or `user`) - Stored in `<global-prompts>` (`vscode-userdata:/User/prompts/`) and apply to all VS Code projects
14+
- **Workspace** (`workspace` or `ws`) - Stored in `<workspace-instructions>` (`<workspace-root>/.github/instructions/`) and apply only to the current project
15+
16+
Default scope is **global**.
17+
18+
Throughout this prompt, `<global-prompts>` and `<workspace-instructions>` refer to these directories.
819

920
## Your Mission
1021

@@ -17,16 +28,24 @@ Transform debugging sessions, workflow discoveries, frequently repeated mistakes
1728

1829
The result: a **self-organizing, domain-driven knowledge base** that grows smarter with every lesson learned.
1930

20-
## Domain Syntax
31+
## Syntax
32+
33+
```
34+
/remember [>domain-name [scope]] lesson content
35+
```
2136

22-
Users can optionally specify target domains using:
23-
- `/remember >domain-name lesson content here` - explicitly targets a domain
24-
- `/remember lesson content here` - agent determines appropriate domain(s)
37+
- `>domain-name` - Optional. Explicitly target a domain (e.g., `>clojure`, `>git-workflow`)
38+
- `[scope]` - Optional. One of: `global`, `user` (both mean global), `workspace`, or `ws`. Defaults to `global`
39+
- `lesson content` - Required. The lesson to remember
2540

26-
Examples:
41+
**Examples:**
2742
- `/remember >shell-scripting now we've forgotten about using fish syntax too many times`
2843
- `/remember >clojure prefer passing maps over parameter lists`
29-
- `/remember always check terminal output encoding when seeing weird characters`
44+
- `/remember avoid over-escaping`
45+
- `/remember >clojure workspace prefer threading macros for readability`
46+
- `/remember >testing ws use setup/teardown functions`
47+
48+
**Use the todo list** to track your progress through the process steps and keep the user informed.
3049

3150
## Memory File Structure
3251

@@ -48,28 +67,36 @@ Each distinct lesson has its own level 2 headline
4867

4968
## Process
5069

51-
1. **Parse domain syntax** - Check if user specified `>domain-name` to target specific domain
52-
2. **Glob and Read** existing `vscode-userdata:/User/prompts/memory.instructions.md` and `vscode-userdata:/User/prompts/*-memory.instructions.md` files to understand current domain structure
53-
3. **Analyze** the specific lesson learned from user input
70+
1. **Parse input** - Extract domain (if `>domain-name` specified) and scope (`global` is default, or `user`, `workspace`, `ws`)
71+
2. **Glob and Read the start of** existing memory and instruction files to understand current domain structure:
72+
- Global: `<global-prompts>/memory.instructions.md`, `<global-prompts>/*-memory.instructions.md`, and `<global-prompts>/*.instructions.md`
73+
- Workspace: `<workspace-instructions>/memory.instructions.md`, `<workspace-instructions>/*-memory.instructions.md`, and `<workspace-instructions>/*.instructions.md`
74+
3. **Analyze** the specific lesson learned from user input and chat session content
5475
4. **Categorize** the learning:
5576
- New gotcha/common mistake
5677
- Enhancement to existing section
5778
- New best practice
5879
- Process improvement
59-
5. **Determine target domain(s)**:
80+
5. **Determine target domain(s) and file paths**:
6081
- If user specified `>domain-name`, request human input if it seems to be a typo
61-
- Otherwise, intelligently match learning to a domain, using existing domain files as a guide while recognizing there may be coverage gaps.
62-
- For universal learnings, use `vscode-userdata:/User/prompts/memory.instructions.md`
63-
- If no good domain match exists, create new domain-specific file like `vscode-userdata:/User/prompts/{domain}-memory.instructions.md`
82+
- Otherwise, intelligently match learning to a domain, using existing domain files as a guide while recognizing there may be coverage gaps
83+
- **For universal learnings:**
84+
- Global: `<global-prompts>/memory.instructions.md`
85+
- Workspace: `<workspace-instructions>/memory.instructions.md`
86+
- **For domain-specific learnings:**
87+
- Global: `<global-prompts>/{domain}-memory.instructions.md`
88+
- Workspace: `<workspace-instructions>/{domain}-memory.instructions.md`
6489
- When uncertain about domain classification, request human input
65-
6. **Update or create files**:
66-
- Update existing domain files with new learnings
67-
- Create new domain files following [Memory File Structure](#memory-file-structure)
90+
6. **Read the domain and domain memory files**
91+
- Read to avoid redundancy. Any memories you add should complement existing instructions and memories.
92+
7. **Update or create memory files**:
93+
- Update existing domain memory files with new learnings
94+
- Create new domain memory files following [Memory File Structure](#memory-file-structure)
6895
- Update `applyTo` frontmatter if needed
69-
7. **Write** succinct, clear, and actionable instructions:
70-
- **Extract general (within the domain) patterns** from specific instances
71-
- Use positive reinforcement focusing on correct patterns
72-
- Brief explanations of WHY, when helpful
96+
8. **Write** succinct, clear, and actionable instructions:
97+
- Instead of comprehensive instructions, think about how to capture the lesson in a succinct and clear manner
98+
- **Extract general (within the domain) patterns** from specific instances, the user may want to share the instructions with people for whom the specifics of the learning may not make sense
99+
- Instead of “don't”s, use positive reinforcement focusing on correct patterns
73100
- Capture:
74101
- Coding style, preferences, and workflow
75102
- Critical implementation paths
@@ -83,7 +110,7 @@ Each distinct lesson has its own level 2 headline
83110
- Be specific and concrete (avoid vague advice)
84111
- Include code examples when relevant
85112
- Focus on common, recurring issues
86-
- Keep instructions scannable and actionable
113+
- Keep instructions succinct, scannable, and actionable
87114
- Clean up redundancy
88115
- Instructions focus on what to do, not what to avoid
89116

0 commit comments

Comments
 (0)