skills/knowledge-obsidian-attachment-janitor/SKILL.md
Plan and safely execute cleanup of an Obsidian vault's Attachments folder: identify unreferenced attachments for deletion, rename referenced attachments to date-prefixed descriptive filenames, and verify embeds after confirmed changes. Use when the user mentions attachment cleanup, unused images, Obsidian attachments, renaming attachments, "附件清理", "整理附件", "清理图片", or "附件重命名". Requires an explicit delete/rename plan before any destructive action. Formerly named obsidian-attachment-janitor.
npx skillsauth add plimeor/agent-skills knowledge-obsidian-attachment-janitorInstall 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.
Clean up and organize files in an Obsidian vault's Attachments/ folder without
breaking embeds or touching unrelated vault content.
A good result:
Delete / Rename / Skip plan before any destructive
action.Treat deletion and rename as destructive or externally visible vault changes. Do not delete or rename files before explicit confirmation.
Leave unrelated vault organization, note content, frontmatter, and
non-attachment files alone. If reference status, date, or description is
uncertain, put the item in Skip.
Use path= for Obsidian CLI operations; do not use file=. The file=
parameter resolves like a wikilink and fails on filenames with special
characters such as spaces, @, underscores, or hashes.
YYYY-MM-DD description.ext
YYYY-MM-DD filename prefix.
Ignore time suffixes like 1230 in 2026-03-09 1230 ....When the same note embeds multiple attachments, differentiate by what each one
depicts, not by index number. Use the attachment timestamp only when the filename
contains a clear YYYY-MM-DD timestamp and it conflicts with the note date;
otherwise use the referencing note date.
Example: a note named 2026-03-09 1230 让 AI 接管笔记维护.md embeds four
images.
| Original | New |
|---|---|
| Gemini_Generated_Image_5tv8tg5tv8tg5tv8.png | 2026-03-09 ai-note-maintenance-cover.png |
| Gemini_Generated_Image_fdvb4qfdvb4qfdvb.png | 2026-03-09 agent-system-overview.png |
| CleanShot 2026-03-09 at [email protected] | 2026-03-09 pr-diff-screenshot.png |
| CleanShot 2026-03-10 at [email protected] | 2026-03-10 sentinel-report-screenshot.png |
First scan all attachment filenames and Markdown references in the vault.
Include Obsidian embeds, Markdown image links, normal Markdown links, URL-encoded
paths, and raw filename/path mentions when checking whether an attachment is
referenced. Exclude .agents/skills/ documentation examples.
For rename descriptions, read the embed line, surrounding paragraph, and nearest heading first. Read the full referencing note only when local context is insufficient. Do not inspect unrelated notes once reference status and rename context are sufficient.
Build three lists:
Delete: attachments with no detected reference form. Include path, size, and
evidence reason.Rename: referenced attachments with a reliable date and description. Include
old path, new name, referencing note, and evidence phrase.Skip: attachments kept as-is. Include path and reason, such as undatable,
already named well, multiple conflicting references, unclear reference status,
or insufficient context.For multiple references, prefer the most specific embedding context. If dates or ownership conflict, skip unless one source clearly owns the attachment. If two files would receive the same name, make descriptions more specific rather than adding index numbers.
Wait for explicit user confirmation before executing anything.
Use the Obsidian CLI for confirmed operations because it updates references:
obsidian delete path="Attachments/filename.png" permanent
obsidian rename path="Attachments/old-name.png" name="new-name.png"
Before execution, confirm the CLI is available, the target vault is correct, and the command paths match the approved plan.
Before execution, show:
Delete: path, size, evidence reasonRename: old path, new name, referencing note, evidence phraseSkip: path, reasonAfter execution, report deleted count, renamed count, skipped count, and broken embed scan result.
Stop after the plan is delivered and wait for confirmation. After confirmed changes, stop after verification and the summary report. Do not continue into broader vault cleanup, note rewriting, metadata repair, or attachment taxonomy work unless the user explicitly asks.
development
Set up, resume, or repair a compact active execution workbench for long-horizon, multi-session or checkpointed work. Use when a task needs durable handoff, unattended iteration, human gates, auditable evidence, or active-vs-archive routing that keeps a current packet separate from stale historical context. Do not use for one-session tasks, ordinary plans/reviews/audits, one-session bug fixes, direct code edits, or simple docs cleanup; complete those directly.
tools
Decide whether and how to use authorized sub-agents, then coordinate delegated work while preserving the main agent's context. Use when the user asks for orchestration, parallel agents, delegation, background workers, context isolation, or when another skill needs delegated research, review, implementation, or verification. Owns host-policy checks, delegation packets, non-overlap, report verification, and stop rules. Do not use to bypass tool policy, infer user authorization, or add coordination overhead to simple single-threaded tasks.
development
Use before finalizing a non-trivial answer, recommendation, review, or decision to reconsider it and raise its quality, especially when shallow reasoning, context inertia, false framing, overconfidence, unfit analogy transfer, or an obvious-but-missed defect could distort the result. Trigger especially before applying external evidence, familiar frameworks, or comparisons to the user's specific request, and when the user asks to reconsider, double-check, take a second look, or sanity-check an answer.
tools
Route durable rules and context to the right layer — task, project, skill, tooling, hooks, MCP, or global. Use for global rules files (~/.claude/CLAUDE.md, global AGENTS.md), repo-local AGENTS.md/CLAUDE.md, task context packs, hook placement (Codex/Claude Code settings.json), collaboration friction diagnosis, and rule-placement decisions.