Build Memory
Purpose
Compile raw repository documents into a maintained memory_bank/ of concise, interlinked markdown pages.
This skill is intentionally:
- markdown-only
- generative rather than script-driven
- source-preserving
- designed for progressive disclosure rather than bulk loading
Do not introduce databases, embeddings, or automation unless the user explicitly asks for them.
Default Behavior
Unless the user specifies otherwise:
- treat raw project docs as immutable inputs
- write compiled outputs under
memory_bank/
- prefer a small number of durable synthesis pages over many shallow summaries
- keep chronology separate from current state
Source Selection
Determine the source set.
- If the user names a source directory, use it.
- Otherwise prefer repository knowledge sources such as
codex_doc/, docs/, top-level README.md, project README.md files, notes, plans, and thread summaries.
- Exclude generated outputs unless they are themselves important knowledge artifacts.
Sample the sources before writing.
- Identify recurring projects, topics, tasks, decisions, and status updates.
- Notice contradictions, stale instructions, and duplicate narratives.
Preserve the raw/source distinction.
- Never rewrite the raw source files as part of this skill unless the user separately asks for that.
- The
memory_bank/ is the compiled layer, not the source of truth.
Output Layout
Create only the directories needed for the current corpus. Start with:
memory_bank/
index.md
log.md
sources/
projects/
topics/
tasks/
decisions/
Read references/page_types.md before writing pages.
Workflow
Build the top-level map.
- Create
memory_bank/index.md as the navigation entrypoint.
- Group pages by type and give each page a one-line description.
Build source pages.
- For each important raw document, create a compact page under
memory_bank/sources/.
- Capture what the source is, why it matters, its key claims, and what durable pages it should feed.
- Source pages should be concise. They are waypoints, not full restatements.
Build durable synthesis pages.
- Project pages track stable project state.
- Topic pages track reusable concepts, workflows, and recurring patterns.
- Task pages track active or unresolved work.
- Decision pages record meaningful choices, assumptions, and constraints.
- Prefer updating an existing durable page over creating a new near-duplicate page.
Interconnect the bank.
- Add
Related: links between adjacent pages.
- Add
Derived from: links back to source pages.
- Use direct markdown links so an agent can traverse the bank cheaply.
- Read references/linking_rules.md for link hygiene.
Separate state from chronology.
index.md answers: what exists here?
- durable pages answer: what is currently true?
log.md answers: what changed and when?
Append a memory-bank log entry.
- Add a short chronological entry to
memory_bank/log.md summarizing the ingest or refresh pass.
- Include the date, source set touched, and major pages created or updated.
Quality Bar
- Favor synthesis over extraction.
- Keep pages dense and scannable.
- Record contradictions explicitly instead of silently flattening them.
- Avoid duplicating the same prose across multiple pages.
- Prefer a few high-value hub pages over a forest of low-value pages.
- Keep the bank useful to a future agent that has not read the whole repo.
When To Create New Pages
Create a new page when one of these is true:
- the material represents a distinct project or workstream
- a concept recurs across multiple sources
- a task has ongoing operational value
- a decision materially affects future work
Otherwise, update an existing page.
Naming Guidance
- Use short, stable slugs.
- Prefer topic or project names over dates, except for chronological decision records when dates matter.
- Avoid filenames that encode transient chat phrasing.
Final Check
Before finishing:
- Read
memory_bank/index.md and confirm it gives a usable overview.
- Check that major pages link to each other and to their source pages.
- Check that the bank reflects current state rather than only chronology.
- Note any obvious coverage gaps or unresolved conflicts to the user.
1---2name: build-memory3description: Build or refresh a coherent markdown-only `memory_bank` from repository documents such as `codex_doc`, `docs`, `README.md`, notes, plans, and thread summaries. Use when the user invokes `/build-memory` or `$build-memory`, or asks for a persistent wiki, memory bank, knowledge base, or interlinked summaries that agents can navigate without loading every raw document.4---56# Build Memory78## Purpose910Compile raw repository documents into a maintained `memory_bank/` of concise, interlinked markdown pages.1112This skill is intentionally:1314- markdown-only15- generative rather than script-driven16- source-preserving17- designed for progressive disclosure rather than bulk loading1819Do not introduce databases, embeddings, or automation unless the user explicitly asks for them.2021## Default Behavior2223Unless the user specifies otherwise:2425- treat raw project docs as immutable inputs26- write compiled outputs under `memory_bank/`27- prefer a small number of durable synthesis pages over many shallow summaries28- keep chronology separate from current state2930## Source Selection31321. Determine the source set.33 - If the user names a source directory, use it.34 - Otherwise prefer repository knowledge sources such as `codex_doc/`, `docs/`, top-level `README.md`, project `README.md` files, notes, plans, and thread summaries.35 - Exclude generated outputs unless they are themselves important knowledge artifacts.36372. Sample the sources before writing.38 - Identify recurring projects, topics, tasks, decisions, and status updates.39 - Notice contradictions, stale instructions, and duplicate narratives.40413. Preserve the raw/source distinction.42 - Never rewrite the raw source files as part of this skill unless the user separately asks for that.43 - The `memory_bank/` is the compiled layer, not the source of truth.4445## Output Layout4647Create only the directories needed for the current corpus. Start with:4849```text50memory_bank/51 index.md52 log.md53 sources/54 projects/55 topics/56 tasks/57 decisions/58```5960Read [references/page_types.md](references/page_types.md) before writing pages.6162## Workflow63641. Build the top-level map.65 - Create `memory_bank/index.md` as the navigation entrypoint.66 - Group pages by type and give each page a one-line description.67682. Build source pages.69 - For each important raw document, create a compact page under `memory_bank/sources/`.70 - Capture what the source is, why it matters, its key claims, and what durable pages it should feed.71 - Source pages should be concise. They are waypoints, not full restatements.72733. Build durable synthesis pages.74 - Project pages track stable project state.75 - Topic pages track reusable concepts, workflows, and recurring patterns.76 - Task pages track active or unresolved work.77 - Decision pages record meaningful choices, assumptions, and constraints.78 - Prefer updating an existing durable page over creating a new near-duplicate page.79804. Interconnect the bank.81 - Add `Related:` links between adjacent pages.82 - Add `Derived from:` links back to source pages.83 - Use direct markdown links so an agent can traverse the bank cheaply.84 - Read [references/linking_rules.md](references/linking_rules.md) for link hygiene.85865. Separate state from chronology.87 - `index.md` answers: what exists here?88 - durable pages answer: what is currently true?89 - `log.md` answers: what changed and when?90916. Append a memory-bank log entry.92 - Add a short chronological entry to `memory_bank/log.md` summarizing the ingest or refresh pass.93 - Include the date, source set touched, and major pages created or updated.9495## Quality Bar9697- Favor synthesis over extraction.98- Keep pages dense and scannable.99- Record contradictions explicitly instead of silently flattening them.100- Avoid duplicating the same prose across multiple pages.101- Prefer a few high-value hub pages over a forest of low-value pages.102- Keep the bank useful to a future agent that has not read the whole repo.103104## When To Create New Pages105106Create a new page when one of these is true:107108- the material represents a distinct project or workstream109- a concept recurs across multiple sources110- a task has ongoing operational value111- a decision materially affects future work112113Otherwise, update an existing page.114115## Naming Guidance116117- Use short, stable slugs.118- Prefer topic or project names over dates, except for chronological decision records when dates matter.119- Avoid filenames that encode transient chat phrasing.120121## Final Check122123Before finishing:1241251. Read `memory_bank/index.md` and confirm it gives a usable overview.1262. Check that major pages link to each other and to their source pages.1273. Check that the bank reflects current state rather than only chronology.1284. Note any obvious coverage gaps or unresolved conflicts to the user.