Skip to content
Back to skills

Canvas Drawing Command Generator

ASecurity

Generates a self-contained HTML/JavaScript application that interprets a custom string-based drawing language to render graphics on an HTML5 Canvas, adhering to specific parsing constraints to ensure compatibility.

  • 17 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 30, 2026
toolsjavascriptjavaaws

Works with

  • cursor
  • cli

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add gabrielmoreira/agent-skills-mirror --skill canvas-drawing-command-generator --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Canvas Drawing Command Generator?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Canvas Drawing Command Generator
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gabrielmoreira-canvas-drawing-command-generator/badge)](https://www.skillsdirectory.com/skills/gabrielmoreira-canvas-drawing-command-generator)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "2d80062f-2bb8-4444-8a70-7db4c91ead45"
name: "Canvas Drawing Command Generator"
description: "Generates a self-contained HTML/JavaScript application that interprets a custom string-based drawing language to render graphics on an HTML5 Canvas, adhering to specific parsing constraints to ensure compatibility."
version: "0.1.0"
tags:
  - "canvas"
  - "javascript"
  - "html"
  - "drawing"
  - "vector graphics"
triggers:
  - "generate canvas drawing code"
  - "create a canvas drawing app"
  - "draw this command string on canvas"
  - "html canvas bytecode interpreter"
---

# Canvas Drawing Command Generator

Generates a self-contained HTML/JavaScript application that interprets a custom string-based drawing language to render graphics on an HTML5 Canvas, adhering to specific parsing constraints to ensure compatibility.

## Prompt

# Role & Objective
Generate a single-file HTML/JavaScript solution for rendering vector graphics on a canvas based on a custom command string provided by the user.

# Operational Rules & Constraints
- **HTML Structure:** The output must be a single HTML code block containing an `<input>` field (id="drawingCommands"), a `<button>` (onclick="draw()"), and a `<canvas>` element (id="myCanvas").
- **Drawing Language:** The application must parse a space-separated string of commands:
  - `C,color`: Sets the fillStyle and strokeStyle to the specified color.
  - `M,x,y`: Moves the drawing cursor to coordinates (x, y).
  - `L,x,y`: Draws a line from the current position to coordinates (x, y).
  - `F`: Fills the current path.
  - `Z`: Closes the current path.
  - `A,x,y,r`: Draws an arc/circle at (x, y) with radius r.
- **Critical Parsing Constraint:** Do NOT use array destructuring (e.g., `const [cmd, ...args]`) or the `.map()` method on the arguments array (e.g., `args.map(Number)`). This causes "TypeError: args.map is not a function" in the target environment. Instead, parse coordinates by accessing array indices directly using `parseInt(parts[1])` and `parseInt(parts[2])`.
- **Output Format:** Output ONLY the raw HTML code block. Do not wrap the code in markdown backticks (\`\`\`) or include any conversational text, descriptions, or explanations before or after the code.

## Triggers

- generate canvas drawing code
- create a canvas drawing app
- draw this command string on canvas
- html canvas bytecode interpreter

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.