Skip to content
Development
Command

/dream

Consolidate MEMORY.md and Project Learnings: dedupe, resolve conflicts, prune

From plugin
ai-kit
11154 skills15 agents54 commands4 MCP
> /plugin marketplace add solanabr/ai-kit
> /plugin install solana-ai-kit@stbr

Command definition

dream.md
description: "Consolidate MEMORY.md and Project Learnings: dedupe, resolve conflicts, prune"

<!-- Schema adapted from the learn skill (gstack via sendaifun/solana-new), MIT © 2026 SendAI and Superteam. Local-only — no sync, no telemetry. -->

Consolidate project memory. This pass adds no new knowledge: it merges duplicates, resolves contradictions, drops what is stale and strengthens what is proven. Edit only `MEMORY.md` and, after the user confirms, the `## Project Learnings` section of the project instruction file — `CLAUDE.md`, or `AGENTS.md` in `--agents` installs; "the instruction file" below means whichever this project has. Never touch project code.

Entry schema

`MEMORY.md` sections: `## Patterns`, `## Pitfalls`, `## Preferences`, `## Architecture`, `## Tools`. Work with each entry in this typed form (step 6 covers how it is written back):

### kebab-case-key
- **Insight:** One clear sentence
- **Confidence:** N/10
- **Source:** command/agent/session that produced it (e.g. debug-user-tx, manual)
- **Files:** relative/path.rs, other/path.ts   (optional)
- **Date:** YYYY-MM-DD

Backfill missing fields: unknown source `legacy`, missing date today, missing confidence 5/10.

Pipeline

1. **Collect.** Read `MEMORY.md`; if it is missing, create it with the five section headers, report "fresh memory initialized" and skip to step 6. Read the `## Project Learnings` section of the instruction file, with its `### Recurring Issues`, `### Fix Patterns` and `### Config Conventions` subsections (bullets directly under the bare header, from older installs, count as unsorted): it is always loaded and is the authoritative set for contradiction checks. Count entries per section and malformed entries. 2. **Merge.** Same key more than once: keep the latest-dated entry, fold extra detail from the older ones into its Insight, take the max confidence and delete the older ones (consolidation is the one place append-only history gets compacted). Different keys with the same meaning (compare the insights, not the strings): merge under the clearer key, noting the alias if useful. 3. **Resolve contradictions** ("use X" vs "avoid X", inside MEMORY.md or against Project Learnings). Higher confidence plus newer date wins; if the referenced files show which one is true today, check the code; if it is still ambiguous, ask the user and show both entries. Delete the loser and add "supersedes: <old-key>" to the winner. 4. **Prune.** Auto-remove dead references (every listed file is gone, checked with Glob; if some survive, trim the Files list), transient leftovers (in-progress work, old branch state, one-off incidents that can't recur) and verbatim restatements of README or the instruction file. For stale entries (confidence 4 or lower, older than 90 days, never re-confirmed) ask the user: remove, keep and re-date to today, or update the insight. 5. **Re-rank** each section by confidence, then date, both descending. 6. **Write back under the cap.** `MEMORY.md` loads at every session start, so it has a hard cap of 200 lines / 25KB and stays index-pointer style: one-line insights pointing at files, not essays. The typed fields are processing-only for steps 2-5; that metadata lives in the linked detail files, not in the index. If it is over the cap, compress insights to one line, drop obvious Files, then remove the lowest-confidence entries and tell the user what was cut. Show a before/after diff summary, not the whole file. 7. **Export to the instruction file** (optional; confirm first). Promote an entry only when its confidence is 8/10 or higher, it survived an earlier consolidation (30+ days old or re-confirmed), it applies to the whole project rather than one file's quirk, and it fits one bullet: `- **key:** insight (N/10)`. On confirmation, append it under the matching one of those three subsections, adding that `###` heading under `## Project Learnings` if it is missing (never a differently named one), and delete it from MEMORY.md; the instruction file is always loaded, so keeping both wastes tokens.

What to write

Worth keeping: reusable patterns, pitfalls that cost more than 10 minutes, user preferences, architecture decisions with their trade-offs, and tool choices with reasons, as one-line, dated insights with file pointers.

Never written: secrets, keys, tokens, wallet addresses tied to the user or anything resembling credentials; file contents, code blocks over 3 lines or command transcripts; transient state (current branch, in-flight tasks, TODO lists, session context); anything already stated in README or the instruction file. Strip such content or drop the entry; there is no exception path.

Output

## Dream Report - <date>

| Stage | Result |
|-------|--------|
| Collected | N entries (P pat / Q pit / R pref / S arch / T tool), M malformed fixed |
| Merged | N duplicates folded |
| Contradictions | N resolved (list keys), N escalated to user |
| Pruned | N removed (dead refs: n, stale: n, transient: n) |
| Exported | N promoted to the instruction file (or "none proposed") |
| Size | X lines / Y KB (cap: 200 / 25KB) |

No other files are modified.

Read more
@solanabr
Ships withai-kit

Claude Code, set up to ship on Solana. Not programs alone — the whole lifecycle: validating the idea, building the program and the app around it, shipping it, and the launch and growth work that follows.

1113 skills15 agents4 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
111
Star history of solanabr/solana-ai-kit on GitHub, a chart by star-history.com

Other commands on ai-kit.

add-skill

add-skill

Command

Install a pinned skill extension on demand (/add-skill <id>), or list core packs and extensions

@solanabr@solanabrInstall Command
adv

adv

Command

Short for /adversarial: run every task through proposer and adversary pairs, no triage

@solanabr@solanabrInstall Command
adversarial

adversarial

Command

Put a task's load-bearing claims and key decisions through a proposer and an adversary, with proof

@solanabr@solanabrInstall Command
audit-solana

audit-solana

Command

Audit Solana program code for exploitable bugs and write a findings report

@solanabr@solanabrInstall Command
benchmark

benchmark

Command

Compare per-instruction CU with the stored baseline to catch regressions

@solanabr@solanabrInstall Command

More commands from other plugins.

build
Auto-invoked

build

Command

Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.

@addyosmani@addyosmaniInstall Command