Best for
- Use when memory count is high, search results feel noisy or repetitive, or periodic cleanup is needed to maintain memory quality.
mem0ai/mem0/integrations/mem0-plugin/.opencode-plugin/opencode-skills/mem0-dream/SKILL.md
Consolidates stored memories by merging duplicates, resolving contradictions, and pruning stale entries. Use when memory count is high, search results feel noisy or repetitive, or periodic cleanup is needed to maintain memory quality.
Decision brief
This skill performs a memory consolidation pass: it fetches all project memories, identifies near-duplicates, flags contradictions, and prunes stale entries based on configured retention policies. All proposed changes are shown as a diff for user approval before anything is modi…
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/mem0ai/mem0 --skill "integrations/mem0-plugin/.opencode-plugin/opencode-skills/mem0-dream"Inspect the Agent Skill "mem0-dream" from https://github.com/mem0ai/mem0/blob/b54710a3c3b9060971b288197aee87efa3cc4d98/integrations/mem0-plugin/.opencode-plugin/opencode-skills/mem0-dream/SKILL.md at commit b54710a3c3b9060971b288197aee87efa3cc4d98. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
Check for a project config file in the project root (current working directory):
Call getmemories to retrieve every memory for the active project:
Work entirely in-memory; do not modify anything yet.
Print a structured diff to the terminal before making any changes. Use exactly this format:
For each CONFLICT pair in the report, wait for the user to type A, B, or skip (case-insensitive). If they enter nothing (empty), treat as skip.
Permission review
The documentation asks the agent to create, modify, or delete local files.
Otherwise, create the lock file (write the current timestamp). Delete it when done (in all exit paths).Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 83/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 62,498 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
This skill performs a memory consolidation pass: it fetches all project memories, identifies near-duplicates, flags contradictions, and prunes stale entries based on configured retention policies. All proposed changes are shown as a diff for user approval before anything is modified.
IMPORTANT: Execute steps strictly in order (1 → 2 → 3 → 4 → 5 → 6). Each step depends on the previous one. Do NOT run steps in parallel or skip ahead.
Check for a project config file in the project root (current working directory):
.mem0.json first. If it exists, parse it as JSON and read the
retention field (a dict of category → days | null)..mem0.json is not present, look for .mem0.md. If it exists, scan it
for a retention: section or YAML front matter with retention settings and
parse what you find.If no config is found or the config contains no retention settings, fall back to these built-in defaults:
metadata.type | Default retention |
|---|---|
session_state | 90 days |
compact_summary | 90 days |
| all others | no pruning |
Store the resolved policies for use in Step 3.
Call get_memories to retrieve every memory for the active project:
get_memories(
filters={"AND": [{"user_id": "<active_user_id>"}, {"app_id": "<active_project_id>"}]},
page_size=200,
)
If the response indicates more pages exist, paginate until all memories are fetched. Collect the full list before proceeding. If zero memories are found, print:
No memories found for project <project_id>. Nothing to consolidate.
…and stop.
Work entirely in-memory; do not modify anything yet.
Group memories by metadata.type (use "unknown" when the field is absent).
For each group, identify the following:
Two memories are near-duplicates when they express the same fact or decision but phrased differently (e.g., "Use PostgreSQL for auth" and "Auth DB is PostgreSQL").
Heuristics — two memories are near-duplicates if all of these hold:
metadata.type.metadata.pinned != true).For each qualifying pair, draft a merged version that is more complete and specific than either original.
Two memories contradict when they assert opposing facts about the same topic (e.g., "Deploy to ECS" vs. "Deploy to Vercel").
Identify the likely winner: the more recent memory with higher confidence wins. Store both IDs and their content for user review.
A memory is a prune candidate when any of the following is true:
metadata.type has a retention policy and the memory is older than the
configured number of days (compare created_at to today).Always skip memories where metadata.pinned == true, regardless of age or
confidence.
Print a structured diff to the terminal before making any changes. Use exactly this format:
## dream — consolidation report
Merges (<N>):
[mem0:<id1>] + [mem0:<id2>] → "<merged content, 100 chars>"
Conflicts (<N>):
[mem0:<idA>] vs [mem0:<idB>] — "<topic>" [A/B/skip]
Prune (<N>):
[mem0:<id>] — <type>, <age>d old
Proposed: <N> merges, <N> prunes, <N> conflicts. Apply? [Y/n]
If there are zero items in any category, omit that section entirely.
If there are zero total proposals (no merges, no prunes, no conflicts), print:
Dream complete. No duplicate, contradictory, or stale memories found.
…and stop.
For each CONFLICT pair in the report, wait for the user to type A, B, or
skip (case-insensitive). If they enter nothing (empty), treat as skip.
Record the winner for each pair before proceeding to the final apply confirmation.
After all conflict resolutions are collected, prompt:
Apply? [Y/n]
If the user types n or no (case-insensitive), print Cancelled. No changes made.
and stop.
If the user confirms (Y, yes, or empty / Enter), apply all changes in this order:
For each approved merge pair:
delete_memory(<id1>)delete_memory(<id2>)add_memory with:
text="<merged content>"user_id=<active_user_id>app_id=<active_project_id> (top-level, not in metadata)metadata={"type": "<original type>", "branch": "<active_branch>", "confidence": <higher of the two original scores>, "source": "mem0-dream"}infer=FalseFor each resolved conflict where the user chose A or B:
delete_memory(memory_id=<loser_id>)Contradictions where the user chose skip are left untouched.
For each prune candidate:
delete_memory(<memory_id>)After all changes are applied, print:
Dream complete — merged: <N>, pruned: <N>, conflicts resolved: <N>, skipped: <N>
When invoked with --auto (e.g., /mem0-dream --auto), run non-interactively:
Before doing any work, check for a lock file at /tmp/mem0_dream_auto.lock:
[mem0-dream --auto] Another run in progress — skipping. and stop.In auto mode:
[mem0-dream --auto] project=<id> merged=<N> pruned=<N> conflicts_skipped=<N>
mem0-dream-auto reminder already exists before storing one:
search_memories(query="mem0-dream contradictions manual review", filters={"AND": [{"user_id": "<active_user_id>"}, {"app_id": "<active_project_id>"}, {"metadata": {"source": "mem0-dream-auto"}}]}, top_k=1)add_memory(
text="mem0-dream detected <N> contradiction(s) requiring manual review. Run /mem0-dream to resolve them interactively.",
user_id="<active_user_id>",
app_id="<active_project_id>",
metadata={"type": "task_learning", "source": "mem0-dream-auto", "branch": "<active_branch>"},
infer=False,
)
/mem0-forget — targeted deletion of specific memories (search + confirm + delete)/mem0-status --deep — quick quality scan without applying changesIMPORTANT: Do NOT use markdown in your output. OpenCode TUI renders text verbatim — markdown like bold, ## headers, and | table | syntax appears as raw characters. Use plain text with indentation for structure. Use dashes for lists. Use spaces to align columns instead of markdown tables.
Alternatives
coreyhaines31/marketingskills
When the user wants to plan, design, or implement an A/B test or experiment, or build a growth experimentation program. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "should I test this," "which version is better," "test two versions," "statistical significance," "how long should I run this test," "growth experiments," "experiment velocity," "experiment backlog," "ICE score," "experimentation program
coreyhaines31/marketingskills
When the user wants to reduce churn, build cancellation flows, set up save offers, recover failed payments, or implement retention strategies. Also use when the user mentions 'churn,' 'cancel flow,' 'offboarding,' 'save offer,' 'dunning,' 'failed payment recovery,' 'win-back,' 'retention,' 'exit survey,' 'pause subscription,' 'involuntary churn,' 'people keep canceling,' 'churn rate is too high,' 'how do I keep users,' or 'customers are leaving.' Use this whenever someone is losing subscribers o
alirezarezvani/claude-skills
App Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store. Use when the user asks about ASO, app store rankings, app metadata, app titles and descriptions, app store listings, app visibility, or mobile app marketing on iOS or Android. Supports keyword research and scoring, competitor keyword analysis, metadata optimization, A/B test planning, launch checklist
wanshuiyin/Auto-claude-code-research-in-sleep
Use it for operations and research tasks; the detail page covers purpose, installation, and practical steps.