Get the FREE Ultimate OpenClaw Setup Guide →

algorithm-visualizer

npx machina-cli add skill a5c-ai/babysitter/algorithm-visualizer --openclaw
Files (1)
SKILL.md
1.7 KB

Algorithm Visualizer Skill

Purpose

Generate visual representations of algorithm execution to aid understanding, debugging, and explanation of algorithmic concepts.

Capabilities

  • Step-by-step execution visualization
  • Data structure state visualization
  • Graph algorithm animation
  • DP table visualization
  • Generate animated GIFs/videos
  • Interactive visualization generation
  • Tree and array state rendering

Target Processes

  • algorithm-implementation
  • dp-pattern-matching
  • graph-traversal
  • interview-problem-explanation

Visualization Types

  1. Array Operations: Sorting, searching, two-pointer techniques
  2. Tree Structures: Binary trees, BST operations, tree traversals
  3. Graph Algorithms: BFS, DFS, shortest paths, MST
  4. DP Tables: State transitions, optimal substructure
  5. Data Structures: Stack, queue, heap operations

Input Schema

{
  "type": "object",
  "properties": {
    "algorithm": { "type": "string" },
    "input": { "type": "object" },
    "format": {
      "type": "string",
      "enum": ["ascii", "svg", "gif", "html"]
    },
    "steps": { "type": "boolean", "default": true }
  },
  "required": ["algorithm", "input"]
}

Output Schema

{
  "type": "object",
  "properties": {
    "success": { "type": "boolean" },
    "visualization": { "type": "string" },
    "steps": { "type": "array" },
    "format": { "type": "string" }
  },
  "required": ["success"]
}

Integration

Can integrate with visualization libraries like Manim, D3.js, or generate ASCII art for terminal-based visualization.

Source

git clone https://github.com/a5c-ai/babysitter/blob/main/plugins/babysitter/skills/babysit/process/specializations/algorithms-optimization/skills/algorithm-visualizer/SKILL.mdView on GitHub

Overview

Algorithm Visualizer generates visual representations of algorithm execution to aid understanding, debugging, and explanation of algorithmic concepts. It supports step-by-step execution, data structure state rendering, and animations for graphs, trees, DP tables, and arrays.

How This Skill Works

Provide an input JSON with fields like algorithm, input, format, and an optional steps flag. The tool renders the visualization using libraries such as Manim or D3.js or ASCII art and outputs a visualization string or file in the requested format (ascii, svg, gif, or html).

When to Use It

  • Teaching algorithm concepts to students or teammates
  • Debugging an implementation by visualizing data structure changes and state transitions
  • Explaining graph algorithms (BFS, DFS, shortest paths, MST) with animations
  • Demonstrating dynamic programming transitions and DP table states
  • Explaining interview problems or case studies with step-by-step visuals

Quick Start

  1. Step 1: Provide input JSON per the Input Schema, including algorithm and input, and choose a format (ascii, svg, gif, html).
  2. Step 2: Optional Step-by-Step mode: set steps to true to generate frame-by-frame visuals.
  3. Step 3: Run the visualizer and retrieve the visualization string or file in the requested format; use the Output Schema to validate success and result.

Best Practices

  • Clearly define the algorithm and provide representative input data
  • Choose the visualization format that best communicates the concept (gif for animation, svg for static clarity, ascii for terminals)
  • Enable step-by-step mode to show each transition
  • Test with edge cases and large inputs to ensure layout scales
  • Align visualization type to the target process (sorting, graph traversal, DP tables, data structures)

Example Use Cases

  • Sorting visualization: visualize a quicksort run on a sample array
  • Graph traversal: animate BFS on a sample undirected graph
  • DP table: illustrate knapsack state transitions
  • Tree structures: render BST insert and traversal orders
  • Interview problem explainer: step-by-step visualization of a dynamic programming problem

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers