Scratch Code Assistant for Openclaw

An AI-powered utility for visualizing, analyzing, and explaining Scratch projects through specialized ASCII block rendering.

z-bra0
v0.0.2
Apr 2, 2026
1
744
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install scratch-blocks

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install scratch-blocks using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Scratch Code Assistant?

The Scratch Code Assistant is a technical extension designed for the Openclaw Skills ecosystem that enables AI agents to interact deeply with Scratch projects. By processing .sb3 and .sprite3 files, it allows for the analysis of visual code scripts without requiring a GUI. The skill converts complex, nested Scratch JSON into a simplified internal format for reasoning and then renders it back into human-readable ASCII blocks.

This skill is particularly valuable for developers building educational tools or automated coding agents that need to interpret or generate Scratch logic. It ensures that the AI's understanding of block-based programming is grounded in the actual Scratch engine specifications, providing a reliable bridge between visual logic and text-based analysis within Openclaw Skills.

Scratch Code Assistant Use Cases

  • Debugging logic errors within uploaded .sb3 or .sprite3 Scratch project files.
  • Explaining complex Scratch scripts to students using clear ASCII block visualizations.
  • Extracting variable and list data from Scratch projects for external analysis.
  • Generating visual code examples for Scratch tutorials and documentation.
  • Reasoning over sprite-specific behaviors in multi-sprite gaming projects.

How Scratch Code Assistant Works

  1. The AI detects a Scratch-related query or the presence of a .sb3/.sprite3 file upload.
  2. Raw Scratch files are processed via an extraction script to create a simplified, flat scratch-json representation.
  3. The AI performs internal reasoning using this JSON schema to identify scripts, variables, and list structures.
  4. When a visual explanation is required, the skill writes the internal logic to a temporary file.
  5. A dedicated rendering script processes the JSON and generates a visual ASCII representation of the Scratch blocks.
  6. The final rendered output is delivered to the user within a fenced code block for optimal readability.

Scratch Code Assistant Setup

To integrate this capability into your Openclaw Skills environment, ensure the script assets are correctly pathed within your agent's directory.

# Example: Extracting data from a raw Scratch project file
python3 scripts/extract.py project.json > internal_blocks.json

# Example: Rendering ASCII blocks for the user
python3 scripts/render_ascii.py "/tmp/scratchcode/blocks.json" --targets Sprite1

Scratch Code Assistant Data Schema & Taxonomy

The skill utilizes a flattened JSON structure to manage Scratch project state efficiently. This schema is optimized for Openclaw Skills to ensure fast reasoning over block hierarchies.

Object Type Key Components Description
script blocks, opcode, params Represents a sequence of connected Scratch blocks.
variable name, value Tracks current state for global or sprite-local variables.
list name, items Manages arrays and collections within the project.
block opcode, params, blocks The atomic unit of logic, including inputs and sub-branches.

Scratch Code Assistant Advanced Features

  • Support for complex control structures including nested loops (control_repeat) and multi-branch conditionals (if-else).
  • Targeted rendering options to filter visualizations by specific Sprites or the Stage.
  • Internal-only scratch-json format that prevents cluttered raw data from entering the user conversation.
  • Automated extraction pipeline for .sb3 and .sprite3 archive formats.
  • High-fidelity ASCII block representation that mirrors the visual logic of the Scratch editor.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*