algorithm-visualizer
npx machina-cli add skill a5c-ai/babysitter/algorithm-visualizer --openclawAlgorithm 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
- Array Operations: Sorting, searching, two-pointer techniques
- Tree Structures: Binary trees, BST operations, tree traversals
- Graph Algorithms: BFS, DFS, shortest paths, MST
- DP Tables: State transitions, optimal substructure
- 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
- Step 1: Provide input JSON per the Input Schema, including algorithm and input, and choose a format (ascii, svg, gif, html).
- Step 2: Optional Step-by-Step mode: set steps to true to generate frame-by-frame visuals.
- 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