Agent skill · software engineering · jeremylongshore

obsidian-webhooks-events

Handle Obsidian events and workspace callbacks for plugin development.

Why this skill is useful

Provides specific TypeScript event handling patterns for Obsidian plugin development that the AI wouldn't reliably generate on its own.

What it needs

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

What this skill does

Obsidian Webhooks & Events Overview Complete guide to Obsidian's event system: vault events (create, modify, delete, rename), workspace events (layout, leaf changes, editor state), metadataCache events, DOM events, custom EventRef patterns, and periodic tasks. Every event registration uses this.registerEvent() for automatic cleanup on plugin unload. Prerequisites Working Obsidian plugin with onload() / onunload() lifecycle Understanding of TypeScript event handler signatures Familiarity with Obsidian's TFile, TFolder, and WorkspaceLeaf types Instructions Step 1: Vault Events — File Lifecycle Vault events fire when files and folders are created, modified, deleted, or renamed. Note: modify fires on every keystroke during live editing in some configurations. Always debounce if your handler does non-trivial work (see obsidian-rate-limits). Step 2: Workspace Events — UI State Changes Workspace events track what the user is looking at and how the UI layout changes. Step 3: MetadataCache Events — Content Indexing The metadataCache parses frontmatter, links, tags, and headings in the background. These events fire when parsing completes. The resolved event is critical for plugins that build indexes — querying metadataCache before it fires returns incomplete data. Step 4: DOM Events with registerDomEvent For custom UI elements, use registerDomEvent instead of raw addEventListener. Obsidian auto-removes these on plugin unload. Step 5: Periodic Tasks with registerInterval Use registerInterval for timers — they auto-clear on unload. Never use raw setInterval. Step 6: Custom Event Bus for Plugin-Internal Communication For complex plugins with multiple views or components, create an internal event bus. Obsidian's Events class is the same base class used by Vault, Workspace, and MetadataCache. Using it for your own bus gives you a consistent pattern with on/off/trigger. …

How to use it

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

@skills jeremylongshore/obsidian-webhooks-events

View the source on GitHub

Browse the @skills marketplace