joplin-plugin-writer
npx skills add https://github.com/avenstack/av-skill --skill joplin-plugin-writer
Agent 安装分布
Skill 文档
Joplin Plugin Writer
Overview
Implement Joplin plugins with a reliable flow from idea to runnable build. Use official docs first, then produce code, manifest updates, and validation steps.
Workflow
-
Clarify plugin type and target. Gather target platform (
desktopordesktop+mobile), core user action, UI surface (command, panel, toolbar, editor content script), and expected trigger. -
Bootstrap or inspect the project. For a new plugin, scaffold with:
npm install -g yo generator-joplin
yo joplin
For an existing plugin, inspect src/index.ts, src/manifest.json, plugin.config.json, and webpack.config.js.
-
Implement with the official plugin lifecycle. Always register through
joplin.plugins.register({ onStart: async () => {} }). Place command/view/content-script wiring inonStart. Treat handlers and API calls as async. -
Choose the integration pattern. If the feature targets note/workspace behavior, use
joplin.workspace,joplin.commands,joplin.views. If the feature targets editor behavior, use content scripts and choose CodeMirror strategy:
- Prefer CodeMirror 6 plugin flow for modern Joplin.
- Add dual CM5+CM6 scripts only when explicit backward compatibility is required.
- Keep CM packages externalized to avoid duplicate-instance runtime issues.
-
Keep manifest and packaging correct. Update
src/manifest.jsonwith accurateapp_min_version,platforms, metadata, and assets. Build withnpm run distso runtime artifacts are available underdist/and publish output underpublish/. -
Run and verify in Development Mode. Launch Joplin in Development Mode, point “Development plugins” to plugin root, restart fully, and validate:
- Plugin loads without errors
- Core command/view behavior works
- Console/log output is clean
- Debug with directed checks.
For loading failures, check compiled entry and load paths (
dist/index.jsand plugin directory selection). For editor issues, verify CM6/CM5 compatibility branch and content script registration IDs. For mobile/web behavior, follow mobile debugging flow and ensureplatformscontainsmobilewhen needed.
Implementation Rules
- Read
references/official-docs-index.mdfirst and load only the minimum relevant section. - Keep generated code TypeScript-first unless the repository is clearly JavaScript-only.
- Modify existing plugin structure instead of rewriting whole files when possible.
- Preserve user/plugin IDs and public command names unless migration is explicitly requested.
- Explain manifest-impacting changes (ID/version/platforms/min-version) before finalizing.
- Prefer incremental commits: scaffold, core feature, polish/fix, docs update.
Task Playbooks
New Plugin From Requirement
- Convert requirement into one primary user interaction.
- Scaffold with
yo joplin. - Implement minimum viable command/panel/content script.
- Update manifest metadata.
- Build and run in Development Mode.
- Return install/run steps and known limitations.
Feature Upgrade In Existing Plugin
- Identify extension points in existing
onStartregistration. - Add feature with minimal API surface change.
- Keep compatibility with existing settings and data where possible.
- Validate build and runtime regressions.
Debugging and Fixes
- Reproduce in Development Mode.
- Triage by category: load-time, API/runtime, editor-content-script, packaging.
- Apply smallest fix with clear reason.
- Rebuild and re-test.
References
Use references/official-docs-index.md for direct links and focused loading guidance.