Vault frontmatter

From laurigates/claude-plugins · View interactive version

Vault frontmatter is an AI agent skill from the GitHub repository laurigates/claude-plugins. Offline YAML frontmatter maintenance for Obsidian notes. Use when stripping legacy `id:`, cleaning Templater markers, or fixing bare emoji tags.

How to use this skill

Skill file

Vault Frontmatter Maintenance

When to Use This Skill

| Use this skill when... | Use the alternative instead when... |

|---|---|

| Bulk-stripping legacy id: fields or null tags: entries across many .md files offline | Setting a single property on one live note via the running CLI β€” use properties |

| Cleaning up unrendered {{title}} / <% tp.file.cursor() %> placeholders inside YAML | Repairing those markers in note body text β€” use vault-templates |

| Adding missing frontmatter blocks to notes that lack one | Consolidating the actual tag values once the YAML structure is sound β€” use vault-tags |

Offline, file-level repair of YAML frontmatter. Complements the properties skill (which uses the Obsidian CLI) by operating on .md files directly β€” safe for bulk mechanical passes.

When to Use

Canonical Frontmatter Shape

---
tags:
  - πŸ› οΈ/neovim       # emoji-prefixed category tag
  - πŸ“/notes         # note-type tag
context: work        # work-namespace notes only
---

Rules:

  1. No id: field β€” removed from all current templates.
  2. 2–3 tags per note; every tag either emoji/subcategory or a bare note-type like πŸ“/moc.
  3. No bare emoji placeholders (πŸ“, 🌱, πŸ“/🌱) β€” they indicate the tag was never specified.
  4. No null tag values β€” YAML must be valid.
  5. Work-namespace notes (e.g. under work/) carry context: work; personal notes omit the field.

Detection Patterns

| Issue | Grep pattern | Notes |

|-------|--------------|-------|

| Legacy id: | ^id: inside frontmatter block | Strip entire line |

| Bare placeholder tag | YAML tag value exactly πŸ“, 🌱, or πŸ“/🌱 | Remove if note has other useful tags; else leave |

| Null tag | YAML tag value literally null | Remove list entry |

| Templater leak | <% tp\. or \{\{title\}\} or \{\{date\}\} | Replace {{title}} with filename stem; strip <% tp.* %> |

| Corrupt emoji | Tag contains Unicode replacement char \ufffd | Flag for manual fix β€” don't guess |

| Missing work context | File under the work namespace (e.g. work/) without context: work | Add the line |

Edit Recipes

Strip legacy id

Before:

---
id: 20240118235900
tags: [πŸ› οΈ/neovim]
---

After:

---
tags: [πŸ› οΈ/neovim]
---

Remove bare placeholder (keeping useful tags)

Before:

tags:
  - πŸ“
  - πŸ› οΈ/ansible

After:

tags:
  - πŸ› οΈ/ansible

Legacy MOC tag β†’ current

Before:

tags:
  - πŸ—ΊοΈ

After:

tags:
  - πŸ“/moc

Edit Pattern

Use Edit with small targeted old_string / new_string replacements that preserve exact indentation. Never rewrite whole files when a line edit suffices β€” it minimizes the commit diff and makes reviews easy.

For bulk fixes across many files, drive from a script that emits one Edit call per file rather than running sed in Bash. The commit-per-category pattern (fix(tags): strip bare πŸ“ from 639 notes) relies on keeping all edits in one logical batch.

Safety

Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.