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