← 返回 Skills 市场
davidvkimball

Obsidian Plugin Development

作者 davidvkimball · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
1728
总下载
3
收藏
2
当前安装
1
版本数
在 OpenClaw 中安装
/install obsidian-plugin-dev
功能描述
Create and develop Obsidian plugins from scratch. Use when building a new Obsidian plugin, scaffolding from the sample-plugin-plus template, or developing plugin features. Covers project setup, manifest configuration, TypeScript development, settings UI, commands, ribbons, modals, and Obsidian API patterns.
使用说明 (SKILL.md)

Obsidian Plugin Development

Build production-ready Obsidian plugins using the obsidian-sample-plugin-plus template.

Quick Start: New Plugin

1. Create from Template

# Clone the template (or use GitHub's "Use this template" button)
gh repo create my-plugin --template davidvkimball/obsidian-sample-plugin-plus --public --clone
cd my-plugin

# Or clone directly
git clone https://github.com/davidvkimball/obsidian-sample-plugin-plus.git my-plugin
cd my-plugin
rm -rf .git && git init

2. Configure Plugin Identity

Update these files with your plugin's info:

manifest.json:

{
  "id": "my-plugin",
  "name": "My Plugin",
  "version": "0.0.1",
  "minAppVersion": "1.5.0",
  "description": "What your plugin does",
  "author": "Your Name",
  "authorUrl": "https://yoursite.com",
  "isDesktopOnly": false
}

package.json: Update name, description, author, license.

README.md: Replace template content with your plugin's documentation.

3. Initialize Development Environment

pnpm install
pnpm obsidian-dev-skills          # Initialize AI skills
./scripts/setup-ref-links.sh      # Unix
# or: scripts\setup-ref-links.bat  # Windows

4. Clean Boilerplate

In src/main.ts:

  • Remove sample ribbon icon, status bar, commands, modal, and DOM event
  • Keep the settings tab if needed, or remove it
  • Rename MyPlugin class to your plugin name

Delete styles.css if your plugin doesn't need custom styles.

Development Workflow

Build & Test

pnpm dev      # Watch mode — rebuilds on changes
pnpm build    # Production build
pnpm lint     # Check for issues
pnpm lint:fix # Auto-fix issues
pnpm test     # Run unit tests

Install in Obsidian

Copy build output to your vault:

# Unix
cp main.js manifest.json styles.css ~/.obsidian/plugins/my-plugin/

# Or create a symlink for development
ln -s $(pwd) ~/.obsidian/plugins/my-plugin

Enable the plugin in Obsidian Settings → Community Plugins.

Use Hot Reload plugin for automatic reloading during development.

Plugin Architecture

Entry Point (src/main.ts)

import { Plugin } from 'obsidian';

export default class MyPlugin extends Plugin {
  settings: MyPluginSettings;

  async onload() {
    await this.loadSettings();
    // Register commands, ribbons, events, views
  }

  onunload() {
    // Cleanup: remove event listeners, views, DOM elements
  }

  async loadSettings() {
    this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData());
  }

  async saveSettings() {
    await this.saveData(this.settings);
  }
}

Settings Pattern

See references/settings.md for the complete settings UI pattern.

Common Patterns

See references/patterns.md for:

  • Commands (simple, editor, check callbacks)
  • Ribbon icons
  • Modals
  • Events and lifecycle
  • File operations
  • Editor manipulation

Constraints

  • No auto-git: Never run git commit or git push without explicit approval
  • No eslint-disable: Fix lint issues properly, don't suppress them
  • No any types: Use proper TypeScript types
  • Sentence case: UI text uses sentence case (ESLint may false-positive on this — ignore if so)

Release Checklist

  1. Update version in manifest.json and package.json
  2. Update versions.json with "version": "minAppVersion"
  3. Run pnpm build — zero errors
  4. Run pnpm lint — zero issues
  5. Create GitHub release with tag matching version (no v prefix)
  6. Upload: main.js, manifest.json, styles.css (if used)

References

安全使用建议
This skill is an instruction-only guide for building Obsidian plugins and is mostly coherent, but before you follow its steps: - Expect to need git, the GitHub CLI (gh) or at least git + GitHub access, and pnpm; the metadata did not list these binaries — install or verify them yourself. - The workflow instructs cloning a template repo and running pnpm install and template scripts (e.g., ./scripts/setup-ref-links.sh). Inspect the template repository, package.json, and any scripts referenced before running them — npm/pnpm install can run arbitrary lifecycle scripts. - Review any scripts and the generated main.js/manifest.json before copying them into your ~/.obsidian/plugins folder and enabling the plugin in Obsidian. Treat the template repo as untrusted until audited. - If you want to be extra safe, run pnpm install in an isolated environment (container or VM), or review dependencies and lockfiles first. If you want, I can: list the exact commands the skill will run, parse the remote template's package.json/scripts (if you provide it or allow me to fetch the repo), or critique a plugin produced from this template for suspicious code or network calls.
功能分析
Type: OpenClaw Skill Name: obsidian-plugin-dev Version: 1.0.0 The skill is designed for Obsidian plugin development, and all instructions and code snippets are consistent with this stated purpose. It involves standard development practices like cloning a GitHub template (`davidvkimball/obsidian-sample-plugin-plus` in SKILL.md), installing dependencies (`pnpm install`), and local file operations within the Obsidian vault. There is no evidence of data exfiltration, malicious execution, persistence, or prompt injection attempting to subvert the agent's behavior. Notably, SKILL.md includes a positive security constraint: 'No auto-git: Never run `git commit` or `git push` without explicit approval', indicating an intent to limit sensitive actions.
能力评估
Purpose & Capability
The name/description match the content: an instruction-only skill for building Obsidian plugins. However, the SKILL.md expects tools like git, gh (GitHub CLI), pnpm, and standard Unix commands (cp, ln) but the registry metadata declares no required binaries — a mismatch that should be clarified.
Instruction Scope
Instructions legitimately cover cloning a GitHub template, running pnpm install, executing template scripts (e.g., ./scripts/setup-ref-links.sh), building, and copying output into ~/.obsidian/plugins. These are expected for plugin development, but running template scripts and package install scripts can execute arbitrary code — the skill does not include or show those scripts, so users should inspect them first.
Install Mechanism
No install spec and no code files are provided; the skill is instruction-only and does not itself write files or download archives. This reduces surface area compared to skills that install remote binaries.
Credentials
The skill requests no environment variables or credentials and does not declare access to unrelated services. That matches the declared metadata.
Persistence & Privilege
The skill is not forced-always or otherwise privileged. It is user-invocable and can be called autonomously (platform default), which is expected for a dev helper and is not by itself a red flag.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install obsidian-plugin-dev
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /obsidian-plugin-dev 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
obsidian-plugin 1.0.0 - Initial release. - Provides step-by-step instructions for setting up, developing, building, and releasing Obsidian plugins using the obsidian-sample-plugin-plus template. - Includes guidance on manifest configuration, TypeScript development, settings UI, commands, ribbons, modals, and Obsidian API patterns. - Documents development workflow, common patterns, plugin architecture, constraints, and release checklist. - Adds quick references to relevant documentation and code patterns.
元数据
Slug obsidian-plugin-dev
版本 1.0.0
许可证
累计安装 2
当前安装数 2
历史版本数 1
常见问题

Obsidian Plugin Development 是什么?

Create and develop Obsidian plugins from scratch. Use when building a new Obsidian plugin, scaffolding from the sample-plugin-plus template, or developing plugin features. Covers project setup, manifest configuration, TypeScript development, settings UI, commands, ribbons, modals, and Obsidian API patterns. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1728 次。

如何安装 Obsidian Plugin Development?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install obsidian-plugin-dev」即可一键安装,无需额外配置。

Obsidian Plugin Development 是免费的吗?

是的,Obsidian Plugin Development 完全免费(开源免费),可自由下载、安装和使用。

Obsidian Plugin Development 支持哪些平台?

Obsidian Plugin Development 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Obsidian Plugin Development?

由 davidvkimball(@davidvkimball)开发并维护,当前版本 v1.0.0。

💬 留言讨论