agents/skills/dream/SKILL.md
Scheduled KB maintenance — ingest yesterday's meetings + session captures, synthesize raw notes into existing topical docs (decisions, people changes, conventions), resolve conflicts, age out stale entries, fix frontmatter and links. Translates raw data into knowledge. Runs unattended; never asks for confirmation. Use for KB maintenance, knowledge base cleanup, dream consolidation, memory hygiene, or as a scheduled daily KB pass.
npx skillsauth add drn/dots dreamInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Audit the argus-kb knowledge base, then apply every fix without confirmation: ingest yesterday's meetings and session captures into the inbox, distill those raw captures into knowledge inside existing topical docs, resolve conflicting facts in favor of the most recent, archive entries that have aged out, and fix schema/link/naming violations. Dream is a scheduled task — it must never block on user input.
Translate raw data into knowledge. A session transcript or meeting summary is signal, not knowledge. Dream's job is to extract the durable facts (decisions, people changes, conventions, gotchas) and merge them into the topical docs that already track each subject. Filing the raw note is a fallback when nothing distillable was captured — not the goal.
Decide and apply. Dream runs unattended. There is no human in the loop, no confirmation prompt, no "flag for manual review" backstop. When a fix is ambiguous, make the best-available judgment, apply it, and log the decision in the report. The report is the audit trail; the KB itself is the result.
The only escape hatch is --dry-run for previewing what dream would do.
$ARGUMENTS — Optional flags and scoping:
--dry-run — report all proposed actions without applying them (the only mode that does not write to the KB)--) to scope the audit (e.g. work/)command -v argus 2>/dev/null | head -1tail -100 ~/.dots/sys/kb-changes/changes.jsonl 2>/dev/null | head -100ls -t ~/.dots/sys/dream-runs 2>/dev/null | head -1date +%Y-%m-%dThe Argus KB MCP server is registered as argus (current) or argus-kb (legacy). Use whichever tool name the harness exposes — try mcp__argus__* first, fall back to mcp__argus-kb__* if the first returns tool-not-found.
Run the nine phases below in order. Apply every fix. Never prompt for confirmation.
$ARGUMENTS contains --dry-run, replace every "apply" step with "report what would change," and skip every non-KB side effect (e.g. closing the Argus task). This is the only short-circuit on writes.~/.dots/sys/kb-changes/changes.jsonl) shows no writes since the timestamp of the last successful dream run (latest file under ~/.dots/sys/dream-runs/), exit immediately with an empty report — saves work when the KB is quiet.$ARGUMENTS contains a bare path prefix, pass it to kb_list as the prefix filter to scope the audit. The triage and decay phases still scan their respective folders (memory/inbox/, full vault) regardless.Pull yesterday's signal into memory/inbox/ so the rest of dream can synthesize it. Skip silently when an upstream is unavailable — meetings are best-effort signal, not a hard dependency.
mcp__granola__list_meetings is available, call it with time_range: "last_day". If the result is empty for a day you know had meetings, retry with this_week — Granola's query_granola_meetings regularly false-negatives on same-day captures, so list_meetings is the more reliable discovery primitive. If the tool returns tool-not-found, skip silently. For each meeting:
memory/inbox/ already contains a doc with the meeting ID in the slug (idempotent on re-runs).get_meetings(meeting_ids=[id]).memory/inbox/<YYYY-MM-DD>-meeting-<short-id>-<slug>.md with:
tags: [meeting-capture, granola, <project-or-person-tag>]mcp__claude_ai_Notion__notion-query-meeting-notes (or the cortex Notion equivalent) is available, query for yesterday's meeting notes. Same dedupe + write pattern, tag with meeting-capture, notion. If the tool returns tool-not-found, skip silently and proceed to step 3.session-end-capture hook writes session summaries directly into memory/inbox/ as Claude Code sessions wrap up. Don't re-fetch — these are already on disk before dream starts and will be processed in Phase 3.kb_list (with prefix filter if provided) to get all document paths..md) into a map for the duplicate-filename check used in Phase 2.Read every document with kb_read and check each against these rules. If the vault has more than 50 documents, warn the user and process in batches of 20, reporting progress after each batch.
Rules from the kb_ingest schema:
Frontmatter (required)
--- fencestitle field (non-empty string)tags field (non-empty array of lowercase strings)Content structure
## H2 for subtopics (not H1 or H3 as top-level sections)Size and scope
Path conventions
Internal links
[[filename]], [[filename|display text]], [[filename#heading]], [[filename#heading|display text]][text](folder/file.md), **folder/file.md**, bare folder/file.md references to other KB docs![[filename]]) are valid for embedding another doc's contentTag hygiene
tags: [...] array only#hashtags in the document body — these fragment tag management and break searchengineering, tech-stack, not TechStack or tech_stack)Vault integrity
Redirects
Record each violation with: document path, rule violated, current value, and suggested fix.
The inbox holds raw captures from /improve, the session-end-capture hook (every Claude Code session, tiered by tag), and Phase 0's meeting ingest. Goal: extract durable knowledge into existing topical docs, not just file the raw note.
Process order (highest synthesis value first):
high-value, commit-merged — work that shipped to main/master. These had verified outcomes; their facts have the highest credibility.meeting-capture — decisions, people changes, action items.session-capture, work-in-progress — record intent + files touched, but discount unverified claims.session-capture, no-commit — exploration, research, Q&A. Most will discard as low-signal; keep only when the session crystallized a durable decision, convention, or vendor evaluation. The ## Recent prompts excerpt is the cheapest signal for whether the session went anywhere./improve captures).For each inbox doc:
kb_read only if truncated.kb_search on the doc's key entities (project names, people, tools, file paths, decisions) to surface candidate target docs.## Decision: <topic> section, with a one-line rationale. If a previous decision on the same topic exists, mark it superseded (Phase 4 mechanics) and link to the new one.<org>/people-* or memory/people/ doc. Add Previously: <old> — superseded <date> if it overrides existing data.patterns/ or the closest existing convention doc. Cross-link with [[wikilinks]].## Open Action Items section. Otherwise skip — action items rot fast and a stale "follow up next week" entry is noise.vendor-evaluations (or equivalent) doc, or the tool's dedicated doc. Use [[wikilinks]] for cross-references.kb_delete the inbox source. The knowledge survives in topical docs; the raw inbox note was scaffolding. The original Claude Code session transcript at transcript_path (typically ~/.claude/projects/<project-slug>/<session-id>.jsonl) is unaffected and remains the ground-truth recovery path if synthesis later turns out to have missed something.memory/archive/meetings/<date>-<slug>.md instead of deleting; the topical docs cite back to it via wikilink.Routing rules (when synthesis didn't apply and the doc needs a new home — apply in order, first match wins):
tags contain a clear domain tag matching an existing top-level folder (e.g. homelab, tools, patterns, health, home, personal, or any user-defined domain folder) → match that folder.user / preference → memory/user/<topic>.md.feedback / correction → memory/feedback/<topic>.md.project or title references a project name → memory/project/<topic>.md.reference / lookup → memory/reference/<topic>.md.memory/reference/.When choosing a filename, follow the existing schema (kebab-case, 2-3 words, topic noun). Strip the date prefix from inbox filenames before re-filing.
Apply every triage and synthesis decision immediately. Do not batch and confirm. The "Hold" path is the rare escape hatch for unsalvageable docs; in normal operation every inbox doc either contributes facts to existing docs (and is deleted) or becomes a new topical doc.
Be ruthless about discarding low-signal content. A session capture that just says "edited a few files" with no decision, no convention, no people fact contributes nothing durable — delete the raw without re-filing. The inbox shouldn't become a graveyard of low-value captures.
Find docs that contradict each other and reconcile in favor of the most recently modified entry. Uses the link graph and clusters from Phase 2.
Modified line in the doc body or YAML, fall back to kb_list modification timestamp).Previously: <old value> — superseded <date>), then mark the superseded doc with a superseded_by: [[canonical-doc]] field in frontmatter and add the redirect tag (existing dream rules already handle redirects).Apply every reconciliation. For unambiguous contradictions (same key, different value) use the fact-update or near-duplicate strategy directly. For ambiguous cases (different scopes, complementary framing, unclear which is canonical), pick the most recently modified doc as canonical, integrate any non-overlapping content from the older doc into it, mark the older as redirect, and note the merge in the report. Don't leave conflicts on the floor — picking one is better than picking neither.
Age out entries that are stale and add little ongoing value. Uses the link graph from Phase 2 and the supersession data from Phase 4.
memory/archive/ and not tagged redirect:
~/.dots/sys/kb-changes/changes.jsonl for this path in the last 90 days (i.e. not written to recently — read activity is not tracked) → archive.memory/archive/ already) → archive.memory/archive/<original-path-without-memory-prefix> via kb_ingest at the new path + kb_delete at the old path. Preserve all frontmatter and content; add an archived: <date> line to the body.Apply every archive decision immediately. The archive folder itself is the recovery mechanism; if a future run mis-archived something, a separate manual restore is the path.
Apply every hygiene fix from Phase 2's violation list. No confirmation gate. The fix table below covers the full surface — there is no "safe vs. unsafe" split: dream applies all of them.
| Violation | Auto-fix |
|-----------|----------|
| Missing frontmatter | Generate frontmatter from filename and content, then kb_ingest the updated doc |
| Missing title | Derive from filename (kebab-case to Title Case), add to frontmatter |
| Missing tags | Derive 2-3 tags from folder name and content keywords |
| Missing lead insight | Prepend a one-sentence summary before the first heading |
| Word count under 50 | Flag for manual attention — do NOT auto-fix stubs |
| Word count over 500 | Flag for manual attention with a suggested split plan (list proposed new docs) |
| Wrong heading level | Replace H1/H3 top-level sections with H2 |
| Markdown links to KB docs | Convert [text](folder/file.md) to [[file\|text]] |
| Bold path references | Convert **folder/file.md** to [[file]] |
| Wikilinks with extensions | Convert [[file.md]] to [[file]] |
| Wikilinks with folder paths | Convert [[folder/file]] to [[file]] only when the filename is unique across the vault — if duplicates exist, keep the path for disambiguation |
| Inline hashtags | Move #tag-name from body into frontmatter tags array, remove from body text |
| Uppercase/underscore tags | Normalize to lowercase kebab-case in frontmatter (e.g. TechStack becomes tech-stack) |
For each fix applied, call kb_ingest with the corrected document. Preserve all existing content — only add or adjust metadata and structure.
Apply with judgment (these need a decision; make one):
## H2 boundaries. Each H2 section becomes its own doc named after the section topic; cross-link with wikilinks. If H2s are too small to stand alone, group adjacent H2s into a topical sibling doc.metrics-thanx.md vs metrics-personal.md).-legacy suffix and add a superseded_by: [[newer]] field plus the redirect tag. Update incoming wikilinks to point at the canonical doc.Always write the report to memory/dream/<YYYY-MM-DD>-report.md (via kb_ingest) and append a one-line summary to ~/.dots/sys/dream-runs/<YYYY-MM-DD>.log so the next scheduled run can find the timestamp of this one. Print the same content to stdout as well so the agent log shows what changed.
Use this structure:
## KB Hygiene Report
**Scanned:** N documents
**Healthy:** N documents (no violations)
**Fixed:** N documents
**Held in inbox:** N documents (only when classification was impossible — see Phase 3)
### Fixes Applied
| Document | Fix Applied |
|----------|------------|
| path | what was fixed |
### Judgment Calls
For decisions made under "Apply with judgment" (oversized/multi-topic splits, naming renames, orphan link choices, duplicate filename resolution). Audit trail for the next dream run or a human spot-check.
| Document | Decision | Rationale |
|----------|----------|-----------|
| path | what was done | why this option vs. the alternative |
### Redirects Skipped
- path (N total)
### Duplicate Filenames
| Filename | Paths |
|----------|-------|
| name | folder1/name.md, folder2/name.md |
(Omit section if no duplicates found)
### Orphan Notes
| Document | Links Out | Links In |
|----------|-----------|----------|
| path | 0 | 0 |
(Omit section if no orphans found)
### Link Graph
- Total wikilinks: N
- Docs with outgoing links: N / N total
- Docs with incoming links: N / N total
- Most linked-to: path (N incoming)
### Stats
- Smallest doc: path (N words)
- Largest doc: path (N words)
- Average doc size: N words
- Folders: list of top-level folders with doc counts
If --dry-run was specified, label the report "KB Hygiene Report (Dry Run)" and note that no changes were made.
Add these sections to the report — they cover ingest, triage/synthesis, conflicts, and decay:
### Ingested (Phase 0)
| Source | Count | Notes |
|--------|-------|-------|
| granola | N | yesterday's meetings, deduped against existing inbox |
| notion | N | yesterday's meeting notes |
| session-end hook | N | session captures already on disk |
### Inbox Triage & Synthesis (Phase 3)
| Inbox Doc | Tags | Action | Knowledge Distilled Into |
|-----------|------|--------|-------------------------|
| memory/inbox/<doc> | high-value, commit-merged | synthesize+delete | patterns/dev-tools.md (new convention), memory/project/foo.md (decision) |
| memory/inbox/<doc> | meeting-capture | synthesize+archive | memory/people/engineering.md (role change) |
| memory/inbox/<doc> | session-capture, work-in-progress | discard | nothing distillable |
| memory/inbox/<doc> | <tags> | re-file | <new path> |
| memory/inbox/<doc> | <tags> | hold | (kept in inbox — too degraded) |
### Conflicts Resolved (Phase 4)
| Topic | Canonical | Superseded | Strategy |
|-------|-----------|------------|----------|
| <topic> | path | path | fact-update / dedupe / merged-ambiguous |
### Aged Out (Phase 5)
| Doc | Age (days) | Reason | Action |
|-----|-----------|--------|--------|
| path | N | no incoming links / superseded / closed project | archived |
Dream runs as a scheduled Argus task. After the report has been written, mark the task owning this worktree as complete so it leaves the active list and stamps EndedAt. Call mcp__argus__task_complete with the shell's current working directory (the $PWD Argus injected when it spawned the task) as the cwd argument — Argus resolves the task from its worktree path.
Skip this phase when --dry-run is set. If the tool errors (e.g. "no task matches cwd", task already complete), surface the response in one line and conclude the run — do not retry with guessed arguments. task_complete has no mcp__argus-kb__* legacy alias, so the fallback rule in the "MCP tool naming" section above does not apply here.
/dream is the unattended mode by default. Wire it into Argus scheduled tasks (or any cron) at a low-activity hour. Each run:
memory/dream/<date>-report.md and ~/.dots/sys/dream-runs/<date>.log.~/.dots/sys/kb-changes/changes.jsonl shows no writes since the previous run (see Instructions preamble).For interactive previews use /dream --dry-run — that's the only mode that does not write to the KB.
The KB is an Obsidian vault. All cross-references between docs MUST use Obsidian internal links (wikilinks). When auditing or fixing docs, apply these rules:
Supported wikilink syntax:
| Syntax | Purpose |
|--------|---------|
| [[filename]] | Link to another doc (no extension, no folder path) |
| [[filename\|display text]] | Link with custom display text |
| [[filename#heading]] | Link to a specific heading in another doc |
| [[filename#heading\|display text]] | Heading link with display text |
| [[#heading]] | Link to a heading in the same doc |
| ![[filename]] | Embed (transclude) another doc inline |
| ![[filename#heading]] | Embed a specific section from another doc |
Resolution rules:
.md extension — Obsidian adds it automatically[[thanx/people-cs]])Patterns to flag and fix:
[text](folder/file.md) should be [[file\|text]]**folder/file.md** should be [[file]][[file.md]] should be [[file]][[folder/file]] should be [[file]] (when filename is unique)See thanx/people-cs.md should be See [[people-cs]]Do NOT convert:
https://...) — these are not internal linksdevelopment
Walk every unresolved review thread on a PR, triage each one, reply with a rationale of whether or not the comment will be acted upon, make the code change if warranted, and mark the thread resolved. Use when the user asks to address only the open PR comments without re-running CI, respond to review feedback, resolve review threads, or clear bot comments on a PR.
tools
Iteratively run /rereview, fix the findings, and loop until reviewers approve clean. Use for iterative automated review, when you want /rereview to loop until clean, or for a paranoid pre-merge review that auto-addresses every blocker.
development
Generate self-contained HTML visualizations with Plannotator theming. Use for implementation plans, PR explainers, architecture diagrams, data tables, slide decks, and any visual explanation of technical concepts. Plans and PR explainers follow Plannotator's prescriptive approach; all other visual content delegates to nicobailon/visual-explainer.
development
Create reviewed Codex goal setup packages for long-running /goal work. Use when the user wants to turn an idea, backlog, project mission, or vague objective into durable goal files under a project goals slug folder, with Plannotator review gates for brief, narrative plan with acceptance criteria, verification, blockers, and the final /goal prompt.