bd-first-memory-migration
Consolidate fragmented agent-memory layers into one bd-canonical store, then GC/retire the rest. Triggers: "memory migration", "consolidate agent memory", "beads-first memory".
What this skill does
# bd-first-memory-migration > Make `bd` the single source of truth for agent memory. Salvage the keepers, derive the caches, garbage-collect and retire the rest. Three phases, gated between destructive steps. ## The problem this solves Agents accrete **multiple uncoordinated memory stores** — one per harness (Claude `MEMORY.md`, an `ao`/flywheel store, `.agents/learnings` piles, `bd` memories). None is canonical, so they drift, bloat, duplicate, and never get garbage-collected. This skill collapses them to **one bd-canonical substrate**; everything else becomes a derived cache or is retired. **Not** a generic dedup tool. It is opinionated: `bd` wins, decay-ranked recall replaces grep, and stale low-utility memory is evicted to a cold archive (never silently deleted). ## When to use / when not | Use it when | Skip it when | |---|---| | You have ≥2 memory stores and one is `bd` (or you'll adopt bd) | You only have one store and it's healthy | | A store has stalled (e.g. 99% "provisional", never promoted/evicted) | You need cross-org memory federation (out of scope) | | Disk pile of duplicated extracts (`-pend-*`, N× copies) | You want to *keep* every store independent | ## Quick start ```bash # Phase 1 — AUDIT (read-only; produces the KEEP/DROP manifest + reversibility plan) scripts/audit-scan --target <box> # inventory every layer scripts/classify --manifest out/manifest.json # keepers vs junk (dry-run) # ⛔ GATE A: human reviews the manifest before anything is written # Phase 2 — MIGRATE (salvage -> bd; stand up typed recall; unify writes) scripts/import --manifest out/manifest.json --dry-run # then drop --dry-run scripts/recall --query "<topic>" --max-tokens 400 # decay-ranked scripts/gen-memory-md # regenerate the thin cache # Phase 3 — GC / RETIRE (after rollback test green) scripts/gc --dry-run # dedup + evict-to-archive # ⛔ GATE B: rollback test green before any destructive retire scripts/retire --dry-run # decommission dead daemons + reclaim disk ``` ## The three phases | Phase | Goal | Destructive? | Gate | |---|---|---|---| | **1 — Audit** | Inventory all layers; classify keep vs junk; write reversibility plan | No (read-only) | ⛔ **Gate A** — review KEEP/DROP manifest | | **2 — Migrate** | Salvage keepers → bd (typed + provenance); decay-ranked recall; unified write path; generated `MEMORY.md` | Writes to bd only | — | | **3 — GC/Retire** | Utility scoring, scheduled GC/dedup, retire dead stores, reclaim disk | **Yes** | ⛔ **Gate B** — rollback test green; ⛔ **Gate C** — human go/no-go on the real box | Full per-phase contract: [references/PHASES.md](references/PHASES.md). Memory data model + type taxonomy: [references/DATA-MODEL.md](references/DATA-MODEL.md). Reversibility/rollback contract: [references/ROLLBACK.md](references/ROLLBACK.md). Worked examples: [references/EXAMPLES.md](references/EXAMPLES.md). Acceptance scenarios: [references/audit.feature](references/audit.feature) (Phase 1) · [references/migrate.feature](references/migrate.feature) (Phase 2). ## Anti-patterns | Don't | Do | |---|---| | Hard-delete a store before salvage is verified | Import-ledger confirms every keeper landed in bd *first* | | Run destructive retire before rollback is proven | Gate B: rollback test green is a hard precondition | | Burst bd writes during bulk salvage | **Pace writes** — bd auto-commits each write to Dolt; bursts OOM a memory-capped server | | Silently truncate (top-N, sampling) | `log()` whatever was dropped — silent caps read as "covered everything" | | Hand-edit the generated `MEMORY.md` | It is a read-only cache rebuilt from bd; edit the bd memory instead | | Auto-fire the real destructive retire | Gate C: human go/no-go on the live box (pre-mortem first) | ## Guardrails (load-bearing) - **Idempotent + reversible + backup-aware.** Every destructive step takes a backup and has a documented rollback (see ROLLBACK.md). - **Dry-run first.** Every Phase-2/3 mutate path ships with a working `--dry-run`. - **Pace bd/Dolt writes.** Bulk salvage of thousands of keepers will trip a memory-capped Dolt server if unpaced — sleep between writes, cap concurrency. - **bd canonical, not br.** This skill targets `bd`; it does not migrate the tracker itself. ## See also - `skills/beads/SKILL.md` — the bd issue/memory substrate this skill writes to - `skills/curate/SKILL.md` (`--mode=harvest`) — promoting `.agents` knowledge (the *authored* keepers this skill salvages)
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.