{"skill":{"slug":"memory-architect","displayName":"Memory Architect","summary":"Restructure flat MEMORY.md files into a tiered memory system with an entity graph. Use when: (1) MEMORY.md is growing unwieldy or exceeds 150 lines, (2) user...","description":"---\nname: memory-architect\ndescription: \"Restructure flat MEMORY.md files into a tiered memory system with an entity graph. Use when: (1) MEMORY.md is growing unwieldy or exceeds 150 lines, (2) user asks to organize/restructure/tier memory, (3) context compaction is losing important details, (4) you need structured entity lookup (people, projects, properties, contacts) instead of scanning markdown. Triggers on organize my memory, memory is too big, restructure memory, tier my memory, make memory more efficient.\"\n---\n\n# Memory Architect\n\nSplit a monolithic MEMORY.md into three tiers plus a structured entity graph.\n\n## Architecture\n\n```\nMEMORY.md              → Router (30 lines max). Points to tiers.\nmemory/protocols.md    → HOT: Stable workflows, shortcuts, procedures. Read on session start.\nmemory/active.md       → WARM: Current projects, waiting-on, live context. Check before acting.\nmemory/archive.md      → COLD: Completed work, historical reference. Search when needed.\nmemory/ontology/graph.jsonl → Structured entities + relations (JSONL append-only)\n```\n\n## Process\n\n### 1. Analyze the existing MEMORY.md\n\nRead the full file. Classify each section:\n\n| Content type | Tier | Examples |\n|-------------|------|---------|\n| Stable workflow / procedure | protocols | Emoji shortcuts, deploy steps, tool usage rules |\n| Active project / waiting-on | active | Current builds, pending replies, live URLs |\n| Completed work / reference data | archive | Done tasks, contact lists, account tables, old decisions |\n| Named entity with properties | ontology | People, orgs, projects, properties, locations |\n\n### 2. Create the tier files\n\nWrite each tier file with a header comment explaining its purpose and update frequency.\n\n**protocols.md rules:**\n- Only procedures that rarely change\n- Include the exact commands (copy-pasteable)\n- No project-specific state\n\n**active.md rules:**\n- Only things with a next action or pending status\n- Include \"Waiting On\" section at bottom\n- Prune completed items to archive on each update\n\n**archive.md rules:**\n- Completed work grouped by date or category\n- Reference data (contacts, accounts, chat IDs)\n- Keep searchable — use headers and tables\n\n### 3. Extract entities to ontology\n\nFor each named person, organization, project, property, or location, create a JSONL entry:\n\n```jsonl\n{\"op\":\"create\",\"entity\":{\"id\":\"p_alice\",\"type\":\"Person\",\"properties\":{\"name\":\"Alice\",\"email\":\"alice@example.com\",\"role\":\"Engineer\"}},\"timestamp\":\"2026-01-01T00:00:00Z\"}\n{\"op\":\"relate\",\"from\":\"p_alice\",\"rel\":\"member_of\",\"to\":\"org_acme\",\"timestamp\":\"2026-01-01T00:00:00Z\"}\n```\n\n**ID conventions:**\n- People: `p_shortname`\n- Organizations: `grp_name` or `org_name`\n- Projects: `proj_name`\n- Properties/locations: `prop_name` or `loc_name`\n\n**Relation types:** `member_of`, `owns`, `collaborates_on`, `interested_in`, `guides`, `uses`, `listed_by`, `located_at`\n\n### 4. Rewrite MEMORY.md as router\n\nReplace MEMORY.md with a ~25-line index that:\n- Lists the three tiers with one-line descriptions\n- Notes the ontology location\n- Preserves any system directives (NO_REPLY rules, heartbeat instructions)\n- Contains zero project-specific content\n\n### 5. Verify\n\n```bash\nwc -l MEMORY.md memory/protocols.md memory/active.md memory/archive.md memory/ontology/graph.jsonl\n```\n\nTargets: MEMORY.md under 30, protocols under 100, active under 80, graph = 1 line per entity/relation.\n\n## Maintenance\n\n### On each session\n- Read `memory/protocols.md` (always)\n- Scan `memory/active.md` (always)\n- `memory/archive.md` — only on `memory_search` or explicit request\n\n### When adding new information\n- New procedure → protocols.md\n- New project/active item → active.md\n- Completed item → move active → archive\n- New person/org/project → append to graph.jsonl\n\n### Entity queries\n```bash\ngrep \"p_forrest\" memory/ontology/graph.jsonl\ngrep '\"type\":\"Project\"' memory/ontology/graph.jsonl\ncat memory/ontology/graph.jsonl | jq -r 'select(.entity?.type==\"Person\") | .entity.properties.name'\n```\n","tags":{"latest":"1.0.0"},"stats":{"comments":0,"downloads":660,"installsAllTime":4,"installsCurrent":4,"stars":0,"versions":1},"createdAt":1772337323045,"updatedAt":1778491674555},"latestVersion":{"version":"1.0.0","createdAt":1772337323045,"changelog":"Initial release of memory-architect: split MEMORY.md into tiers and entity graph.\n\n- Introduces a system to restructure MEMORY.md into protocols, active, archive files, and a structured ontology graph.\n- Defines clear rules for classifying and storing workflows, active items, completed work, and structured entities.\n- MEMORY.md becomes a concise router/index.\n- Provides maintenance guidelines for ongoing organization and efficient entity lookups.","license":null},"metadata":null,"owner":{"handle":"kapslap","userId":"s17ah8ccnpa786fnt7p2y5jmkd83g9wy","displayName":"kapslap","image":"https://avatars.githubusercontent.com/u/92482462?v=4"},"moderation":null}