---
name: clean-root
description: Sweep stray empty Obsidian artifacts out of the vault root — the Untitled.md / Untitled 1.canvas / New note.md files Obsidian drops on an accidental Cmd-N or misclick, plus the bare date-named `2026-07-12.md` an accidental daily-note creation leaves behind (real daily notes live in Daily/ as `YYYY-MM-DD.md`) — then commit the removals in one tidy commit. Wraps the engine's `clean_root` module (installed `alexandria-vault` package). Use when the owner says "clean the root", "tidy the vault root", "there are untitled notes in the root", "delete the empty canvases", "clean out empty artifacts", or a root listing shows Untitled/New-note/date-named files. Only deletes root-level, artifact-named, trivially-empty files; anything with content is flagged for review, never silently deleted. NOT for draining an ingestion inbox (that's vault-ingestion) and NOT for archiving real notes that happen to live in the root.
served: false
---

# Clean root — sweep empty Obsidian artifacts

Obsidian drops stray files in the vault root — an accidental Cmd-N, a misclick on
"New canvas", a daily note created before the daily-notes folder was set — named
`Untitled.md`, `Untitled 1.canvas`, `New note.md`, `2026-07-12.md`, and so on.
Real daily notes live in `Daily/` as `YYYY-MM-DD.md` (see [[daily-note]]), so a bare
date-named file in the *root* is always a stray. The root is supposed to hold only the
sanctioned top-level notes (`Home.md`, the operating manual) and the PEAK folders, so
these artifacts are pure noise — and where the vault auto-syncs, they get swept into git
before anyone notices, which is why deletion goes through `git rm` + a commit, not
just `rm`.

When this skill fires:

1. **Run the tool as plumbing** (the owner never runs commands) — dry-run first, then apply:
   ```sh
   "${ALEXANDRIA_PYTHON:-python3}" -m alexandria_vault.engine.clean_root --vault .            # dry run — see what it found
   "${ALEXANDRIA_PYTHON:-python3}" -m alexandria_vault.engine.clean_root --vault . --apply    # delete the empty ones (git rm if tracked)
   "${ALEXANDRIA_PYTHON:-python3}" -m alexandria_vault.engine.clean_root --vault . --json     # machine-readable (composable with --apply)
   ```
   (The engine lives in the installed `alexandria-vault` package, not in the vault.
   `ALEXANDRIA_PYTHON` — the app venv's python — is the interpreter that has it; plain
   `python3` works wherever the package is pip-installed.)

   It buckets root artifacts two ways:
   - **delete** — artifact-named (`Untitled*`, `New note*`, `New canvas*`, `New base*`,
     or a bare `YYYY-MM-DD` date stem; `.md`/`.canvas`/`.base`) AND trivially empty
     (blank, whitespace, `{}`, or an empty canvas skeleton). Safe to remove without asking.
   - **flagged** — artifact-named but has real content. The owner started typing something
     there. **Never delete these** — see step 3.

   Only root-level files are ever considered; an artifact-named file inside any folder is
   left alone.

2. **Commit the removals — one tidy commit.** Tracked files removed via `git rm` are left
   staged. Commit **paths-only** so unrelated dirty files don't get swept in:
   ```sh
   git commit -m "tidy: remove N empty Obsidian artifacts from vault root" -- "Untitled.md" "Untitled 1.canvas"
   ```
   (Substitute the actual filenames and count. If everything deleted was untracked, there
   is nothing to commit — say so and stop.)

3. **Surface the flagged files to the owner for a decision** — never auto-delete them.
   Show a one-line gist of each and offer to route the content properly: a date-named
   note with content is probably a daily entry that belongs at `Daily/YYYY-MM-DD.md`;
   anything else goes through the normal ingestion flow (the vault-ingestion skill) or
   straight into the right area note if it's obvious.

4. **Report** — one or two lines: what was deleted, and anything flagged with its gist
   plus the offer to route it. If the root was already clean, just say so.
