inbox-to-memory
Skill1 starsChanged 2 months agoMITView on GitHub
Process raw inputs (transcripts, meeting notes, PDFs, slide decks, scratch braindumps) from a `_inbox/` queue into one groomed markdown note per input, and propose memory records across three scope tiers — project, client, and a cross-client journal. Use whenever the user wants to process the inbox, groom notes, drain the inbox, crystallize a memory candidate, promote something to memory or to a journal — even if they don't say "skill" or name a file type. Also use to set up the substrate for a new project, client, or the journal — scaffold a new project here, set up notes substrate, spin up a client, set up the journal, create a memory bank here. Client and project scaffolds default to a lightweight 3-type memory schema (Decision/Context/PolicyRule) with a canonical 4-type opt; they also produce a README, `_personal.md`, `working-state.md` (project scope), and a `patterns-journal/`. Only operates on opted-in directories (holding `_memory/` or `entries/`, plus an `_inbox/` at that level or under `notes/`).
In this repository19 other files it gives its agents.
- AGENTS.mdAGENTS.md
- divvy-up/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- adversarial-reviewSkill
- databricks-apiSkill
- divvy-upSkill
- eli5Skill
- file-issueSkill
- handoffSkill
- jd-auditSkill
- jd-fileSkill
- jira-refineSkill
- memory-consolidateSkill
- memory-indexSkill
- mutation-testingSkill
- readme-coauthorshipSkill
- technical-writingSkill
- work-issueSkill
- work-waveSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
26 rules. About 0 are common, 7 are distinctive, and 19 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
19
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 30
Run bash <skill-path>/scripts/detect-scope.sh from the user's cwd.
- Very specific: line 64
Run the candidate lookup: Write the step 2 canonical entities to one file and the input's claim sentences (the Notable Quotes and Tensions …
- Very specific: line 72
When the script prints vec off: on stderr, the lookup ran on grep alone.
- Very specific: line 80
Only status: accepted records produce flags, and only they can be confirmed.
- Distinctive: line 130
Before writing the Open Questions section, grep the scope's prior notes for slugs already in play:
- Distinctive: line 144
Use the heuristics in references/scope-decisions.md to pick a scope.
- Very specific: line 150
Never leave a file in _inbox/ after grooming.
- Distinctive: line 172
Stop here. Show the user every groomed note and every flagged candidate, organized by candidate type and proposed scope.
- Very specific: line 190
Keep date unless the core claim has materially changed.
- Distinctive: line 206
Run the lint over the scope first:
- Distinctive: line 220
Every candidate flag in every groomed note has either been resolved to a wiki link OR retains its original prefix.
- Very specific: line 225
Every record the stamper stamped, with its new date, off its stamped: lines.
- Very specific: line 226
Every record the stamper declined, with its reason, off its skipped: lines and nothing else.
- Very specific: line 227
Every proposed record an input restated, one line per record and note, as restated proposed: <record-path> by <note-path>, both paths …
- Very specific: line 229
Every line stale-records.sh printed, stdout and stderr, verbatim.
- Very specific: line 270
Leave placeholders that the user defers as <!-- Fill in: ...
- Very specific: line 274
Every markdown file this mode generates carries a scaffold_digest in its frontmatter: a hash of the body it was written with.
- Distinctive: line 310
Extracted sections only: Never rewrite raw content.
- Very specific: line 327
When invoked at a pre-existing project (e.g., pursuits/atlas/) that already has notes and _memory/:
- Very specific: line 330
Add any missing subdirectories per the chosen memory mode (e.g., _memory/rules/ for lightweight, _memory/policy-rules/ and …
- Very specific: line 331
Add any missing top-level files (README.md, _personal.md, memory-bank.yaml, working-state.md for projects, …
- Very specific: line 333
Ask the user for deltas — active stakeholders, custom tag namespace, custom type: enum values, transcription-error mappings.
- Very specific: line 335
If the pre-existing _memory/ uses a different mode than the user requests (e.g., existing canonical 4-type vs.
- Distinctive: line 382
Write every block to The Frontmatter Contract in references/machine-contracts.md: one line per value, closed inside the first 20 lines, …
- Very specific: line 412
All IDs come from the globally-installed nanoid -s 10 CLI.
- Very specific: line 424
One groomed note per input: No four-file fragmentation.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
inbox-to-memory
Three modes:
- Process (default): pulls raw inputs from a
_inbox/queue, produces one groomed markdown note per input, and proposes memory records or journal entries for the user to approve. - Scaffold: stands up the directory structure and CLAUDE.md for a new scope — a project, a client, or the cross-client journal.
- Migrate: rewrites an existing scope's v1 frontmatter onto the v2 contract, and its v2 records onto long-term-memory-kit's
schema: 1, leaving every body untouched.
Decide the mode from the user's phrasing. When ambiguous, ask.
| Phrasing | Mode |
| "process the inbox", "groom these notes", "drain the inbox", "crystallize this candidate", "sign off on this candidate", "promote to memory", "promote to journal" | process |
| "scaffold a new project here", "set up notes substrate", "spin up a client", "set up the journal", "create a memory bank here" | scaffold |
| "migrate this scope", "bring these notes onto v2", "upgrade the frontmatter", "migrate to schema 2", "get this scope onto the contract", "migrate records to ltm" | migrate |
Process Mode
Six phases, plus a 2.5 that slots in ahead of grooming. The user reviews and approves between phase 4 and phase 5. Nothing crystallizes without the user's sign-off. The one write into _memory/ that skips that review lands in the same gap — a last_confirmed date stamped onto a record this run's inputs confirmed, under Stamp Confirmations below.
Phase 1 — Detect Scope
Run bash <skill-path>/scripts/detect-scope.sh from the user's cwd. It prints root:, tier: (project, client, or journal), and mode: (lightweight, canonical, or unknown). Its header comment holds the walk-up rule and why a queue deeper than notes/_inbox/ is never claimed.
State the root and tier back to the user before doing anything destructive. When a client or project prints mode: unknown, ask which mode the scope uses; a guessed mode flags candidates against the wrong type set. When the script exits 1, nothing is opted in: stop and ask whether to scaffold, and create no directories.
Phase 2 — Extract Content From Each Inbox File
For each file in _inbox/, dispatch by extension:
| Extension | Tool |
.md, .txt, .vtt | Read directly |
.pdf | invoke the pdf skill |
.docx | invoke the docx skill |
.pptx | invoke the pptx skill |
| anything else | ask the user |
While reading, apply the extraction heuristics in references/extraction-heuristics.md. The short version: pull 6-12 surprising or contradictory quotes; flag tensions; split stated and unstated assumptions; capture action items with owner + priority; tag cross-note relationships as confirms | contradicts | extends | introduces.
Phase 2.5 — Check Against Accepted Memory
Nothing else in the skill reads memory before writing to it, which is how a working session quietly contradicts an accepted record and the groomed note cheerfully writes down both. The conflict then surfaces months later, usually when someone acts on the stale half.
This phase carries a half number on purpose. Phases 3 through 6 keep the numbers they have had since v1, and every scaffold, note, and CLAUDE.md that refers to "phase 5 sign-off" keeps pointing at sign-off.
For each inbox file, in order:
- Extract the named entities. People, systems, vendors, regions, anything a record might be about.
Normalize them through the scope's alias table before any lookup. Skip this and "Shachi" and "Saatchi" search as two people, which produces a clean no-conflict report on a scope that has the conflict. Write the entities to one file, one per line, in a
mktemp -doutside the scope, then run:bash <skill-path>/scripts/normalize-entities.sh <scope-root> --entities <file>Stdout is the canonical list step 3 writes out. The script reads the
### Alias tableand### Transcription-error mappingsections of the scope'sCLAUDE.md, and of the client root's for a project scope, matching whole strings and ignoring case. Each mapping it applies printscorrection: <variant>→<canonical>on stderr; keep those lines fortranscript_corrections. Exit 1 means one variant maps to two canonicals: stdout is empty, so show the user the conflict line and stop until they fix the table. Exit 2 is a usage or unreadable-file error.Run the candidate lookup. Write the step 2 canonical entities to one file and the input's claim sentences (the Notable Quotes and Tensions candidates phase 2 pulled) to another, one per line, both in a
mktemp -doutside the scope. Then run:bash <skill-path>/scripts/find-candidates.sh <scope-root> --entities <file> --claims <file>It greps the entities against each record's frontmatter, runs each claim as a
qmd vsearchagainst the scope's per-type_memorycollections, and merges the two hit lists before any header is read. Those collections exist once thememory-indexskill has registered the scope, a step that waits on the user's yes to its dry run, so a scope it hasn't reached falls back to grep and the report points the user atmemory-index. Stdout ends on acounts:line, which phase 6 copies.When the script prints
vec off:on stderr, the lookup ran on grep alone. Keep that line for the phase 6 report. When it printsvec stale:instead, vec search ran on an index older than some record; keep that line too.- Read the headers of the
candidate:lines. Frontmatter, and no further. That's stage 3 of references/retrieval-funnel.md. Asupersededordeprecatedrecord leaves at the header read and never costs a body read, whichever lookup found it. - Body-read only the records whose headers suggest overlap with something this input actually claims.
That read answers two questions rather than one: does this input contradict what the record claims, or does it restate it? A restatement is a confirmation — the claim is still true, and somebody said so on the date this input carries, which is the whole of what last_confirmed is for. Deciding an input doesn't contradict a record means you have already read everything the second question needs, so the confirmation costs nothing past the read that was happening anyway. Keep the pairing of note to records; the stamping call below takes one group per note.
Five body reads per input, and the budget binds. It is not a suggestion to stay near. When detection would need a sixth read to be useful, say so in the phase 6 report and leave the read undone. A budget quietly exceeded on every input is one nobody notices has stopped bounding anything. A scope where five is routinely too few is telling you its records are too granular, which is a finding worth having. Confirmations come out of that same budget rather than drawing one of their own. A qmd query is not a body read, and a vec hit draws on the same five reads as a grep hit. There is no second pass over the records, and no sixth read on the grounds that an input might also be confirming something.
Only status: accepted records produce flags, and only they can be confirmed. A proposed record hasn't been agreed to yet, so disagreeing with it is just discussion and agreeing with it is not a confirmation; a superseded one is already known to be wrong.
Between accepted and proposed, the status filter runs after the body read, never before it. For those two, a record's status decides what its read can produce, not whether it gets read, so a proposed record whose header suggests overlap is body-read like any other and counts against the five-read budget. Filtering it out earlier would make a restatement of it impossible to notice. When an input restates a proposed record, write nothing to the record, leave it out of the stamping call, and put nothing before the phase 5 gate. Name it in the phase 6 report with the note that restated it. Independent restatement is the evidence someone deciding whether to accept the record needs, and this read is the only place a run sees it.
Flag a conflict inline, where the triggering passage lives:
[contradicts accepted: [[<record-filename>|<short-label>]]] <what this input says> | claims: <what the record says>A contradiction is a first-class candidate, resolved at phase 5 sign-off like any other. Its three outcomes are in that phase.
A confirmation is not a candidate: it gets no flag and never passes through phase 5 (the last_confirmed rule in Operating Rules). Its trace is the date on the record itself and the phase 6 report, which names every record the run stamped, every one the stamper declined to write, and every proposed record an input restated.
Phase 3 — Groom Into a Single Note
Emit one note per input at <scope-root>/notes/YYYY-MM-DD-<slug>-<nanoid>.md. The template is at assets/note.template.md.
Three zones, always in this order:
- Frontmatter —
id,date,type,attendees,tags,topics, optionalsource_file(binary sources only),raw_file: raw/<id>.md(whenever the note has raw text, which then lives in the sidecar), optionalrelated. - Extracted sections —
## Notable Quotes,## Tensions,## Stated Assumptions,## Unstated Assumptions,## Open Questions,## Action Items / Memory Candidates. - Raw Content —
## Raw Content, a blank line, and the pointer lineIn [raw/<id>.md](raw/<id>.md). Open it only to verify a quote.Always last.
The raw text itself, the verbatim original (text sources) or extracted text (binary sources), goes in the sidecar <scope-root>/notes/raw/<id>.md, where <id> is the note's id. The sidecar has no frontmatter and holds every line that would otherwise follow the ## Raw Content heading, so note and sidecar together reproduce the raw text byte for byte. Keeping it out of the note lets an embedding index exclude notes/raw/, so a transcript's chunks never outnumber the reviewed sections above it. L<n> in a quote anchor counts lines in the sidecar. The full rule is in references/machine-contracts.md, under "The Raw Sidecar".
Write the sidecar first with bash <skill-path>/scripts/dispose-source.sh raw <scope-root> <inbox-file> --id <id> [--text <extracted-text>], then the note with raw_file set. On exit 1, report its stderr line, leave the source in _inbox/, and groom nothing from it. A note with no raw text at all, such as a directly authored one, keeps an empty ## Raw Content section and no raw_file.
Inside the extracted sections, flag candidates inline using the taxonomy below. Don't hide candidates in a separate file or section — keep them where the triggering passage lives, so the user can read both together.
Candidate Flag Taxonomy
[memory candidate: project] <claim>
[memory candidate: client] <claim>
[memory candidate: update existing [[<filename>|<short-name>]]] <amended claim>
[journal candidate: <generalized pattern>]
[working-state candidate] <claim>- The scope token (
projectorclient) is the skill's proposal, not a decision. The user confirms or overrides at phase 5. - The contradiction flag, in the shape phase 2.5 gives, is the one candidate type that needs memory read first.
- The "update existing" variant signals an amendment to an already-crystallized record. Its scope is inherited from the target.
- Journal candidates take no scope token — their destination is always the cross-client journal.
- A working-state candidate marks a decision still in motion, which belongs in
working-state.mdrather than a record (see references/scope-decisions.md). If the user confirms at phase 5 that they moved it there, append| landed: working-stateand keep the token. A working-state decision is a## YYYY-MM-DD: Titleentry, whichltm promote <scope>/working-state.md --entry "<Title>" --bank <bank>lifts to an org Bank (rules).
Emit only token shapes registered in The Token Grammar in references/machine-contracts.md; scripts/lint-scope.sh (check_tokens) fails any other shape on a v2 file.
Open Question Slugs
Before writing the Open Questions section, grep the scope's prior notes for slugs already in play:
grep -rhoE '\[open question( resolved)?: [^]]*\]' <scope-root>/notes/ | sort | uniq -c | sort -rnReuse an existing slug for the same question rather than minting a new one. Then, in the note you're writing:
- Report each recurring open question with the number of notes it has stayed open across. That count is what you bring to the person who can close it.
- Rewrite this note's own entries to the resolved form for anything this session answered.
- Flag a slug open across three or more notes as
[tension: unacknowledged], unless the transcript shows someone naming it out loud.
Process mode never edits a prior note. Each note is a faithful record of what was known that day, and rewriting an old one to reflect a later answer destroys the only thing it was good for. A question resolved today gets its resolution in today's note.
Use the heuristics in references/scope-decisions.md to pick a scope. The short version: project is the floor (cheapest to be wrong); client requires recurrence across projects or stakeholder-level facts; journal requires generalization beyond this client.
Phase 4 — Dispose Source
Sources leave _inbox/ here. Their words survive in the note's raw sidecar, so once the note is written, bash <skill-path>/scripts/dispose-source.sh dispose <scope-root> <inbox-file> --note <note-path> checks that sidecar, then deletes a text source or moves a binary one to notes/attachments/ and prints the source_file: line for the note's frontmatter. On exit 1 the source stays in _inbox/: fix what each stderr line names and rerun. An attachment name clash goes to the user.
Never leave a file in _inbox/ after grooming. The inbox is a queue, not a library.
Stamp Confirmations
Phase 2.5 worked out which records this run's inputs confirm. Writing the dates is mechanical, so a script does it:
bash <skill-path>/scripts/stamp-confirmed.sh <scope-root> \
--note <note-path> <record-path>... \
[--note <note-path> <record-path>...]...Each --note group is one groomed note and the records that note confirms. The script reads the note's own date: and stamps it onto them; each record it refuses comes back as a skipped: line naming the reason. Paths are absolute or relative to the scope root.
One call for the whole queue, never one per input. Hand it every group at once. Two inputs in one run can confirm the same record, and the script only gets to write that record once — taking the later of the two dates — if it sees both groups in the same invocation. A loop calling it per input has already written the first date before it hears about the second, so the same inbox writes that record once or twice and reports it differently depending on which file got read first.
A run that found no confirmations makes no call at all, and most runs are that run. An invocation with no --note group is a usage error rather than a quiet no-op, so there is nothing to hand it and nothing to run.
The script writes without stopping to ask, which is the exception spelled out in Operating Rules. Keep its output: phase 6 reports both the stamps and the skips off those lines. --dry-run prints the same lines and writes nothing, if you want to look first.
Phase 5 — Propose and Crystallize (gated)
Stop here. Show the user every groomed note and every flagged candidate, organized by candidate type and proposed scope. Wait for explicit per-candidate sign-off.
For each candidate the user approves:
- Write the file with
new-record.sh, which picks the template and folder from the type and the scope's memory mode, fillsid, the dates,source_refsandstatus, writesmemory-bank.yamlfirst when the scope root has none, and prints the new path:bash <skill-path>/scripts/new-record.sh <scope-root> --type <memory_type> --slug <slug> --note <note-id> [--status accepted] bash <skill-path>/scripts/new-record.sh "11 Clients/11.99 Journal" --journal --slug <slug> --note <note-id> --source-scope <scope path from vault root>--statusdefaults toproposed. On exit 1 nothing was written: fix what each stderr line names and rerun. Everyapplies_toandownersfacet uses a prefixmemory-bank.yamllists underfacet_prefixes, so add a new prefix there first. Until--to-ltmruns, a scope still holdingschema: 2records failsltm validate. - Fill the title and body at the printed path: every
{{...}}placeholder the script left, from the approved candidate. - Rewrite the candidate line with
crystallize-line.sh;--update(update existing) appends the note'sidtosource_refs:
The line becomesbash <skill-path>/scripts/crystallize-line.sh <scope-root> --note <note-path> --line <n> --record <record-path> [--update][[<record-basename>|memory]] <claim>(|memory — updatedfor update existing) or[[<journal-entry-relative-path>|journal]] <pattern>. It also lowers the note'sunpromoted_candidates, so leave that count alone. Exit 1 writes nothing; stderr names the fix. - For "update existing":
- Amend the target record's body. Mark new content inline with
(added YYYY-MM-DD, <note-id>)to trace each passage. - Keep
dateunless the core claim has materially changed; then consider superseding it with a new record.
- Amend the target record's body. Mark new content inline with
Resolving a Contradiction
A [contradicts accepted: ...] flag has three outcomes, and the user picks one per flag:
- Amend. The record was right but incomplete. Update it as for update existing, with
--amend --update. - Supersede. The record is now wrong. Create the replacement. When
ltmis onPATHand both records carryschema: 1, runltm supersede <old-id> <new-id>; otherwise set the old record'sstatus: supersededandsuperseded_byand the new one'ssupersedesby hand. Either way, pass the replacement as--recordand--supersedes <old-label>. - Dismiss. They don't actually conflict, or the new statement is the mistaken one. Append
| dismissed: <reason, and who decided>and leave everything else where it is.
A dismissed flag stays in the note permanently. It is the record that someone looked at this and decided it was nothing, which is what stops the next four notes from re-flagging the same non-conflict.
Nothing crystallizes without the user's sign-off. Every record creation requires explicit user approval per candidate. Candidates not crystallized keep their [memory candidate: ...] or [journal candidate: ...] prefix. A declined update-existing line keeps its prefix too and takes Dismiss's suffix above, | dismissed: <reason, and who decided>, after any related: tail.
Phase 6 — Verify
Run the lint over the scope first:
bash <skill-path>/scripts/lint-scope.sh <scope-root> --drainedThen list accepted records nobody has confirmed lately:
bash <skill-path>/scripts/stale-records.sh <scope-root>The lint fails a record with a malformed id, a memory_type that doesn't match its folder, or no source_refs, and it fails an _inbox/ holding anything but .gitkeep. Check by hand the one thing it can't:
- Every candidate flag in every groomed note has either been resolved to a wiki link OR retains its original prefix. No half-rewrites, no orphans.
Then report what phase 2.5 and the stamper did:
- Any input where the phase 2.5 read budget bound is named, with what went unread.
- Every record the stamper stamped, with its new date, off its
stamped:lines. - Every record the stamper declined, with its reason, off its
skipped:lines and nothing else. - Every
proposedrecord an input restated, one line per record and note, asrestated proposed: <record-path> by <note-path>, both paths relative to the scope root. - Every input's candidate sources, one line per note, as
candidates: <note-path> grep=<g> vec=<v> both=<b>, copied from that input'scounts:line, with itsvec off:orvec stale:line beneath it when either fired. When the fallback fired, name thememory-indexskill in the report as what registers the scope. Whenvec stale:fired, name thememory-indexskill's refresh hook as what keeps the index current. - Every line
stale-records.shprinted, stdout and stderr, verbatim. It only reports; confirming or deprecating a record is the user's call.
Report failures. Don't silently retry or auto-fix — those bugs hide.
Scaffold Mode
Stand up the directory structure and CLAUDE.md set for a new scope. Ask at most four questions:
- Scope — project, client, or journal. (Suggest a default based on cwd: inside a client root, suggest client; inside
pursuits/orprojects/, suggest project; matches*/11.99 Journal*, suggest journal.) - Target path — where to scaffold. Default: cwd. Exception: journal scope defaults to
11 Clients/11.99 Journal/relative to the nearest vault root. - For project scope only — pursuit (pre-sale, RFP work) or delivery (post-sale, working sessions)? This drives the
type:enum baked into the generated CLAUDE.md. - For client and project scope — memory mode: lightweight (default, 3 types: Decision/Context/PolicyRule) or canonical (4 types: Decision/PolicyRule/Exception/Context). The user can answer simply "lightweight" / "canonical" or "use the full schema". See references/memory-bank-schema.md for the trade-off. Default is lightweight — Exception folds into Decision.
The chosen memory mode gets recorded in the scope's CLAUDE.md (top frontmatter blockquote) so later process inbox runs flag candidates against the right type set.
Outputs per Scope
Each scope's file tree (client, project, journal, and what canonical mode swaps in) is in references/scaffold-layout.md.
Template Substitution
The CLAUDE.md and README templates use double-curly placeholders. Substitute these at scaffold time:
| Placeholder | Replacement |
{{ClientName}} / {{ProjectName}} / {{ScopeName}} | Human-readable name supplied by the user. |
{{pursuit|delivery project}} / {{pursuit|project}} / {{pursuits|projects}} / {{Pursuit|Project}} | Pick one side of the pipe based on question 3. Use the title-cased {{Pursuit|Project}} form when the substitution lands inside a heading. |
{{MEMORY_MODE}} | lightweight or canonical. |
{{SCOPE_NAME}} | The scope directory's basename, lowercased, each run of characters outside a-z0-9 collapsed to one hyphen, hyphens stripped from both ends. |
{{MEMORY_TYPES}} | Decision, Context, PolicyRule (lightweight) or Decision, PolicyRule, Exception, Context (canonical). |
{{MEMORY_TYPE_ENUM}} | Decision | Context | PolicyRule or Decision | PolicyRule | Exception | Context. |
{{MEMORY_TYPE_FOLDERS}} | decisions/, context/, rules/ or decisions/, policy-rules/, exceptions/, context/. |
{{MEMORY_TYPE_LIST}} | Markdown bullet list of types with one-line descriptions (pull from references/memory-bank-schema.md). |
{{MEMORY_TYPE_SUMMARY}} | Short table or bullet list summarizing types for the human-facing _memory/README.md. |
{{RULES_FOLDER}} | rules (lightweight) or policy-rules (canonical). |
{{NOTE_TYPE_ENUM}} | Pipe-separated baseline note types: scoping-call | working-session | stakeholder-call | internal | reading | braindump | transcript | status | meeting | decision | source | person | debrief | overview. The last six are the vault note templates' types, added so both vocabularies validate on one key; nothing is renamed. The generated project CLAUDE.md will override this in its Deltas section if the user provides project-specific values. |
{{date}} | Today's date in ISO format. |
{{engagement-list}}, {{stakeholder-list}}, {{tag-list}}, {{type-enum-values}}, {{one-sentence-project-description}} | User-supplied during scaffold; left as HTML-commented placeholders if the user defers. |
Leave placeholders that the user defers as <!-- Fill in: ... --> comments rather than blanks — that way they're easy to grep for later.
Stamping the Scaffold
Every markdown file this mode generates carries a scaffold_digest in its frontmatter: a hash of the body it was written with. Stamp them by running the script, rather than computing the hash inline:
python3 <skill-path>/scripts/scaffold_digest.py --stamp <every generated .md>jd-file stamps the Overviews it mints and jd-audit re-hashes every scaffolded file to decide what counts as furniture. All three skills carry byte-identical copies of that script, because a boundary drawn one byte differently in any copy marks every stamped file as edited. Frontmatter stays out of the hash because Obsidian rewrites it unprompted—adding tags, touching timestamps—and none of that is a person writing content.
README.md and CLAUDE.md are furniture in a scaffold and real content everywhere else, so their names can never answer whether anyone has written here. A file whose digest still matches is one nobody has touched, and an ID holding only such files is empty no matter how many files it holds.
Stamp last, once every body is final—substitutions resolved and the Deltas section filled or left as <!-- Fill in --> comments. Stamp before that and the next check reads this skill's own writing as a human edit. Skip files that carry no frontmatter. They need no digest: .gitkeep is furniture by its name alone, which is how jd-audit already reads it.
The Deltas Convention
Each generated CLAUDE.md (client and project) carries a ## Deltas section with a fixed structural shape, not free-form. The shape:
Client-level Deltas:
### Active engagements— short list of in-flight projects and pursuits.### Cross-engagement stakeholders— roster of people who appear across multiple projects at this client. Format:Name — Role/Title. Owns / decides: what they sign off on. Additional facts.### Alias table— every name that arrives under more than one spelling, canonical form first.### Client-wide tag namespace— controlled vocabulary for memory recordtags:.
Project-level Deltas:
### Note type: values— controlled vocabulary for note frontmattertype:.### Active stakeholders— project-specific roster.### Alias table— project-specific aliases, optionally pointing to client-level Context records.### Tag namespace (suggested)— project-specific tags.### applies_to facets— what each facet prefix inmemory-bank.yaml'sfacet_prefixesmeans here.### Pre-existing content— optional, only when a project subdirectory predates the substrate.
The alias table is load-bearing for grooming accuracy. It covers everything that reaches a note under more than one spelling: transcript mishears, nicknames, abbreviations, and OCR variants off slides and PDFs. The form is canonical <- [variant, variant].
During process mode, read it and normalize while grooming, then record what was applied in the groomed note's frontmatter as transcript_corrections: [Saatchi→Shachi, Lince→Lancey]. The key keeps its old name so greps written against v1 notes keep working.
Two rules govern how far normalization reaches:
- Extracted sections only. Never rewrite raw content. It is the source of truth, and a normalized transcript stops being a record of what was actually said.
- Read either heading. Scopes scaffolded before the rename say
### Transcription-error mapping. Both resolve to the same table, so an existing setup keeps working without being touched.
The entities frontmatter key holds canonical forms only, never the variants they came from. The point of the key is that one grep finds every note touching a person or system, and that fails the moment the same person appears under three spellings.
During scaffold mode, prompt the user for known stakeholders and tag namespace seeds. Offer to populate the roster inline. If the user defers, leave the structure with <!-- Fill in --> comments.
What Never Lands in _memory/
No MEMORY.md or INDEX.md summary file in any _memory/ directory. Filenames already carry slug + id; subfolders carry type. An index would duplicate information that globbing already surfaces, drift the moment a record is renamed or superseded, and teach a retrieval path that doesn't exist in Copilot Spaces or MCP queries. If you need "what's currently in memory," generate it on demand: Grep "^title:" _memory/.
Idempotency
If the target directory already contains an opted-in structure (matching markers), do not clobber. Report "already scaffolded at <path>" and offer to regenerate just the CLAUDE.md set. If the user agrees, write regenerated content to CLAUDE.md.new (and README.md.new, etc.) rather than overwriting — they may have customizations to merge by hand. Stamp the .new files the same way and leave the originals untouched. If the user has written into one, its digest stops matching, and that mismatch is the signal jd-audit reads.
Existing-directory Regeneration
When invoked at a pre-existing project (e.g., pursuits/atlas/) that already has notes and _memory/:
- Detect existing structure; do not overwrite content.
- Add any missing subdirectories per the chosen memory mode (e.g.,
_memory/rules/for lightweight,_memory/policy-rules/and_memory/exceptions/for canonical) with.gitkeep. - Add any missing top-level files (
README.md,_personal.md,memory-bank.yaml,working-state.mdfor projects,patterns-journal/{CLAUDE.md,journal.md}) without clobbering existing content. - Regenerate
CLAUDE.mdfrom the project template (write toCLAUDE.md.newif the existing file has been edited beyond template substitution). - Ask the user for deltas — active stakeholders, custom tag namespace, custom
type:enum values, transcription-error mappings. Append them under the regenerated## Deltassection. - Stamp every file this run wrote—the regenerated
CLAUDE.mdorCLAUDE.md.new, plus anything added in step 3. The Deltas append in step 5 changes the body, so stamping before that records a digest the file already no longer matches. - If the pre-existing
_memory/uses a different mode than the user requests (e.g., existing canonical 4-type vs. requested lightweight), report the mismatch and ask before changing anything. Do not auto-migrate.
Migrate Mode
Bring one opted-in scope's v1 files onto the v2 frontmatter contract. Full spec in references/migration.md.
bash <skill-path>/scripts/migrate-scope.sh <scope-root> # dry run, writes nothing
bash <skill-path>/scripts/migrate-scope.sh <scope-root> --apply # writes
bash <skill-path>/scripts/migrate-scope.sh <scope-root> --to-ltm [--facet-map <file>] [--apply] # v2 records to schema: 1Show the user the dry run and get approval before --apply. Tier 1 is approvable as one batch. What it changes and what it refuses to guess are in references/migration.md, under What Tier 1 Does and What It Refuses to Do. Read the "needs a human" list at the end of the run. --to-ltm runs after Tier 1, all or nothing, under Migrating Records to ltm in references/migration.md.
Tier 2: Summary and Entities
Tier 2 runs through a sidecar, under The Tier 2 Sidecar in references/migration.md. Run the extract before applying anything, since a note already carrying schema: 2 is skipped whole.
# 1. write the sidecar: one extract per v1 note, plus a proposals skeleton
bash <skill-path>/scripts/migrate-scope.sh <scope-root> --tier2-extract <dir>
# 2. fill in summary and entities for each note id in <dir>/proposals.yaml
# 3. dry run the merge, show it to the user, then write
bash <skill-path>/scripts/migrate-scope.sh <scope-root> --tier2 <dir>/proposals.yaml
bash <skill-path>/scripts/migrate-scope.sh <scope-root> --tier2 <dir>/proposals.yaml --applyGenerate summary and entities from the emitted extract and from nothing else: each summary one line the extract supports, each entity a canonical name the extract carries verbatim.
Tier 2 is approved separately from Tier 1, per file or as one batch, whichever the user wants.
Verifying a Migration
bash <skill-path>/scripts/verify-migration.sh <scope-root> --since <pre-migration-ref>It reads git history rather than the working tree, so it also verifies a migration committed last week. It reports and never repairs. A passing run prints a paragraph for the scope's patterns journal: offer it to the user, and leave writing it to them.
Frontmatter Quick Reference
Write every block to The Frontmatter Contract in references/machine-contracts.md: one line per value, closed inside the first 20 lines, keys in the order below among those you keep.
Groomed note, in order:
schema, body_schema, id, date, type, summary, attendees, tags, topics, entities, source_file, raw_file, transcript_corrections, open_questions, resolved_questions, deferred_tensions, unpromoted_candidates, relatedMemory record (schema: 1), in order:
schema, id, memory_type, title, status, date, effective_from, effective_to, last_confirmed, review_by, summary, superseded_by, supersedes, promoted_from, promoted_to, subject, applies_to, owners, tags, source_refs, related, body_schema, exception_toschema: 2 records and journal entries keep the order in machine-contracts.md. status is proposed|accepted|superseded|deprecated|rejected. Type-specific body fields are in references/memory-bank-schema.md.
A record's generation is its schema value: 1 is long-term-memory-kit's format and what new records carry, 2 awaits --to-ltm. Notes and journal entries stay at schema: 2. Files with no schema key are v1. They stay legal forever, and a scope holding both generations is supported. The lint checks one thing on them, whether their wiki links resolve, because a link resolving to no file is broken whichever generation wrote it.
memory_type values depend on the scope's chosen memory mode:
- Lightweight (default):
Decision | Context | PolicyRule. Exception is folded into Decision. - Canonical:
Decision | PolicyRule | Exception | Context.
Phase 1's mode: line reports the scope's mode. Flag candidates against that vocabulary.
Journal entry follows the schema: 2 record order, using themes in place of tags and status values of current|superseded|archived. Its source_refs are compound strings of the form <scope-path>::<note-id>, so a moved note doesn't break the reference.
Filename and ID Conventions
- All IDs come from the globally-installed
nanoid -s 10CLI. Never generate manually or via Python's random module. - Notes:
YYYY-MM-DD-<slug>-<nanoid>.md. - Memory records:
<slug>-<nanoid>.mdinside the type folder. - Journal entries:
YYYY-MM-DD-<slug>-<nanoid>.mdinsideentries/. - Slugs: lowercase, kebab-case, 3-6 words, descriptive of the primary subject.
Operating Rules
- Stage, never auto-commit. Outputs are proposals. Never run
git commitunless the user asks. - Preserve raw content as the source of truth. Memory records cite notes; they don't replace them.
- One groomed note per input. No four-file fragmentation. Sections, not separate files. The raw sidecar under
notes/raw/is not a second note: it holds the unreviewed raw text and nothing from the reviewed layer. - Never move a record across scopes. Scope is decided at flagging time, confirmed at sign-off, sticky after crystallization. If a record needs to move, the user moves it by hand. (This trades convenience for audit safety — at high enough volume, v2 may add a guarded scope-move mode.)
last_confirmedis written without sign-off. The gate on_memory/— no file written until the user approves that item — has one exception, and this is it. When an input confirms a claim anacceptedrecord already makes, the run stamps the confirming note's date onto the record and names it in the phase 6 report instead of asking. Everything else stays gated: creating a record, amending one, superseding one, changing a word of what one claims. What the stamp touches is metadata rather than content — a date recording when the claim was last seen to hold, never the claim itself — which is what makes it safe to leave ungated. It stays that narrow on purpose. A prompt whose answer is always yes, in front of every input, teaches the user to approve without reading, and the gate is then worth nothing on the writes it exists for.- Cross-scope references are fine. A project note can wiki-link to a client-scope record. A client record can list project note ids in its
source_refs. The record's home (which_memory/it lives in) defines its scope, not its references. - Don't open
raw_fileunless verifying a quote. When reading a note to answer a question, read its extracted sections and leave the sidecar closed. Those sections are the reviewed layer and are what you came for. The raw text is for a human reading back, and for verifying a quote you have specific reason to doubt. Opening it by default pulls a whole transcript into context to answer something the sections already answered. A note with noraw_filestill holds its raw text inline, so read it down to## Raw Contentand no further. - Never rename, resolve by id. Files keep the name they were created with and ids never regenerate. Resolve a wiki link as a path from the linking note's directory first, which is how a cross-scope link resolves, then, where the target holds no
/, by filename within the scope. When both miss, resolve by id. A<slug>-<nanoid>name carries its id as the ten characters that end the basename, with a hyphen right before them. The nanoid alphabet includes-, so the id can hold a hyphen of its own:atlas-dry-run-prep-zFpm-hfD5ucarrieszFpm-hfD5u, not thehfD5uafter its last hyphen. The id search stays within the linking note's scope. A target whose basename lacks that suffix carries no id and has no id step. Report a link broken only after every step fails. - VTT raw content is collapsed, not verbatim. Cues get merged into speaker turns with timestamps kept at turn boundaries, via
scripts/collapse-vtt.sh. This is the one sanctioned exception to preserving raw content exactly as captured. A wall of two-second cues is unreadable to the human the zone exists for, and the words themselves are unchanged. A blank line separates the turns, because markdown runs consecutive non-blank lines together as one paragraph;scripts/reflow-raw.shrepairs notes groomed before that separator existed (references/migration.md). Captions carrying no speaker label collapse one turn per cue under@unknown, the same token an open question uses for a resolver nobody named. Attribute unlabelled speech to@unknowneven when a neighbouring turn makes a name look obvious. A file the collapser refuses makesdispose-source.sh rawexit 1, handled as phase 3 says.
When NOT to Use This Skill
- The user has a single ad-hoc note they want to write directly. The skill is for queue-driven processing, not freeform composition.
- The cwd is not inside an opted-in directory and the user hasn't asked to scaffold one. Do not silently create memory infrastructure where none was intended.
- The user is asking about memory records for an existing skill or code repo. This skill targets consulting notes in an Obsidian vault. Code-repo memory wants the memory-bank reference architecture this skill borrows from, not this skill.
Further Reading
- references/extraction-heuristics.md — quote selection, tension surfacing, assumption mining.
- references/scope-decisions.md — full heuristics for proposing project vs client vs journal scope.
- references/scaffold-layout.md — the directory tree scaffold mode writes for each scope, and what canonical mode changes in it.
- references/memory-bank-schema.md — vendored summary of long-term-memory-kit's record format. The kit is authoritative where the two disagree.
- references/retrieval-funnel.md — token-efficient four-stage retrieval at scale.
- references/machine-contracts.md — the frontmatter contract and the closed token grammar, both enforced by the lint.
- references/migration.md — what Tier 1 migration changes, what it refuses to guess, and the safety properties behind both.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

