Plugin Best Practices

Practical guidance for stable, maintainable, and user-friendly plugins.

Good plugins are small, focused, and predictable.

Design for one job

Start with a single feature.

Avoid large multi-purpose plugins in the first version.

Keep startup light

Use on_app_start for UI injection and light initialization.

Push heavy work into background workers.

Fail safely

Assume every external dependency can fail.

Guard file access, hardware access, and parsing logic.

Clean up everything

If your plugin starts it, your plugin should stop it.

That includes threads, files, streams, and device connections.

Prefer visible feedback

A toast, dialog, or visible plugin action makes testing easier.

Users should know when a plugin actually did something.

Keep mutations reversible

If you modify score content, make the scope obvious.

If you modify UI state, keep the changes minimal and intentional.

Write for maintainability

  • keep function names descriptive

  • split UI code from business logic

  • avoid hidden side effects in hook functions

  • document unusual dependencies inside the plugin folder

Stability checklist

  • plugin loads cleanly

  • plugin does one thing well

  • plugin reports visible results

  • plugin unloads cleanly

  • plugin permissions stay minimal

Last updated

Was this helpful?