Agent skill · software engineering · jeremylongshore

obsidian-data-handling

Implement vault data backup, sync, and recovery strategies.

Why this skill is useful

Provides specific patterns and code snippets for handling data management in Obsidian plugins that the AI wouldn't reliably generate on its own.

What it needs

Requires obsidian installed locally. About 5k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.

What this skill does

Obsidian Data Handling Overview Data management patterns for Obsidian plugins: plugin config with loadData/saveData, vault file I/O, frontmatter parsing via metadataCache, handling renames and deletes, cross-device sync considerations, and IndexedDB fallback for large datasets. Prerequisites Working Obsidian plugin (export default class extends Plugin) Understanding of Obsidian's Vault and MetadataCache APIs TypeScript compilation configured Instructions Step 1: Plugin Config with loadData / saveData Obsidian stores plugin data in .obsidian/plugins/<plugin-id>/data.json. Use loadData() and saveData() — never read that file directly. loadData() returns null on first run — Object.assign onto defaults handles this cleanly. Step 2: Reading and Writing Vault Files Use vault.cachedRead() instead of vault.read() when you don't need the absolute latest content — it avoids hitting disk on every call. Step 3: Working with Frontmatter via MetadataCache Never parse YAML frontmatter manually. Obsidian's metadataCache keeps a parsed cache of every file's frontmatter. processFrontMatter handles YAML serialization correctly — it preserves comments and formatting, and is the only safe way to update frontmatter programmatically. Step 4: Handling File Renames and Deletes Plugins that index file paths must update their state when files move or disappear. Always use registerEvent — it automatically cleans up the listener when the plugin unloads. Step 5: Cross-Device Sync Considerations Obsidian vaults synced via iCloud, Dropbox, or Obsidian Sync introduce eventual consistency issues. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills jeremylongshore/obsidian-data-handling

View the source on GitHub

Browse the @skills marketplace