$npx -y skills add WenyuChiou/agent-collab-skills --skill agent-shared-memoryUse when the user asks to update shared memory, initialize multi-agent memory, summarize decisions so far, identify open questions, or prepare a fresh session primer.
| 1 | # agent-shared-memory |
| 2 | |
| 3 | The persistent blackboard between Claude session A, Codex session |
| 4 | B, and Gemini session C — none of which see each other's |
| 5 | conversation history natively. |
| 6 | |
| 7 | `.coord/memory.yml` is **append-only**. Past decisions don't get |
| 8 | edited; they get superseded by new entries that reference what they |
| 9 | replace. This makes it an audit trail, not a mutable scratchpad. |
| 10 | |
| 11 | ## When to use |
| 12 | |
| 13 | Trigger phrases: |
| 14 | |
| 15 | - "Update the shared memory with `<decision>`." |
| 16 | - "Log this open question to shared memory." |
| 17 | - "What have agents decided so far on this project?" |
| 18 | - "What are the open questions blocking us?" |
| 19 | - "Initialize multi-agent shared memory for this project." |
| 20 | - "Give me a primer for a fresh agent session." |
| 21 | |
| 22 | Not for: |
| 23 | |
| 24 | - Per-task scratch (use `.ai/<agent>_task_*.md` from |
| 25 | `agent-task-splitter`). |
| 26 | - Per-round artifacts (use the round-specific files written by |
| 27 | reconciler / acceptance-gate). |
| 28 | - Project-level long-term context (use `.research/project_manifest.yml` |
| 29 | from `research-context-compressor`, or `.paper/claims.yml` from |
| 30 | `paper-memory-builder`). |
| 31 | |
| 32 | `.coord/memory.yml` is specifically the **multi-agent coordination |
| 33 | layer** — short-to-medium-term decisions made during a multi-agent |
| 34 | work cycle. |
| 35 | |
| 36 | For large or cross-session work, pair this with `agent-context-budget` |
| 37 | to produce `.coord/session_primer.md`. The primer is the bounded |
| 38 | session input; `memory.yml` remains the append-only source. |
| 39 | |
| 40 | ## Schema |
| 41 | |
| 42 | Full schema in `references/coord_memory_schema.md`. Quick view: |
| 43 | |
| 44 | ```yaml |
| 45 | project: "<repo name or research project slug>" |
| 46 | created_utc: "2026-04-28T09:00:00Z" |
| 47 | |
| 48 | decisions: |
| 49 | - id: D1 |
| 50 | date_utc: "2026-04-28T10:30:00Z" |
| 51 | what: "Use SQLite for shared session state, not Redis" |
| 52 | why: "Already a project dep; Redis would add infra" |
| 53 | made_by: "claude" # which agent / human made it |
| 54 | supersedes: [] # IDs of prior decisions this replaces |
| 55 | - id: D2 |
| 56 | date_utc: "2026-05-02T14:00:00Z" |
| 57 | what: "Switch to LMDB for shared session state" |
| 58 | why: "SQLite is locking under concurrent writes from N agents" |
| 59 | made_by: "user" |
| 60 | supersedes: [D1] # D1 is now historical, not current |
| 61 | |
| 62 | open_questions: |
| 63 | - id: Q1 |
| 64 | asked_utc: "2026-04-28T11:00:00Z" |
| 65 | question: "Should we cache LLM responses?" |
| 66 | blocker_for: ["T5", "T7"] # task IDs from .coord/plan.yml |
| 67 | suggested_next_agent: "claude" |
| 68 | resolved_by: null # set to a decision ID when answered |
| 69 | - id: Q2 |
| 70 | asked_utc: "2026-04-30T09:00:00Z" |
| 71 | question: "What's the upper bound on concurrent agent sessions?" |
| 72 | blocker_for: [] |
| 73 | suggested_next_agent: "user" |
| 74 | resolved_by: D2 # D2's switch to LMDB resolved this |
| 75 | |
| 76 | artifacts: |
| 77 | - path: ".coord/plan.yml" |
| 78 | round: 1 |
| 79 | produced_by: "agent-task-splitter" |
| 80 | used_by: ["codex-delegate", "gemini-delegate"] |
| 81 | timestamp_utc: "2026-04-28T09:30:00Z" |
| 82 | - path: ".coord/reconciliation_001.md" |
| 83 | round: 1 |
| 84 | produced_by: "agent-output-reconciler" |
| 85 | used_by: ["agent-acceptance-gate"] |
| 86 | timestamp_utc: "2026-04-28T11:45:00Z" |
| 87 | |
| 88 | agent_history: |
| 89 | - agent: codex |
| 90 | session_id: "abc123" |
| 91 | started_utc: "2026-04-28T10:00:00Z" |
| 92 | ended_utc: "2026-04-28T10:25:00Z" |
| 93 | output_summary: ".ai/codex_result_001_extract-interfaces.md" |
| 94 | status: "success" |
| 95 | - agent: gemini |
| 96 | session_id: "def456" |
| 97 | started_utc: "2026-04-28T10:30:00Z" |
| 98 | ended_utc: "2026-04-28T11:15:00Z" |
| 99 | output_summary: ".ai/gemini_result_001_review-doc-coverage.md" |
| 100 | status: "success" |
| 101 | ``` |
| 102 | |
| 103 | ## Workflow |
| 104 | |
| 105 | ### Read mode: produce a primer |
| 106 | |
| 107 | When a new agent session starts (or the user asks "what's the |
| 108 | state?"), generate a digest: |
| 109 | |
| 110 | ```markdown |
| 111 | [agent-shared-memory] Project state — <project> |
| 112 | |
| 113 | Current decisions (3): |
| 114 | D2 (2026-05-02): Switch to LMDB for shared session state. |
| 115 | (supersedes D1: SQLite chosen on 2026-04-28) |
| 116 | D3 (2026-05-04): Use plugin-based auth architecture. |
| 117 | D4 (2026-05-05): Acceptance gate runs pytest + banned-word audit. |
| 118 | |
| 119 | Historical (superseded): |
| 120 | D1 (2026-04-28): SQLite for shared session state. Replaced by D2. |
| 121 | |
| 122 | Open questions (1): |
| 123 | Q1: Should we cache LLM responses? |
| 124 | Blocking: T5 (codex), T7 (gemini). |
| 125 | Suggested next: claude. |
| 126 | |
| 127 | Last 3 agent sessions: |
| 128 | 2026-05-04 codex T8 refactor-config success |
| 129 | 2026-05-04 claude T9 review-architecture success |
| 130 | 2026-05-03 gemini T6 long-context-review fallback (test failure) |
| 131 | |
| 132 | Files most recently produced: |
| 133 | .coord/acceptance_002.md (2026-05-04, agent-acceptance-gate) |
| 134 | .coord/reconciliation_002.md (2026-05-04, agent-output-reconciler) |
| 135 | ``` |
| 136 | |
| 137 | If `.coord/memory.yml` doesn't exist yet, say so and offer to |
| 138 | initialize. |
| 139 | |
| 140 | ### Append mode: log a new entry |
| 141 | |
| 142 | User says "log this decision to memory: we picked LMDB over SQLite |
| 143 | because of concurrent-write issues." |
| 144 | |
| 145 | 1. Read existing `.coord/memory.yml` (or initial |