Install
openclaw skills install @z-bra0/scratch-blocksUse this skill when the user uploads a .sb3 or .sprite3 file, or when the conversation is about Scratch and clearer block-style visualization would help.
openclaw skills install @z-bra0/scratch-blocksscratch-json is internal-only. Never paste it into the final user reply.scripts/render_ascii.py and use its exact output.scratch-json only for tool input and internal reasoning.Help with Scratch code questions by representing Scratch projects into
scratch-json when needed, reasoning over that internal representation, and
showing Scratch code to the user through scripts/render_ascii.py instead of
raw JSON. For conceptual questions, prefer a visual rendered example over prose-only explanation.
references/ when you need skill guidance or file-handling instructions.data/ are runtime assets used by scripts/, not AI-facing reference docs.data/ as reference material.scratch-json Referencescratch-json is an internal working format for the AI. Do not return it to the user.
scratch-json is a flat JSON array of objects. Each object repeats its owning target, which can represent a Sprite or the Stage.
This is different from raw Scratch project.json / sprite.json. If you have a raw Scratch file, run scripts/extract.py first.
Each object includes:
| Field | Type | Description |
|---|---|---|
type | string | script, variable, or list |
target | string | Owning sprite or stage name |
variable Structure| Field | Type | Description |
|---|---|---|
name | string | Variable name |
value | any | Current value |
list Structure| Field | Type | Description |
|---|---|---|
name | string | List name |
items | list | Current list items |
script Structure| Field | Type | Description |
|---|---|---|
blocks | list of block objects | One linked top-level script |
Every block must include opcode. params and blocks are optional.
| Field | Type | Description |
|---|---|---|
opcode | string | Block type, Scratch block opcode |
params | list | Optional positional input values |
blocks | list of scripts | Optional sub-script branches |
params Item Types| Type | Example |
|---|---|
| number / string | 10, "Hello!", "space" |
| reporter block | { opcode: motion_xposition } |
| variable / list / broadcast | { type: variable, name: score } |
blocks Branchesblocks.control_repeat and control_if use one branch for the body.control_if_else uses two branches: index 0 for then, index 1 for else.This format is for internal reasoning and tool input, not for user-facing replies.
Internal object kinds:
script, variable, list
scripts/render_ascii.py before showing Scratch code to the userscratch-json as intermediate data only# Preferred: write scratch-json to a temp file, then render that file.
# This avoids shell quoting issues and very long CLI arguments.
tmp_json=/tmp/scratchcode/blocks.json
python3 <SKILL_DIR>/scripts/render_ascii.py "$tmp_json"
# For scratch-json file path, optionally narrowed to target names:
python3 <SKILL_DIR>/scripts/render_ascii.py "<SCRATCH_JSON_PATH>" --targets Sprite1 Stage
.sb3 or .sprite3 file, follow the process in
references/UPLOADS.md.project.json or sprite.json, run scripts/extract.py first before scripts/render_ascii.py.scratch-json only as an internal representation for analysis.scripts/render_ascii.py.scratch-json data to the user.scripts/render_ascii.py first.render_ascii.py, do not output boxed ASCII at all; answer in prose or run the renderer first.scratch-json?" If yes, stop and render it first.