Dreaming
Memory decays. Files move, commands change, invariants shift, duplicates
accumulate. This skill is the maintenance loop that keeps the corpus
trustworthy — one procedure, entered from either direction.
Reactive entry. Something changed: a file was renamed, a command flag was
removed, an ADR shifted a subsystem boundary, a code review found stale
memories referencing old paths. Run the procedure scoped to the affected area.
Proactive entry. Idle time, end-of-slice wrap-up, or a scheduled
maintenance window. Run the procedure corpus-wide.
Procedure
Validate. Run doctrine memory validate corpus-wide (reactive: scope
with --path-scope/--glob to the changed area). Triage each finding:
- Fix immediately if trivial (update a path, refresh a scope)
- Capture as a backlog item if non-trivial (risk, chore, or improvement)
- Note and defer if low-impact and not time-sensitive
Prune. Identify stale memories:
- Past
review_by date → flag for review or archive
- Unverified threads past expiry → archive (
memory status <REF> archived)
working-lifespan memories older than a few days → retract or promote
to a durable type
- Run
doctrine memory status <REF> archived for stale items; use
retracted for memories that were simply wrong.
Link. Strengthen the graph:
- Review suggested relations on recently-recorded or recently-edited
memories (check
memory show <REF> for relation rows)
- Check for orphans — memories with no inbound and no outbound relations
memory list --orphans
- If there are orphans, focus on these - linking 20-30 records this run
- If there aren't, explore the corpus and strengthen / prune connections
between existing memories
- use
memory find <keyword> to find candidate memories for linking
- Run
doctrine link for high-confidence matches
Backlog grooming. Findings that can't be fixed in this pass become
backlog items:
- Risks for not-yet-surfaced issues (e.g., a memory pointing at a
deprecated API)
- Chores for cleanup work (e.g., merging duplicate memories)
- Improvements for enhancements (e.g., promoting a pattern memory to
a spec)
Fact-check. Spot-check the top-N memories by severity × staleness
(days since updated). For each:
- Check the cited source (code path, doc, ADR) against the current tree
- If correct, no action
- If drifted, correct with
doctrine memory edit <REF>
- If obsolete, supersede (
memory status <REF> superseded --by <SUCCESSOR>) or quarantine (memory status <REF> quarantined)
- If unverifiable, lower trust (
memory edit <REF> --trust low)
Report. Produce a brief handoff summary:
- Actions taken (validated N, pruned M, linked L, fact-checked F)
- Findings deferred to backlog (with ids if filed)
- Items flagged for human attention (high-severity, ambiguous, needs
decision)
- Write this to
notes.md or the active handover so the next agent
doesn't re-do the same checks.
1---2name: dreaming3description: Unified memory corpus maintenance — covers both reactive (change-triggered) and proactive (periodic/idle-time improvement) paths. One skill, two entries.4---56# Dreaming78Memory decays. Files move, commands change, invariants shift, duplicates9accumulate. This skill is the maintenance loop that keeps the corpus10trustworthy — one procedure, entered from either direction.1112**Reactive entry.** Something changed: a file was renamed, a command flag was13removed, an ADR shifted a subsystem boundary, a code review found stale14memories referencing old paths. Run the procedure scoped to the affected area.1516**Proactive entry.** Idle time, end-of-slice wrap-up, or a scheduled17maintenance window. Run the procedure corpus-wide.1819## Procedure20211. **Validate.** Run `doctrine memory validate` corpus-wide (reactive: scope22 with `--path-scope`/`--glob` to the changed area). Triage each finding:23 - Fix immediately if trivial (update a path, refresh a scope)24 - Capture as a backlog item if non-trivial (risk, chore, or improvement)25 - Note and defer if low-impact and not time-sensitive26272. **Prune.** Identify stale memories:28 - Past `review_by` date → flag for review or archive29 - Unverified threads past expiry → archive (`memory status <REF>30 archived`)31 - `working`-lifespan memories older than a few days → retract or promote32 to a durable type33 - Run `doctrine memory status <REF> archived` for stale items; use34 `retracted` for memories that were simply wrong.35363. **Link.** Strengthen the graph:37 - Review suggested relations on recently-recorded or recently-edited38 memories (check `memory show <REF>` for relation rows)39 - Check for orphans — memories with no inbound and no outbound relations40 `memory list --orphans`41 - If there are orphans, focus on these - linking 20-30 records this run42 - If there aren't, explore the corpus and strengthen / prune connections 43 between existing memories44 * use `memory find <keyword>` to find candidate memories for linking45 - Run `doctrine link` for high-confidence matches46474. **Backlog grooming.** Findings that can't be fixed in this pass become48 backlog items:49 - **Risks** for not-yet-surfaced issues (e.g., a memory pointing at a50 deprecated API)51 - **Chores** for cleanup work (e.g., merging duplicate memories)52 - **Improvements** for enhancements (e.g., promoting a pattern memory to53 a spec)54555. **Fact-check.** Spot-check the top-N memories by severity × staleness56 (days since `updated`). For each:57 - Check the cited source (code path, doc, ADR) against the current tree58 - If correct, no action59 - If drifted, correct with `doctrine memory edit <REF>`60 - If obsolete, supersede (`memory status <REF> superseded --by61 <SUCCESSOR>`) or quarantine (`memory status <REF> quarantined`)62 - If unverifiable, lower trust (`memory edit <REF> --trust low`)63646. **Report.** Produce a brief handoff summary:65 - Actions taken (validated N, pruned M, linked L, fact-checked F)66 - Findings deferred to backlog (with ids if filed)67 - Items flagged for human attention (high-severity, ambiguous, needs68 decision)69 - Write this to `notes.md` or the active handover so the next agent70 doesn't re-do the same checks.