The /dr-dream Command — Knowledge Base Maintenance
How /dr-dream organizes, deduplicates, and cross-references the datarim/ knowledge base — running inventory, lint, consolidation, and index rebuilds in three modes.
Every project accumulates documents over time: PRDs, plans, reflections, archives. After enough completed tasks, the relationships between those files blur. Something was decided in a reflection but never linked from the relevant PRD. Two planning documents overlap by seventy percent. A directory sits empty. /dr-dream addresses that drift.
The name follows a biological analogy: the way sleep consolidates memory, Dream consolidates knowledge. The work happens in the datarim/ directory and documentation/archive/ — not source code, not configs, only the project's institutional knowledge. The Librarian agent executes it.
Three modes
Running /dr-dream without arguments triggers full maintenance: inventory, lint, consolidation proposals, and index rebuild — roughly two to five minutes. /dr-dream lint runs the health checks only, with no changes, in about a minute. /dr-dream index rebuilds datarim/index.md alone in thirty seconds.
The recommended cadence is every ten to fifteen completed tasks, or after any /dr-archive run that created more than five new documents.
What the full pass checks
The inventory step scans every .md file in both directories, recording path, size, frontmatter fields, and inbound and outbound links. The lint step looks for contradictions between documents, stale references to completed tasks still marked active, orphaned files with no inbound links, duplicate content above a seventy-percent overlap threshold, broken cross-reference symmetry, and oversized files above five hundred lines.
Consolidation proposals come next — merge candidates, cross-reference additions, frontmatter gaps, misplaced files, naming inconsistencies. None of these apply automatically. The command presents the list and waits for explicit approval before touching anything.
The index
Every full pass or /dr-dream index run rewrites datarim/index.md. The index catalogs all documents by type, groups them by frontmatter tags where available, lists recent activity, and shows knowledge graph metrics: total document count, connection count, and orphan count. It is the entry point for navigating accumulated project knowledge without searching through individual files.
Log and next steps
After each run, a maintenance summary appends to datarim/history/activity-log.md. If the pass surfaces framework drift — instructions across skills that have grown inconsistent — the suggested next step is /dr-optimize, which handles structural issues at the framework level rather than the knowledge base level.
See what Datarim is for the broader picture, or read about the Librarian agent that powers this command.