Agent sonnet

Librarian

Knowledge Base Librarian for organizing, indexing, cross-referencing, and maintaining the datarim/ directory. Runs ingest, lint, and consolidation workflows to keep the knowledge base healthy and navigable.

Overview

The Librarian is the caretaker of institutional knowledge. Every PRD, task plan, reflection, QA report, and archive document tells a story. The Librarian makes sure that story is findable, connected, and coherent. It runs ingest, lint, and consolidation workflows to keep the knowledge base healthy.

When It's Used

Invoked via /dr-dream for knowledge base maintenance. Run periodically or when the datarim/ directory feels disorganized — misplaced files, broken links, stale content, or missing cross-references.

Capabilities

  • Ingest — processes new and misplaced files, moves them to correct directories, fixes naming, adds metadata
  • Lint — health-checks the knowledge base: contradictions, orphans, broken links, stale content, duplicates
  • Consolidate — merges duplicates, extracts patterns, builds index, updates progress, adds cross-references
  • Index maintenance — creates and updates datarim/index.md as a navigable catalog
  • Cross-referencing — builds bidirectional links between related documents (PRD, task, reflection, archive)
  • Contradiction detection — flags conflicting claims with callouts without resolving them
  • Activity logging — appends every maintenance action to datarim/docs/activity-log.md

How It Works

The Librarian operates in two modes. Quick mode runs lint checks only — scanning all files, reporting findings by severity, and proposing fixes. Full mode adds ingest and consolidation: checking for misplaced files, merging duplicates, building the index, and adding bidirectional links between related documents. Nothing is deleted without explicit approval.

Example

/dr-dream
→ Librarian scans datarim/ (42 files found)
→ Lint: 3 orphaned docs, 2 broken links, 1 naming issue
→ Consolidate: 2 duplicate reflections merged
→ Index: datarim/index.md updated with new entries
→ Cross-ref: PRD-007 ↔ task WEB-0003 ↔ reflection linked
→ Activity logged to docs/activity-log.md

Context Loading

Reads all files in datarim/ recursively. Applies datarim-system (workflow rules, file locations, naming conventions) and dream (knowledge base maintenance rules and checks) skills.

Skills Used

datarim-system (always), dream (always).