feat: replace megamemory with markdown-based memory system

Remove the megamemory MCP knowledge graph and replace with plain
markdown files in .memory/ for tracking plans, research, knowledge,
and implementation state. This enables collaboration across people
and agentic coding tools (Claude Code, Copilot, Cursor, etc.).

Changes:
- Remove megamemory MCP from opencode.jsonc
- Delete tool/megamemory.ts and .megamemory/ database
- Rewrite all 25 config files to use .memory/ markdown files
- Add cross-tool instruction file awareness (AGENTS.md, CLAUDE.md,
  copilot-instructions.md, .cursorrules)
- Update save-memory, bootstrap-memory, status commands for md workflow
- Update all agent files, skills, and commands consistently
This commit is contained in:
2026-03-08 18:43:46 +00:00
parent 2acdb86e3d
commit 204bbb4c84
27 changed files with 289 additions and 365 deletions

View File

@@ -1,5 +1,5 @@
---
description: Initialize or update a project with scaffold, docs, and knowledge graph — adapts to both new and existing projects.
description: Initialize or update a project with scaffold, docs, and .memory files — adapts to both new and existing projects.
---
You are initializing or updating a project. Follow these steps in order.
@@ -46,8 +46,12 @@ Delegate to the `coder` subagent with explicit mode (`new_project` or `existing_
- Required scaffold targets:
- `README.md` — title, purpose, tech stack, quick-start, project structure overview
- `AGENTS.md` — project-specific workflow notes (code style, test commands, linting, build commands, commit conventions); do **not** duplicate global `AGENTS.md` policies — only add project-specific details
- `CLAUDE.md` — project instructions for Claude Code (same core content as `AGENTS.md`, adapted for Claude)
- `.github/copilot-instructions.md` — project instructions for GitHub Copilot
- `.cursorrules` — project instructions for Cursor
- `docs/architecture.md` — stub with title + purpose
- `.gitignore` must include `.megamemory/` entry; add stack-appropriate ignores (e.g., `node_modules/`, `__pycache__/`, `target/`)
- `.gitignore` — add stack-appropriate ignores (e.g., `node_modules/`, `__pycache__/`, `target/`)
- `.memory/` — create and/or update `knowledge.md`, `decisions.md`, `plans/`, `research/`
- other stack-specific scaffold files if clearly implied (e.g., `package.json`, `pyproject.toml`)
- If `new_project`:
- create all required scaffold files/directories
@@ -55,7 +59,9 @@ Delegate to the `coder` subagent with explicit mode (`new_project` or `existing_
- create or fill in only missing pieces
- **do not overwrite existing files**
- explicitly instruct coder to check existence before creating each target
- if `.gitignore` exists, instruct coder to append `.megamemory/` if not already present
- if any cross-tool instruction files are missing (`AGENTS.md`, `CLAUDE.md`, `.github/copilot-instructions.md`, `.cursorrules`), create them
- if they exist, verify they are in sync with `AGENTS.md` for core project knowledge (purpose, stack, conventions, commands, structure)
- if `.memory/` is missing, create the full `.memory/` directory structure
- examples:
- if `README.md` exists and `AGENTS.md` is missing, create only `AGENTS.md`
- if `docs/` is missing, create it and add `docs/architecture.md`
@@ -66,21 +72,21 @@ Always delegate to the `librarian` subagent, for both new and existing projects.
- Ensure `README.md` is accurate and complete for the current project state.
- Ensure `AGENTS.md` captures project-specific workflow decisions from Step 2.
- Verify cross-tool instruction files are consistent with each other (`AGENTS.md`, `CLAUDE.md`, `.github/copilot-instructions.md`, `.cursorrules`).
- Ensure stubs are explicitly marked for later completion.
- Keep edits additive and non-destructive for existing projects.
## Step 5 — Initialize or update knowledge graph (Lead)
## Step 5 — Initialize or update `.memory` project overview (Lead)
Always update megamemory for this project.
Always create or update `.memory/knowledge.md` for this project.
- First call `megamemory:understand` to check whether a project root concept already exists.
- If an appropriate concept exists, call `megamemory:update_concept`.
- If none exists, call `megamemory:create_concept` with:
- Kind: `module`
- Name: `<project name>`
- Summary: purpose, stack, key files, and notable init/update decisions
- File refs: include whichever exist among `README.md`, `AGENTS.md`, `docs/architecture.md`
- Create links (`megamemory:link`) from this concept to related existing concepts when applicable. If no related concepts exist yet (brand new knowledge graph), skip linking.
- Read existing `.memory/knowledge.md` (if present) to avoid duplicate sections.
- Create or update a project overview section with:
- Project name
- Purpose and stack
- Key files (`README.md`, `AGENTS.md`, `docs/architecture.md` when present)
- Notable init/update decisions
- Add markdown cross-references to related sections in `.memory/decisions.md` when applicable.
## Step 6 — Git handling (delegate to `coder`)
@@ -88,12 +94,11 @@ Delegate git operations to `coder` based on discovered state.
- If `.git/` already exists:
- skip `git init`
- ensure `.megamemory/` is in `.gitignore` (if not already handled in Step 3)
- stage only newly created or modified files from this init/update flow
- create a commit
- If `.git/` does not exist:
- use Step 2 answer to decide whether to run `git init`
- if initialized, ensure `.megamemory/` is in `.gitignore`, then stage only newly created or modified files and create a commit
- if initialized, stage only newly created or modified files and create a commit
- Commit message should be concise and conventional, e.g.:
- `chore: initialize project scaffold` (new project)
- `chore: add missing project scaffolding` (existing project)