Skip to content
Back to skills

Obsidian Plugin

ASecurity

Comprehensive guidelines for Obsidian.md plugin development including ESLint rules, TypeScript best practices, and submission requirements.

  • 7 stars
  • 0 votes
  • 0 copies
  • 6 views
  • Added September 3, 2026
developmenttypescriptnodeapisecurity

Works with

  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 3, 2026

npx -y skills add mediar-ai/skillhubz --skill obsidian-plugin --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Obsidian Plugin?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Obsidian Plugin
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mediar-ai-obsidian-plugin/badge)](https://www.skillsdirectory.com/skills/mediar-ai-obsidian-plugin)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Obsidian Plugin Development

Comprehensive guidelines for Obsidian.md plugin development including ESLint rules, TypeScript best practices, and submission requirements.

## Prerequisites

- TypeScript knowledge
- Familiarity with Obsidian.md
- Node.js environment

## Instructions

### Core Principles

1. **Memory Safety**: Prevent leaks through proper resource management
2. **Type Safety**: Use proper type narrowing, avoid unsafe casts
3. **API Best Practices**: Follow Obsidian's recommended patterns
4. **User Experience**: Maintain UI/UX consistency
5. **Accessibility**: Keyboard and screen reader support (MANDATORY)

### Top 10 Critical Rules

1. **Plugin ID**: No "obsidian", can't end with "plugin"
2. **Use `registerEvent()`** for automatic cleanup
3. **Use `instanceof`** instead of type casting
4. **Sentence case** for all UI text
5. **Use `requestUrl()`** instead of `fetch()`
6. **Use Obsidian CSS variables** for theming
7. **Keyboard accessible** - all interactive elements
8. **No `innerHTML`** - security risk (XSS)
9. **No regex lookbehind** - iOS < 16.4 incompatible
10. **Remove all sample code** - MyPlugin, SampleModal, etc.

### Essential Do's

```typescript
// Use registerEvent for cleanup
this.registerEvent(this.app.vault.on('create', callback));

// Use instanceof for type checking
if (file instanceof TFile) { ... }

// Use Editor API for active file
editor.replaceSelection(text);

// Use Obsidian helpers
containerEl.createDiv({ cls: 'my-class' });
```

### Essential Don'ts

```typescript
// Don't store view references
this.myView = view; // Memory leak!

// Don't use type casting
const file = item as TFile; // Use instanceof

// Don't use fetch
fetch(url); // Use requestUrl()

// Don't use innerHTML
el.innerHTML = html; // XSS risk
```

### Accessibility (MANDATORY)

- All interactive elements must be keyboard accessible
- Provide ARIA labels for icon buttons
- Define focus indicators using `:focus-visible`
- Minimum touch target: 44×44px

## Guidelines

1. Use `registerEvent()`, `addCommand()`, `registerDomEvent()`
2. Use `this.app` not global `app`
3. Use `Vault.process()` for background file modifications
4. Use `normalizePath()` for user paths
5. Test on mobile if not desktop-only

## Notes

- Based on `eslint-plugin-obsidianmd`
- Boilerplate generator available: `/create-plugin`
- Always test with keyboard navigation

Source: gapmiss/obsidian-plugin-skill

Files in this skill

  • manifest.json361 B
  • skill.md2.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.