memory-write
Service skill — writes and modifies memory files. Invoked only from memory-retro, after the user has explicitly confirmed.
Operations
add — create a new entry
Input: title, body, type, confidence, dialog context (for tags).
Steps:
- Get the current unix timestamp.
- Generate a slug from the title: transliterate → lowercase → spaces → dashes, ASCII-only, no special characters. Example: "Relationship with my mother" →
relationship-with-my-mother.
- Filename:
<unix_timestamp>-<slug>.md.
- Call
tag-pick with the title + body + context → receive an array of tags (2–5).
- Create the file with frontmatter:
---
title: <title>
tags: [<...>]
type: <type>
confidence: <high|medium|low>
status: active
created: <YYYY-MM-DD>
updated: <YYYY-MM-DD>
---
<body>
## Change log
- <YYYY-MM-DD> — created during conversation about <short description of the initiative>
- Append a line to
memory/index.md in the ## Entries section:
- [<title>](<filename>) — <type>, <tags comma-separated>, <one-line hook>
update — update an existing entry
Input: filename, new body (or new frontmatter fields), reason for the change.
Steps:
- Read the existing file.
- Apply the edit (body and/or frontmatter).
- Set
updated: to today's date.
- If the tags changed — re-run them through
tag-pick (do not hand-edit).
- Append a line to
## Change log:
- <YYYY-MM-DD> — <short description of the edit>: <reason>
- If the title or the hook changed — update the corresponding line in
memory/index.md.
Critical changes (change of type, confidence, resolution of a contradiction) get an explicit entry in the change log. Minor wording edits — one line.
supersede — mark as deprecated
Input: filename, reason for deprecation, optional — name of the successor file.
Steps:
- Read the file.
- Block: if
type: event — refuse, explain that events never deprecate.
- Edit frontmatter:
status: deprecated
superseded_at: <YYYY-MM-DD>
superseded_by: <filename> (if a successor exists)
updated: <YYYY-MM-DD>
- Append to
## Change log:
- <YYYY-MM-DD> — marked deprecated: <reason> (+ link to successor, if any).
- In
memory/index.md, mark the entry as deprecated (add a [deprecated] tag to the line, or move it into a ### Deprecated subsection).
delete — hard delete
Only on an explicit user command targeting a specific file ("delete this entry", "this should never have been saved").
Steps:
- Delete the file.
- Remove its line from
memory/index.md.
- If any other entry's
superseded_by pointed at this file — drop that reference (and append to that entry's change log: successor deleted <date>).
General rules
- All dates —
YYYY-MM-DD.
- Entry body is written in the user's language (the language used in the dialog).
- Frontmatter keys stay in English; their values for
type and status use the controlled vocabulary in English (fact, belief, preference, event, goal, constraint; active, deprecated).
- If any input is ambiguous — do not invent; return an error to
memory-retro describing the problem and let the orchestrator re-ask the user.
- New
type values are not introduced without explicit user confirmation — that must have been settled in memory-retro before memory-write was called.
1---2name: memory-write3description: Service skill that writes and modifies files in memory/. Invoked ONLY from memory-retro after the user confirmed the proposed diff. Never runs by itself and is not invoked by the user directly. Supports four operations — add (new entry), update (edit existing), supersede (soft delete via status), delete (hard delete, only by an explicit user command). When tags need to be created or updated, cascades into tag-pick.4---56# memory-write78Service skill — writes and modifies memory files. Invoked **only from `memory-retro`**, after the user has explicitly confirmed.910## Operations1112### add — create a new entry1314**Input:** `title`, `body`, `type`, `confidence`, dialog context (for tags).1516**Steps:**17181. Get the current unix timestamp.192. Generate a slug from the title: transliterate → lowercase → spaces → dashes, ASCII-only, no special characters. Example: *"Relationship with my mother"* → `relationship-with-my-mother`.203. Filename: `<unix_timestamp>-<slug>.md`.214. Call `tag-pick` with the title + body + context → receive an array of tags (2–5).225. Create the file with frontmatter:23 ```yaml24 ---25 title: <title>26 tags: [<...>]27 type: <type>28 confidence: <high|medium|low>29 status: active30 created: <YYYY-MM-DD>31 updated: <YYYY-MM-DD>32 ---3334 <body>3536 ## Change log37 - <YYYY-MM-DD> — created during conversation about <short description of the initiative>38 ```396. Append a line to `memory/index.md` in the `## Entries` section:40 `- [<title>](<filename>) — <type>, <tags comma-separated>, <one-line hook>`4142### update — update an existing entry4344**Input:** filename, new body (or new frontmatter fields), reason for the change.4546**Steps:**47481. Read the existing file.492. Apply the edit (body and/or frontmatter).503. Set `updated:` to today's date.514. If the tags changed — re-run them through `tag-pick` (do not hand-edit).525. Append a line to `## Change log`:53 `- <YYYY-MM-DD> — <short description of the edit>: <reason>`546. If the title or the hook changed — update the corresponding line in `memory/index.md`.5556**Critical changes** (change of `type`, `confidence`, resolution of a contradiction) get an explicit entry in the change log. Minor wording edits — one line.5758### supersede — mark as deprecated5960**Input:** filename, reason for deprecation, optional — name of the successor file.6162**Steps:**63641. Read the file.652. **Block:** if `type: event` — refuse, explain that events never deprecate.663. Edit frontmatter:67 - `status: deprecated`68 - `superseded_at: <YYYY-MM-DD>`69 - `superseded_by: <filename>` (if a successor exists)70 - `updated: <YYYY-MM-DD>`714. Append to `## Change log`:72 `- <YYYY-MM-DD> — marked deprecated: <reason>` (+ link to successor, if any).735. In `memory/index.md`, mark the entry as deprecated (add a `[deprecated]` tag to the line, or move it into a `### Deprecated` subsection).7475### delete — hard delete7677**Only** on an explicit user command targeting a specific file (*"delete this entry"*, *"this should never have been saved"*).7879**Steps:**80811. Delete the file.822. Remove its line from `memory/index.md`.833. If any other entry's `superseded_by` pointed at this file — drop that reference (and append to that entry's change log: `successor deleted <date>`).8485## General rules8687- All dates — `YYYY-MM-DD`.88- Entry **body** is written in the user's language (the language used in the dialog).89- Frontmatter **keys** stay in English; their **values** for `type` and `status` use the controlled vocabulary in English (`fact`, `belief`, `preference`, `event`, `goal`, `constraint`; `active`, `deprecated`).90- If any input is ambiguous — **do not invent**; return an error to `memory-retro` describing the problem and let the orchestrator re-ask the user.91- New `type` values are not introduced without explicit user confirmation — that must have been settled in `memory-retro` before `memory-write` was called.