The dream Skill — Knowledge Base Maintenance
How Datarim's dream skill keeps the datarim/ directory healthy — finding misplaced artefacts, flagging contradictions, deduplicating content, and rebuilding the index.
A knowledge base that grows task by task tends to drift. Artefacts land in the wrong directory. Files lose their cross-references. Two documents end up covering the same topic. The dream skill handles the bookkeeping that prevents this accumulation from degrading the quality of future tasks.
It operates on the datarim/ directory and documentation/archive/. It does not touch source code. It does not delete anything without approval. It does not create new knowledge — that is the writer's job.
Three operations
Ingest processes new artefacts. It checks that each file sits in the correct directory, carries a task ID in its filename, has frontmatter, and has links to related documents. An archive file without a matching reflection entry, or a reflection without a matching archive, surfaces as an ingest finding.
Lint runs a health check over the full knowledge base. It looks for contradictions — two documents making conflicting claims about the same topic — and marks both with a callout rather than silently overwriting either. It also flags orphan files with no inbound references, broken links, documents over 500 lines that should be split, and archive entries filed in the wrong area subdirectory. Everything lands in a lint report grouped by severity: critical, warning, info.
Consolidate does deeper work: merging duplicate documents, extracting recurring patterns from reflections into a patterns page, rebuilding the index, and adding bidirectional links between related artefacts. Consolidation does not run automatically — it requires an explicit command.
One concrete example
After ten tasks, the datarim/index.md catalog is stale — it lists documents from six months ago and misses fifteen newer artefacts. Running /dr-dream index rebuilds the catalog: every document under datarim/ and documentation/archive/ gets a one-line entry grouped by type. The rebuilt index is a navigable catalog, not a flat file list.
When dream runs
/dr-dream with no arguments runs all three operations in sequence. Targeted variants — /dr-dream lint and /dr-dream index — run only the named operation. After every tenth completed task, the framework suggests a full maintenance pass; after any archive with more than five unindexed documents, it suggests an index rebuild. Neither suggestion runs without an explicit operator command.
Activity is appended to datarim/history/activity-log.md, giving a dated record of each maintenance run and what it found.
See also the /dr-dream command post for the command-level walkthrough, and what Datarim is for the full picture.