Craft Plugin Skills: Build and Share a Custom Screen Widget
Craft Plugin Skills: Build and Share a Custom Screen Widget

Turn a useful idea into a widget for your secondary screen. Craft Plugin Skills provides the craft-plugin-builder skill for an AI coding agent, helping you create, test, and package custom MiraBox Craft plugins.

This tutorial follows a system volume display from its first prompt to a shareable .mPanelPlugin installer. The example reads the current Windows default output device and displays its volume, level bar, and mute status.

Before You Start

Prepare MiraBox Craft, a secondary-screen setup, and an AI coding tool that can load skills and work with local project files. Create a dedicated project folder and ask the agent to check the required Node.js, npm, and Craft setup before building.

There are two different installations: the builder skill goes into your AI tool; the generated widget goes into Craft. Neither installation automatically publishes anything to MiraBox Space.

The English diagrams below illustrate the workflow. They are not screenshots of a completed build on your computer.

1. Install the Craft Builder Skill

Use the official Plugin Builder repository and select its skills/craft-plugin-builder folder.

The repository still has StreamDock in its name, but it contains a separate Craft skill. Choose craft-plugin-builder for secondary-screen widgets, not the Stream Dock key-action skill.

Ask your agent:

Install the craft-plugin-builder skill from https://github.com/MiraboxSpace/StreamDock-Plugin-Builder/tree/main/skills/craft-plugin-builder. Keep its references and assets together, explain how to reload it in this AI tool, and confirm that the skill is available before creating a project.

For a manual installation, follow your AI tool's skill-folder requirements. Keep SKILL.md, references/, and assets/ together, with SKILL.md directly inside the craft-plugin-builder folder rather than another nested copy. Reload the tool or start a fresh session after installation.

Craft Plugin Skills workflow: install the skill, describe a widget, test in Craft, and request a production release

The skill belongs in the AI tool. The finished plugin installer belongs in Craft.

2. Describe the Widget You Want

A focused brief gives the agent something you can test. Include the data source, displayed information, editable settings, and expected behavior when resized.

For the volume widget, use a prompt such as:

Use craft-plugin-builder to create a system volume display for Craft. Read the master volume of the current Windows default output device. Show a percentage, a level bar, and mute status. Make the bar color configurable and keep the layout readable when resized. Install a development build for testing first. Wait for my confirmation before creating a production release.

Example Craft widget brief covering volume data, configurable color, responsive layout, and development testing

The documented default template uses a Node.js backend and an HTML settings panel. Request the Vue template explicitly if your project needs it. A Craft widget displays content on a continuous screen canvas; do not assume that physical-key, dial, or touch actions from another plugin workflow apply here.

3. Add and Test the Development Widget

Ask the agent to install the development build and report the actual installation directory. Quit Craft before replacing an existing installation, then restart it when instructed.

  1. Open Screen in Craft and select the intended secondary screen.
  2. Find System Volume in the plugin list on the right.
  3. Drag the widget onto the screen canvas and confirm that its card appears.
  4. Select the widget, find Volume bar color, and choose a color.
  5. Move and resize the card. Check that the percentage, bar, and spacing remain readable.
  6. Change the system volume, toggle mute, and restart Craft to check live updates and saved settings.

Illustration of a System Volume widget on the Craft canvas with a configurable volume bar color

The 26% reading is example data. Test your widget against the actual system volume.

Report specific problems to the agent, such as clipped text or a color setting that does not persist. Retest the fix before requesting a release.

A development installation is not a portable installer. The Node development launcher depends on local source files, and the Vue development installation depends on Vite.

4. Build a Shareable Release

Once the widget behaves correctly, ask:

The development build works correctly. Build the production release, install it into the active Craft plugins directory, and create a shareable .mPanelPlugin installer. Return the installer path, actual installation directory, and restart instructions.

In the templates documented by the supplied tutorial, the full release workflow compiles the production output, installs it into Craft's active directory, and creates the installer through a postbuild hook.

  • Node projects: run npm run build in plugin/.
  • Vue projects: run npm run build at the project root.
  • Output: look in the project's release/ folder after the full build completes.

For the example widget, the output is:

release/com.mirabox.streamdock.systemvolume.mPanelPlugin

Use your actual plugin ID, not this example name, for another project. npm run bundle only compiles, and npm run package only packages existing production output. Neither alone replaces the complete build workflow described here.

Updating the skill does not automatically migrate an older project. If the project lacks the packaging scripts or postbuild hook, ask the agent to follow the official Craft packaging guide before rebuilding.

5. Check the Installer Structure

Current templates handle packaging automatically. If you need a manual fallback, use a genuine ZIP archive and make sure manifest.json is directly at its root.

Open the production plugin folder and archive its contents, not the enclosing folder from its parent directory. This is different from workflows that require a top-level plugin folder inside the archive.

Craft plugin installer structure with manifest.json directly at the archive root

For a Node plugin, the runtime files may include manifest.json, locale files, plugin/, propertyInspector/, and static/. Vue output instead includes index.html and emitted assets at the root. Follow the actual manifest and confirm that every referenced runtime and settings-panel path exists.

Check these details before sharing:

  • Use ZIP, not RAR or 7z. Renaming a different archive format does not convert it.
  • Name the installer with the real plugin ID and the .mPanelPlugin extension.
  • Show file extensions and remove an unintended trailing .zip from this generated installer.
  • Exclude logs, node_modules/, build tooling, old archives, and the release/ directory itself.
  • Keep the output in the source project's release/ folder, outside the runtime files being packaged.

6. Install and Verify the Release

Use Craft's local plugin installation entry to select the finished file. If the extension is associated with Craft, opening the installer may also launch installation. Restart Craft, add System Volume to the canvas, and verify its display, resizing, and settings again.

If your version has no local installer entry, quit Craft and locate the active data directory using Open application folder in settings. Under plugins/, create a folder named with the real plugin ID and .mPanelPlugin suffix, then extract the archive contents into it. The resulting structure should be:

plugins/<plugin-id>.mPanelPlugin/manifest.json

Back up an existing installation before replacing it. Do not put the unopened archive in place of the directory or add a second nested plugin folder.

After checking the release, share the installer or use the MiraBox Space submission page. Creating a package and submitting it for publication are separate steps.

Troubleshooting

The Agent Cannot Find the Skill

Check that SKILL.md is directly inside the expected skill folder, with its references and assets intact. Reload the AI tool before trying again.

The Widget Does Not Appear in Craft

Check the actual active installation directory and restart Craft. Do not assume a fixed drive or default folder is the one your installation uses.

The Build Finishes Without an Installer

Confirm that the full build completed, the postbuild hook exists, and neither compilation nor installation failed. Older projects need the current packaging scripts integrated explicitly.

Craft Does Not Recognize the Installer

Check the ZIP format, final extension, root-level manifest, and referenced entry files. A development folder or a ZIP of the entire source project is not a production installer.

Related Guides and Resources

Précédent Suivant