blockly

Define and maintain Megahub Blockly blocks with Lua generators and documentation.

5|2|Updated Dec 26, 2025
One-click install
npx skills add https://github.com/mirkosertic/Megahub --skill blockly
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: blockly
Source: https://github.com/mirkosertic/Megahub/tree/main/.claude/skills/blockly
Command: npx skills add https://github.com/mirkosertic/Megahub --skill blockly

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill removes the guesswork from extending Megahub's Blockly IDE by giving you a precise workflow for creating, updating, and debugging custom blocks, Lua generators, and the documentation that describes them.

Core Features & Use Cases

  • Custom block authoring: Define Megahub blocks as self-contained JavaScript modules with block JSON, Lua generation logic, and toolbox metadata.
  • Generator debugging: Diagnose statement blocks, value blocks, field mappings, and shadow inputs so the emitted Lua matches the intended behavior.
  • Platform integration: Register new blocks across the IDE component, renderer, and documentation scripts so the workspace, preview, and docs stay in sync.
  • Docs and testing workflow: Keep BLOCKS.md, screenshots, and unit tests aligned whenever blocks, tooltips, inputs, or fields change.
  • Use case: Add a new motor, GPIO, or UI block, verify its Lua output, and regenerate the Megahub block catalog without missing any required wiring.

Quick Start

Use the blockly skill to add or fix a Megahub block, wire its Lua generator and registrations, and regenerate the block docs and tests.

Frequently Asked Questions about blockly

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create custom Megahub Blockly blocks with Lua generators?

To create custom Megahub Blockly blocks, define self-contained JavaScript modules containing block JSON, Lua generation logic, and toolbox metadata, then register them across the IDE component and renderer scripts.

Why does my Blockly block output incorrect Lua code?

Debugging incorrect Lua code output requires checking statement blocks, value blocks, field mappings, and shadow inputs to ensure the emitted Lua matches the intended behavior for your custom block.

What is the process for maintaining Blockly block documentation and unit tests?

Maintaining Blockly block documentation involves regenerating BLOCKS.md, updating screenshots, and aligning unit tests whenever block definitions, tooltips, inputs, or fields change.

Do I need to update registrations when adding new blocks to the Megahub IDE?

Yes, adding new blocks requires registration across the frontend build and renderer scripts to ensure the workspace, preview, and documentation stay in sync with consistent filename-to-type mapping.

What's the best way to keep the Blockly toolbox and block catalog in sync?

The best way to keep the toolbox and block catalog in sync is to apply a consistent workflow that regenerates BLOCKS.md and runs unit tests after any block, tooltip, or field modification.