OB

obsidian-local-dev-loop

Establish a fast iteration environment for Obsidian plugins using esbuild, symlinking, and hot-reload.

Install

mkdir -p .claude/skills/obsidian-local-dev-loop && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/1214" && unzip -o skill.zip -d .claude/skills/obsidian-local-dev-loop && rm skill.zip

Installs to .claude/skills/obsidian-local-dev-loop

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Set up a fast Obsidian plugin development loop with hot reload.
63 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Clone the official Obsidian sample plugin to start a new project.
  • Configure esbuild to watch source files and rebuild automatically.
  • Symlink the plugin project into a dedicated Obsidian development vault.
  • Hot-reload the plugin in Obsidian using Ctrl+R or the Hot Reload community plugin.
  • Debug plugin code using Chrome DevTools with source maps.
  • Set up vitest for unit testing Obsidian plugins with mocked modules.

How it works

This skill sets up a development environment by cloning a sample plugin, configuring esbuild for watch mode, and symlinking the plugin into a dedicated Obsidian vault. It enables hot-reloading and debugging through Chrome DevTools and vitest.

Inputs & outputs

You give it
Obsidian plugin source code and a development vault
You get back
A configured Obsidian plugin development environment with hot-reloading and debugging

When to use obsidian-local-dev-loop

  • Setting up a new plugin project
  • Configuring hot-reload for development
  • Debugging plugin runtime errors
  • Running plugin tests with vitest

About this skill

Obsidian Local Dev Loop

Overview

Establish a fast edit-build-test cycle for Obsidian plugins. Clone the official sample plugin, run esbuild in watch mode, symlink into a dev vault, hot-reload with Ctrl+R, debug with Chrome DevTools, and run tests with vitest. Aimed at sub-second feedback from save to reload.

Prerequisites

  • Node.js 18+ with npm
  • Git
  • Obsidian desktop app installed
  • A vault dedicated to development (keep it separate from your real notes)

Instructions

Step 1: Clone the official sample plugin

Start from the maintained template rather than from scratch:

set -euo pipefail

git clone https://github.com/obsidianmd/obsidian-sample-plugin.git my-plugin
cd my-plugin
rm -rf .git
git init

npm install

The sample includes esbuild.config.mjs, tsconfig.json, manifest.json, and a working src/main.ts.

Step 2: Create a dedicated dev vault

Keep a vault just for testing. Pre-populate it with sample notes.

set -euo pipefail

DEV_VAULT="$HOME/ObsidianDev"
mkdir -p "$DEV_VAULT/.obsidian/plugins"
mkdir -p "$DEV_VAULT/Test Notes"

cat > "$DEV_VAULT/Test Notes/Sample.md" << 'EOF'
---
tags: [test, sample]
---
# Sample Note

This note exists for plugin development testing.

## Section A

Some content with a [[link]] and a #tag.

## Section B

- Item 1
- Item 2
- Item 3
EOF

echo "Dev vault ready at $DEV_VAULT"

Open this vault in Obsidian: File > Open vault > select ~/ObsidianDev.

Step 3: Symlink the plugin into the dev vault

Instead of copying files after every build, symlink the entire project directory. The build outputs main.js at the project root, right where Obsidian expects it.

set -euo pipefail

DEV_VAULT="$HOME/ObsidianDev"
PLUGIN_DIR="$(pwd)"
PLUGIN_ID=$(node -e "console.log(require('./manifest.json').id)")

# Symlink project root into vault plugins folder
ln -sfn "$PLUGIN_DIR" "$DEV_VAULT/.obsidian/plugins/$PLUGIN_ID"

# Verify
ls -la "$DEV_VAULT/.obsidian/plugins/$PLUGIN_ID/manifest.json"
echo "Symlinked $PLUGIN_ID into dev vault."

On Windows, use an admin terminal:

mklink /D "%USERPROFILE%\ObsidianDev\.obsidian\plugins\my-plugin" "%cd%"

Step 4: Run esbuild in watch mode

Watch mode rebuilds main.js on every source file change (typically <50ms).

npm run dev
# esbuild watches src/ and rebuilds main.js on save
# Output: "build finished" messages in the terminal

The esbuild.config.mjs from the sample plugin already supports this. Inline source maps are enabled in dev mode for accurate stack traces.

Step 5: Hot-reload in Obsidian

After esbuild rebuilds, reload the plugin in Obsidian:

Method A -- Keyboard (fastest): Press Ctrl+R (or Cmd+R on macOS) to reload the app. This unloads all plugins and reloads them, picking up the new main.js.

Method B -- Hot Reload plugin (automatic): Install the Hot Reload community plugin. It watches for main.js changes in plugin directories and auto-reloads only the changed plugin. No manual refresh needed.

  1. In Obsidian, install "Hot Reload" from Community plugins
  2. Enable it
  3. Create a .hotreload file in your plugin directory: touch .hotreload
  4. Now every esbuild rebuild triggers an automatic plugin reload

Method C -- Command palette: Press Ctrl+P, type "Reload app without saving", Enter.

Step 6: Debug with Chrome DevTools

Obsidian is an Electron app, so full Chrome DevTools are available.

  1. Press Ctrl+Shift+I (or Cmd+Option+I on macOS) to open DevTools
  2. Console tab -- see console.log output from your plugin
  3. Sources tab -- set breakpoints in your code (source maps required)
  4. Network tab -- inspect any HTTP requests your plugin makes
  5. Elements tab -- inspect Obsidian's DOM for CSS/layout work

Tips:

  • With inline source maps enabled, your TypeScript source appears in Sources > src/main.ts
  • Use debugger; statements in code for precise breakpoints
  • console.log('[MyPlugin]', ...) prefix makes filtering easy
// Add to onload() for development:
if (process.env.NODE_ENV !== "production") {
  console.log("[MyPlugin] Dev mode active. Use Ctrl+Shift+I for DevTools.");
}

Step 7: Testing with vitest

Obsidian plugins can be unit-tested by mocking the obsidian module.

set -euo pipefail
npm install --save-dev vitest

Create vitest.config.ts:

import { defineConfig } from "vitest/config";

export default defineConfig({
  test: {
    globals: true,
    environment: "node",
  },
});

Create a mock for the obsidian module at __mocks__/obsidian.ts:

export class Plugin {
  app = {};
  loadData = vi.fn().mockResolvedValue({});
  saveData = vi.fn().mockResolvedValue(undefined);
  addCommand = vi.fn();
  addRibbonIcon = vi.fn();
  addSettingTab = vi.fn();
  addStatusBarItem = vi.fn().mockReturnValue({ setText: vi.fn() });
  registerEvent = vi.fn();
  registerInterval = vi.fn();
}

export class Notice {
  constructor(public message: string) {}
}

export class PluginSettingTab {
  containerEl = { empty: vi.fn(), createEl: vi.fn() };
  constructor(public app: any, public plugin: any) {}
  display() {}
}

export class Setting {
  constructor(el: any) {}
  setName = vi.fn().mockReturnThis();
  setDesc = vi.fn().mockReturnThis();
  addText = vi.fn().mockReturnThis();
  addToggle = vi.fn().mockReturnThis();
}

export class Modal {
  app: any;
  contentEl = { createEl: vi.fn(), empty: vi.fn() };
  constructor(app: any) { this.app = app; }
  open = vi.fn();
  close = vi.fn();
  onOpen() {}
  onClose() {}
}

Write a test:

// src/__tests__/main.test.ts
import { describe, it, expect, vi } from "vitest";

vi.mock("obsidian");

describe("Plugin settings", () => {
  it("merges defaults with saved data", async () => {
    const { Plugin } = await import("obsidian");
    const { default: MyPlugin } = await import("../main");

    const plugin = new MyPlugin() as any;
    plugin.loadData = vi.fn().mockResolvedValue({ greeting: "Custom" });
    plugin.saveData = vi.fn();

    await plugin.loadSettings();

    expect(plugin.settings.greeting).toBe("Custom");
    expect(plugin.settings.showRibbon).toBe(true); // default preserved
  });
});

Run tests:

npx vitest run           # single run
npx vitest --watch       # watch mode alongside npm run dev

Add to package.json:

{
  "scripts": {
    "dev": "node esbuild.config.mjs",
    "build": "node esbuild.config.mjs production",
    "test": "vitest run",
    "test:watch": "vitest --watch"
  }
}

Output

After completing all steps:

  • Dev vault at ~/ObsidianDev with test notes
  • Plugin symlinked into vault (no manual copying)
  • npm run dev for sub-second rebuilds on save
  • Hot Reload plugin for automatic Obsidian reload (or Ctrl+R manual)
  • Chrome DevTools available via Ctrl+Shift+I with source maps
  • vitest configured with obsidian mocks for unit testing
  • Two-terminal workflow: terminal 1 runs npm run dev, terminal 2 runs npx vitest --watch

Error Handling

ErrorCauseFix
Symlink not workingPermission denied (Windows)Run terminal as Administrator
Plugin not in listSymlink target wrongVerify ls -la shows correct target
Hot Reload not triggeringMissing .hotreload filetouch .hotreload in plugin dir
Source maps not showingsourcemap: false in configSet sourcemap: "inline" for dev
Build not watchingUsed build instead of devRun npm run dev (watch mode)
Tests fail with import errorsMissing vitest mockCreate __mocks__/obsidian.ts
DevTools won't openKeyboard shortcut conflictUse menu: View > Toggle Developer Tools

Examples

Quick dev startup script (dev.sh):

#!/usr/bin/env bash
set -euo pipefail

# Terminal 1: esbuild watch
npm run dev &
ESBUILD_PID=$!

# Terminal 2: vitest watch
npx vitest --watch &
VITEST_PID=$!

echo "Dev servers running. Ctrl+C to stop."
trap "kill $ESBUILD_PID $VITEST_PID" EXIT
wait

VSCode task for integrated dev:

{
  "version": "2.0.0",
  "tasks": [{
    "label": "Obsidian Dev",
    "type": "npm",
    "script": "dev",
    "isBackground": true,
    "problemMatcher": {
      "pattern": { "regexp": "^x]$" },
      "background": {
        "activeOnStart": true,
        "beginsPattern": ".",
        "endsPattern": "build finished"
      }
    }
  }]
}

Resources

Next Steps

  • Build UI features: see obsidian-core-workflow-b
  • Apply production patterns: see obsidian-sdk-patterns

Prerequisites

Node.js 18+ with npmGitObsidian desktop app installedA vault dedicated to development

How it compares

This workflow automates the setup of hot-reloading and debugging for Obsidian plugins, unlike manual file copying and application restarts.

Compared to similar skills

obsidian-local-dev-loop side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
obsidian-local-dev-loop (this skill)327dReviewIntermediate
chrome-devtools417moReviewIntermediate
testing52moReviewIntermediate
dependency-upgrade265moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

You might also like

chrome-devtools

mrgoonie

Browser automation, debugging, and performance analysis using Puppeteer CLI scripts. Use for automating browsers, taking screenshots, analyzing performance, monitoring network traffic, web scraping, form automation, and JavaScript debugging.

41157

testing

lobehub

Testing guide using Vitest. Use when writing tests (.test.ts, .test.tsx), fixing failing tests, improving test coverage, or debugging test issues. Triggers on test creation, test debugging, mock setup, or test-related questions.

524

dependency-upgrade

wshobson

Manage major dependency version upgrades with compatibility analysis, staged rollout, and comprehensive testing. Use when upgrading framework versions, updating major dependencies, or managing breaking changes in libraries.

26240

playwright-browser-automation

lackeyjb

Complete browser automation with Playwright. Auto-detects dev servers, writes clean test scripts to /tmp. Test pages, fill forms, take screenshots, check responsive design, validate UX, test login flows, check links, automate any browser task. Use when user wants to test websites, automate browser interactions, validate web functionality, or perform any browser-based testing.

29146

nestjs-expert

davila7

Nest.js framework expert specializing in module architecture, dependency injection, middleware, guards, interceptors, testing with Jest/Supertest, TypeORM/Mongoose integration, and Passport.js authentication. Use PROACTIVELY for any Nest.js application issues including architecture decisions, testing strategies, performance optimization, or debugging complex dependency injection problems. If a specialized expert is a better fit, I will recommend switching and stop.

3758

zod-4

prowler-cloud

Zod 4 schema validation patterns. Trigger: When creating or updating Zod v4 schemas for validation/parsing (forms, request payloads, adapters), including v3 -> v4 migration patterns.

1260

Search skills

Search the agent skills registry