Here’s a highly effective, ready-to-copy prompt you can feed into any AI (including me) to generate a production-ready Obsidian plugin scaffold and development guide:


📝 Prompt to Use

Act as an expert Obsidian plugin developer. I want to build a new Obsidian plugin from scratch. Please provide:

  1. Step-by-step project setup using TypeScript and [esbuild/Rollup]
  2. Complete minimal file structure with ready-to-copy code for:
    • main.ts
    • manifest.json
    • package.json
    • styles.css (if needed)
    • tsconfig.json & esbuild/rollup config
  3. A minimal but fully functional Plugin class that:
    • Extends the official Plugin class
    • Registers a command
    • Shows a notice on load
    • Includes a basic settings modal with at least one toggle/string option
  4. Exact terminal commands to install dependencies, run in dev mode, build for release, and hot-reload
  5. Step-by-step instructions to safely test the plugin in Obsidian (local plugin folder)
  6. Best practices for:
    • Using the Obsidian API correctly
    • Handling errors & vault changes
    • Preparing for community release (manifest requirements, versioning, security)

My plugin should: describe your specific feature, e.g., "add a command that inserts a formatted daily quote from a local JSON file and caches it in .obsidian/plugins/my-plugin/data.json"

Assume I have Node.js v18+ installed and basic TypeScript knowledge. Follow Obsidian's current plugin guidelines, reference the official obsidian-plugin-sample repo structure, and ensure all code uses the latest stable Obsidian API types. Do not use deprecated methods or outdated manifest fields.

🔍 Why This Prompt Works

  • Explicit tech stack: Forces the AI to use TypeScript + modern bundler (Obsidian officially recommends esbuild for new plugins)
  • File-by-file output: Prevents vague or fragmented responses
  • Settings + command + lifecycle: Covers 90% of what every plugin needs upfront
  • Local testing workflow: Saves hours of debugging deployment issues
  • Community-ready guidance: Includes manifest rules, versioning, and security notes required for official publishing
  • Placeholder for your feature: Makes it easy to customize without rewriting the prompt

💡 Pro Tips for AI-Assisted Obsidian Plugin Dev

  1. Iterate: Generate the scaffold first, then ask follow-ups like:
    • "How do I listen for file modifications in the vault?"
      • "Show me how to add a ribbon icon that triggers my command"
      • "How do I properly use App and Plugin lifecycle methods without memory leaks?"
  2. Always verify API calls: Obsidian's API is stable but occasionally deprecates methods. Cross-check with the official obsidian types repo.
  3. Use the official sample as ground truth: obsidianmd/obsidian-plugin-sample is the gold standard. Ask the AI to align with it.
  4. Never trust AI-generated manifest.json blindly: Double-check id, version, minAppVersion, and author fields. Obsidian rejects plugins with invalid manifests.
  5. Hot-reload isn't native: You'll need obsidian-plugin-dev or manual reload (Ctrl/Cmd + R in Obsidian). Ask the AI for a reliable dev workflow.

🛠️ Quick Start (If You Want to Skip the AI)

Run this in your terminal to scaffold an official template:

1. npm create obsidian-plugin@latest my-plugin
2. cd my-plugin
3. npm install
4. npm run dev

Then drop the generated folder into .obsidian/plugins/ in your vault and enable it in Settings → Community Plugins.

Let me know what your plugin should do, and I’ll generate the exact code, manifest, and dev commands tailored to your use case.

Built with LogoFlowershow