56 results available
Sign in
Skills directory

memory-merger

github

·

Last changed
Not yet hardened

This version isn't hardened by Chainguard

No hardening report available.


SKILL.md

Memory 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.

Tool Access

This skill requires only the following tool operations, scoped strictly to instruction directories:

  • read_file — read .instructions.md files from vscode-userdata:/User/prompts/ (global) or <workspace-root>/.github/instructions/ (workspace) only.
  • write_file — write .instructions.md files to those same directories only. Never write to any other path.
  • list_directory — list contents of those two directories only.

If the resolved file path falls outside these directories for any reason, stop immediately and report the anomaly to the user.

Scopes

Memory instructions can be stored in two scopes:

  • Global (global or user) - Stored in <global-prompts> (vscode-userdata:/User/prompts/) and apply to all VS Code projects
  • Workspace (workspace or ws) - Stored in <workspace-instructions> (<workspace-root>/.github/instructions/) and apply only to the current project

Default scope is workspace.

Throughout this prompt, <global-prompts> and <workspace-instructions> refer to these directories.

Syntax

/memory-merger >domain-name [scope]
  • >domain-name - Required. The domain to merge (e.g., >clojure, >git-workflow, >prompt-engineering)
  • [scope] - Optional. One of: workspace or ws (default, current project only), global or user (writes to VS Code global store, affects all projects — use explicitly and deliberately).

Examples:

  • /memory-merger >prompt-engineering - merges workspace prompt engineering memories (default scope)
  • /memory-merger >clojure workspace - merges workspace clojure memories
  • /memory-merger >git-workflow ws - merges workspace git-workflow memories
  • /memory-merger >clojure global - merges global clojure memories (affects all VS Code projects)

Process

1. Parse Input and Read Files

  • Extract domain and scope from user input
  • Validate the domain value before constructing any path:
    • It must match the pattern ^[a-zA-Z0-9][a-zA-Z0-9_-]*$ (letters, digits, hyphens, underscores; must start with a letter or digit).
    • If it contains /, \, ., spaces, or any other character not in this set, stop immediately and say: "Invalid domain name {domain}. Domain names must contain only letters, numbers, hyphens, and underscores. Please try again."
    • Do not proceed to path construction or file operations until validation passes.
  • 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
  • If the memory file is not found, list the contents of the relevant directory and display all candidate .instructions.md files to the user. Always require explicit user confirmation before proceeding with any candidate — show the full filename and ask the user to confirm it is the intended file. Never auto-select any match, even a single candidate.
  • Read both files (memory file must exist; instruction file may not)

2. Analyze and Propose

Review all memory sections and present them for merger consideration:

## Proposed 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.

3. Define Quality Bar

Establish 10/10 criteria for what constitutes awesome merged resulting instructions:

  1. Zero knowledge loss - Every detail, example, and nuance preserved
  2. Minimal redundancy - Overlapping guidance consolidated
  3. Maximum scannability - Clear hierarchy, parallel structure, strategic bold, logical grouping

4. Merge and Iterate

Develop the final merged instructions without updating files yet:

  1. Draft the merged instructions incorporating approved memories
  2. Evaluate against quality bar
  3. Refine structure, wording, organization
  4. Repeat until the merged instructions meet 10/10 criteria

5. Preview and Confirm

Present the complete, exact content that will be written to {path} — every character, including frontmatter — as a fenced code block so the user can review verbatim what will be persisted.

Say: "This is exactly what will be written to {path}. Reply 'confirm' to proceed, or describe any changes you want."

STOP and wait for explicit user confirmation. Do not write any file until you receive 'confirm' or an equivalent affirmative.

6. Update Files

Once the user has confirmed:

  • Create or update the instruction file with the final, user-approved content.
    • Include proper frontmatter if creating a new file.
    • applyTo frontmatter handling:
      • If the instruction file already exists and contains applyTo patterns, preserve those patterns unchanged.
      • If the memory file contains applyTo patterns that differ from the instruction file's, present each new pattern to the user individually and ask: "The memory file adds applyTo: {pattern}. Add this to the instruction file?" Do not merge any applyTo pattern without explicit per-pattern user confirmation.
      • If creating a new instruction file with no prior applyTo, use only patterns the user explicitly provides or confirms.
  • Remove merged sections from the memory file.

Example

User: "/memory-merger >clojure"

Agent:
1. Validates domain "clojure" — passes
2. Reads clojure-memory.instructions.md and clojure.instructions.md
3. Proposes 3 memories for merger
4. [STOPS]

User: "go"

Agent:
5. Defines quality bar for 10/10
6. Merges new instructions candidate, iterates to 10/10
7. Previews complete final content for user approval
8. [STOPS for confirmation]

User: "confirm"

Agent:
9. Updates clojure.instructions.md
10. Cleans clojure-memory.instructions.md

Install

Need this version hardened?

Harden your own skills

Bring Chainguard's hardening pipeline to your first-party skills — custom rulesets, automated remediation, full audit trail.

Provenance

Upstream source

—

Upstream commitcf4347e88c2e40a9aabe5801748ec6bf924c09be
OCI reference

—

License

MIT

Files

HARDENING.md

LICENSE

SKILL.md


The trusted source for open source

Talk to an expert
PrivacyTerms

Product

Chainguard ContainersChainguard LibrariesChainguard VMsChainguard OS PackagesChainguard ActionsChainguard Agent SkillsIntegrationsPricing
© 2026 Chainguard, Inc. All Rights Reserved.
Chainguard® and the Chainguard logo are registered trademarks of Chainguard, Inc. in the United States and/or other countries.
The other respective trademarks mentioned on this page are owned by the respective companies and use of them does not imply any affiliation or endorsement.