Agent skill

P5js

by Tommy-yw in Tommy-yw/RunbookHermes

Production pipeline for interactive and generative visual art using p5.js.

MITAuto-check passedMedia & Creative

Install P5js

skills CLI
$ npx skills add Tommy-yw/RunbookHermes --skill p5js -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Tommy-yw/RunbookHermes p5js --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Tommy-yw/RunbookHermes.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/creative/p5js .claude/skills/p5js && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
p5js
GitHub stars
546
Used in
1 other repo
Token cost
~6.8k tokens
SKILL.md length
2,526 words
Files
15 (incl. scripts, references)
Skills in repo
38
Repo updated
First seen
Licence
MIT

At a glance

Production pipeline for interactive and generative visual art using p5.js.

  • Works in 6 steps: Creative Vision → Technical Design → Code the Sketch → …
  • Users request: p5.js sketches
  • SKILL.md covers Creative Standard, Modes, Stack and Pipeline, plus 3 more sections
  • Runs Shell scripts from its folder; calls python3, node and ffmpeg; reaches cdnjs.cloudflare.com and unpkg.com

What it does

P5js is an agent skill from Tommy-yw/RunbookHermes. Production pipeline for interactive and generative visual art using p5.js. Creates browser-based sketches, generative art, data visualizations, interactive experiences, 3D scenes, audio-reactive visuals, and motion graphics — exported as HTML, PNG, GIF, MP4, or SVG. Covers: 2D/3D rendering, noise and particle systems, flow fields, shaders (GLSL), pixel manipulation, kinetic typography, WebGL scenes, audio analysis, mouse/keyboard interaction, and headless high-res export. Use when users request: p5.js sketches…

Its SKILL.md is about 6.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 17 other files, including scripts and reference files (for example `README.md`, `references/animation.md` and `references/color-systems.md`).

It sits in Media & Creative, covering Generative and creative coding, 3D graphics and WebGL and Shaders. The repository describes itself as: Hermes-native AIOps agent for evidence-driven incident response, approval-gated remediation, and runbook learning. The licence is MIT.

When your agent uses it

  • Users request: p5.js sketches
  • Creative coding
  • Interactive visualizations
  • Canvas animations

Example prompts

  • “/p5js”

Requirements

  • Node.js
  • A Bash shell

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Creative Vision
  2. Technical Design
  3. Code the Sketch
  4. Preview & Iterate
  5. Export
  6. Quality Verification

What it can do on your machine

Read from SKILL.md and the folder at commit 7fd2b9a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 3 files in scripts/ (Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • python3
    • node
    • ffmpeg
    • bash

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • cdnjs.cloudflare.com
    • unpkg.com
    • cdn.jsdelivr.net

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

P5js loads about 6.8k tokens when it runs, and up to ~31k if it reads all its reference files. Until then it costs about 169 tokens; SKILL.md has 2,526 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~169
When it runs · the whole SKILL.md, loaded when a task matches
~6.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~31k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from Tommy-yw/RunbookHermes at commit 7fd2b9a, republished under its MIT licence (© Tommy-yw). 2,526 words, ~6,802 tokens.

Download SKILL.mdSave it as .claude/skills/p5js/SKILL.md (or your agent's skills folder). This skill also uses 14 other files; get the full folder from GitHub.
name
p5js
description
Production pipeline for interactive and generative visual art using p5.js. Creates browser-based sketches, generative art, data visualizations, interactive experiences, 3D scenes, audio-reactive visuals, and motion graphics — exported as HTML, PNG, GIF, MP4, or SVG. Covers: 2D/3D rendering, noise and particle systems, flow fields, shaders (GLSL), pixel manipulation, kinetic typography, WebGL scenes, audio analysis, mouse/keyboard interaction, and headless high-res export. Use when users request: p5.js sketches, creative coding, generative art, interactive visualizations, canvas animations, browser-based visual art, data viz, shader effects, or any p5.js project.
version
1.0.0

p5.js Production Pipeline

Creative Standard

This is visual art rendered in the browser. The canvas is the medium; the algorithm is the brush.

Before writing a single line of code, articulate the creative concept. What does this piece communicate? What makes the viewer stop scrolling? What separates this from a code tutorial example? The user's prompt is a starting point — interpret it with creative ambition.

First-render excellence is non-negotiable. The output must be visually striking on first load. If it looks like a p5.js tutorial exercise, a default configuration, or "AI-generated creative coding," it is wrong. Rethink before shipping.

Go beyond the reference vocabulary. The noise functions, particle systems, color palettes, and shader effects in the references are a starting vocabulary. For every project, combine, layer, and invent. The catalog is a palette of paints — you write the painting.

Be proactively creative. If the user asks for "a particle system," deliver a particle system with emergent flocking behavior, trailing ghost echoes, palette-shifted depth fog, and a background noise field that breathes. Include at least one visual detail the user didn't ask for but will appreciate.

Dense, layered, considered. Every frame should reward viewing. Never flat white backgrounds. Always compositional hierarchy. Always intentional color. Always micro-detail that only appears on close inspection.

Cohesive aesthetic over feature count. All elements must serve a unified visual language — shared color temperature, consistent stroke weight vocabulary, harmonious motion speeds. A sketch with ten unrelated effects is worse than one with three that belong together.

Modes

ModeInputOutputReference
Generative artSeed / parametersProcedural visual composition (still or animated)references/visual-effects.md
Data visualizationDataset / APIInteractive charts, graphs, custom data displaysreferences/interaction.md
Interactive experienceNone (user drives)Mouse/keyboard/touch-driven sketchreferences/interaction.md
Animation / motion graphicsTimeline / storyboardTimed sequences, kinetic typography, transitionsreferences/animation.md
3D sceneConcept descriptionWebGL geometry, lighting, camera, materialsreferences/webgl-and-3d.md
Image processingImage file(s)Pixel manipulation, filters, mosaic, pointillismreferences/visual-effects.md § Pixel Manipulation
Audio-reactiveAudio file / micSound-driven generative visualsreferences/interaction.md § Audio Input

Stack

Single self-contained HTML file per project. No build step required.

LayerToolPurpose
Corep5.js 1.11.3 (CDN)Canvas rendering, math, transforms, event handling
3Dp5.js WebGL mode3D geometry, camera, lighting, GLSL shaders
Audiop5.sound.js (CDN)FFT analysis, amplitude, mic input, oscillators
ExportBuilt-in saveCanvas() / saveGif() / saveFrames()PNG, GIF, frame sequence output
CaptureCCapture.js (optional)Deterministic framerate video capture (WebM, GIF)
HeadlessPuppeteer + Node.js (optional)Automated high-res rendering, MP4 via ffmpeg
SVGp5.js-svg 1.6.0 (optional)Vector output for print — requires p5.js 1.x
Natural mediap5.brush (optional)Watercolor, charcoal, pen — requires p5.js 2.x + WEBGL
Texturep5.grain (optional)Film grain, texture overlays
FontsGoogle Fonts / loadFont()Custom typography via OTF/TTF/WOFF2
Version Note

p5.js 1.x (1.11.3) is the default — stable, well-documented, broadest library compatibility. Use this unless a project requires 2.x features.

p5.js 2.x (2.2+) adds: async setup() replacing preload(), OKLCH/OKLAB color modes, splineVertex(), shader .modify() API, variable fonts, textToContours(), pointer events. Required for p5.brush. See references/core-api.md § p5.js 2.0.

Pipeline

Every project follows the same 6-stage path:

CONCEPT → DESIGN → CODE → PREVIEW → EXPORT → VERIFY
  1. CONCEPT — Articulate the creative vision: mood, color world, motion vocabulary, what makes this unique
  2. DESIGN — Choose mode, canvas size, interaction model, color system, export format. Map concept to technical decisions
  3. CODE — Write single HTML file with inline p5.js. Structure: globals → preload() → setup() → draw() → helpers → classes → event handlers
  4. PREVIEW — Open in browser, verify visual quality. Test at target resolution. Check performance
  5. EXPORT — Capture output: saveCanvas() for PNG, saveGif() for GIF, saveFrames() + ffmpeg for MP4, Puppeteer for headless batch
  6. VERIFY — Does the output match the concept? Is it visually striking at the intended display size? Would you frame it?

Creative Direction

Aesthetic Dimensions
DimensionOptionsReference
Color systemHSB/HSL, RGB, named palettes, procedural harmony, gradient interpolationreferences/color-systems.md
Noise vocabularyPerlin noise, simplex, fractal (octaved), domain warping, curl noisereferences/visual-effects.md § Noise
Particle systemsPhysics-based, flocking, trail-drawing, attractor-driven, flow-field followingreferences/visual-effects.md § Particles
Shape languageGeometric primitives, custom vertices, bezier curves, SVG pathsreferences/shapes-and-geometry.md
Motion styleEased, spring-based, noise-driven, physics sim, lerped, steppedreferences/animation.md
TypographySystem fonts, loaded OTF, textToPoints() particle text, kineticreferences/typography.md
Shader effectsGLSL fragment/vertex, filter shaders, post-processing, feedback loopsreferences/webgl-and-3d.md § Shaders
CompositionGrid, radial, golden ratio, rule of thirds, organic scatter, tiledreferences/core-api.md § Composition
Interaction modelMouse follow, click spawn, drag, keyboard state, scroll-driven, mic inputreferences/interaction.md
Blend modesBLEND, ADD, MULTIPLY, SCREEN, DIFFERENCE, EXCLUSION, OVERLAYreferences/color-systems.md § Blend Modes
LayeringcreateGraphics() offscreen buffers, alpha compositing, maskingreferences/core-api.md § Offscreen Buffers
TexturePerlin surface, stippling, hatching, halftone, pixel sortingreferences/visual-effects.md § Texture Generation
Per-Project Variation Rules

Never use default configurations. For every project:

  • Custom color palette — never raw fill(255, 0, 0). Always a designed palette with 3-7 colors
  • Custom stroke weight vocabulary — thin accents (0.5), medium structure (1-2), bold emphasis (3-5)
  • Background treatment — never plain background(0) or background(255). Always textured, gradient, or layered
  • Motion variety — different speeds for different elements. Primary at 1x, secondary at 0.3x, ambient at 0.1x
  • At least one invented element — a custom particle behavior, a novel noise application, a unique interaction response
Project-Specific Invention

For every project, invent at least one of:

  • A custom color palette matching the mood (not a preset)
  • A novel noise field combination (e.g., curl noise + domain warp + feedback)
  • A unique particle behavior (custom forces, custom trails, custom spawning)
  • An interaction mechanic the user didn't request but that elevates the piece
  • A compositional technique that creates visual hierarchy
Parameter Design Philosophy

Parameters should emerge from the algorithm, not from a generic menu. Ask: "What properties of this system should be tunable?"

Good parameters expose the algorithm's character:

  • Quantities — how many particles, branches, cells (controls density)
  • Scales — noise frequency, element size, spacing (controls texture)
  • Rates — speed, growth rate, decay (controls energy)
  • Thresholds — when does behavior change? (controls drama)
  • Ratios — proportions, balance between forces (controls harmony)

Bad parameters are generic controls unrelated to the algorithm:

  • "color1", "color2", "size" — meaningless without context
  • Toggle switches for unrelated effects
  • Parameters that only change cosmetics, not behavior

Every parameter should change how the algorithm thinks, not just how it looks. A "turbulence" parameter that changes noise octaves is good. A "particle size" slider that only changes ellipse() radius is shallow.

Workflow

Step 1: Creative Vision

Before any code, articulate:

  • Mood / atmosphere: What should the viewer feel? Contemplative? Energized? Unsettled? Playful?
  • Visual story: What happens over time (or on interaction)? Build? Decay? Transform? Oscillate?
  • Color world: Warm/cool? Monochrome? Complementary? What's the dominant hue? The accent?
  • Shape language: Organic curves? Sharp geometry? Dots? Lines? Mixed?
  • Motion vocabulary: Slow drift? Explosive burst? Breathing pulse? Mechanical precision?
  • What makes THIS different: What is the one thing that makes this sketch unique?

Map the user's prompt to aesthetic choices. "Relaxing generative background" demands different everything from "glitch data visualization."

Step 2: Technical Design
  • Mode — which of the 7 modes from the table above
  • Canvas size — landscape 1920x1080, portrait 1080x1920, square 1080x1080, or responsive windowWidth/windowHeight
  • Renderer — P2D (default) or WEBGL (for 3D, shaders, advanced blend modes)
  • Frame rate — 60fps (interactive), 30fps (ambient animation), or noLoop() (static generative)
  • Export target — browser display, PNG still, GIF loop, MP4 video, SVG vector
  • Interaction model — passive (no input), mouse-driven, keyboard-driven, audio-reactive, scroll-driven
  • Viewer UI — for interactive generative art, start from templates/viewer.html which provides seed navigation, parameter sliders, and download. For simple sketches or video export, use bare HTML
Step 3: Code the Sketch

For interactive generative art (seed exploration, parameter tuning): start from templates/viewer.html. Read the template first, keep the fixed sections (seed nav, actions), replace the algorithm and parameter controls. This gives the user seed prev/next/random/jump, parameter sliders with live update, and PNG download — all wired up.

For animations, video export, or simple sketches: use bare HTML:

Single HTML file. Structure:

html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Project Name</title>
  <script>p5.disableFriendlyErrors = true;</script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.3/p5.min.js"></script>
  <!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.3/addons/p5.sound.min.js"></script> -->
  <!-- <script src="https://unpkg.com/p5.js-svg@1.6.0"></script> -->  <!-- SVG export -->
  <!-- <script src="https://cdn.jsdelivr.net/npm/ccapture.js-npmfixed/build/CCapture.all.min.js"></script> -->  <!-- video capture -->
  <style>
    html, body { margin: 0; padding: 0; overflow: hidden; }
    canvas { display: block; }
  </style>
</head>
<body>
<script>
// === Configuration ===
const CONFIG = {
  seed: 42,
  // ... project-specific params
};

// === Color Palette ===
const PALETTE = {
  bg: '#0a0a0f',
  primary: '#e8d5b7',
  // ...
};

// === Global State ===
let particles = [];

// === Preload (fonts, images, data) ===
function preload() {
  // font = loadFont('...');
}

// === Setup ===
function setup() {
  createCanvas(1920, 1080);
  randomSeed(CONFIG.seed);
  noiseSeed(CONFIG.seed);
  colorMode(HSB, 360, 100, 100, 100);
  // Initialize state...
}

// === Draw Loop ===
function draw() {
  // Render frame...
}

// === Helper Functions ===
// ...

// === Classes ===
class Particle {
  // ...
}

// === Event Handlers ===
function mousePressed() { /* ... */ }
function keyPressed() { /* ... */ }
function windowResized() { resizeCanvas(windowWidth, windowHeight); }
</script>
</body>
</html>

Key implementation patterns:

  • Seeded randomness: Always randomSeed() + noiseSeed() for reproducibility
  • Color mode: Use colorMode(HSB, 360, 100, 100, 100) for intuitive color control
  • State separation: CONFIG for parameters, PALETTE for colors, globals for mutable state
  • Class-based entities: Particles, agents, shapes as classes with update() + display() methods
  • Offscreen buffers: createGraphics() for layered composition, trails, masks
Step 4: Preview & Iterate
  • Open HTML file directly in browser — no server needed for basic sketches
  • For loadImage()/loadFont() from local files: use scripts/serve.sh or python3 -m http.server
  • Chrome DevTools Performance tab to verify 60fps
  • Test at target export resolution, not just the window size
  • Adjust parameters until the visual matches the concept from Step 1
Step 5: Export
FormatMethodCommand
PNGsaveCanvas('output', 'png') in keyPressed()Press 's' to save
High-res PNGPuppeteer headless capturenode scripts/export-frames.js sketch.html --width 3840 --height 2160 --frames 1
GIFsaveGif('output', 5) — captures N secondsPress 'g' to save
Frame sequencesaveFrames('frame', 'png', 10, 30) — 10s at 30fpsThen ffmpeg -i frame-%04d.png -c:v libx264 output.mp4
MP4Puppeteer frame capture + ffmpegbash scripts/render.sh sketch.html output.mp4 --duration 30 --fps 30
SVGcreateCanvas(w, h, SVG) with p5.js-svgsave('output.svg')
Step 6: Quality Verification
  • Does it match the vision? Compare output to the creative concept. If it looks generic, go back to Step 1
  • Resolution check: Is it sharp at the target display size? No aliasing artifacts?
  • Performance check: Does it hold 60fps in browser? (30fps minimum for animations)
  • Color check: Do the colors work together? Test on both light and dark monitors
  • Edge cases: What happens at canvas edges? On resize? After running for 10 minutes?
Show full SKILL.md (1,008 more words)Show less

Critical Implementation Notes

Performance — Disable FES First

The Friendly Error System (FES) adds up to 10x overhead. Disable it in every production sketch:

javascript
p5.disableFriendlyErrors = true;  // BEFORE setup()

function setup() {
  pixelDensity(1);  // prevent 2x-4x overdraw on retina
  createCanvas(1920, 1080);
}

In hot loops (particles, pixel ops), use Math.* instead of p5 wrappers — measurably faster:

javascript
// In draw() or update() hot paths:
let a = Math.sin(t);          // not sin(t)
let r = Math.sqrt(dx*dx+dy*dy); // not dist() — or better: skip sqrt, compare magSq
let v = Math.random();        // not random() — when seed not needed
let m = Math.min(a, b);       // not min(a, b)

Never console.log() inside draw(). Never manipulate DOM in draw(). See references/troubleshooting.md § Performance.

Seeded Randomness — Always

Every generative sketch must be reproducible. Same seed, same output.

javascript
function setup() {
  randomSeed(CONFIG.seed);
  noiseSeed(CONFIG.seed);
  // All random() and noise() calls now deterministic
}

Never use Math.random() for generative content — only for performance-critical non-visual code. Always random() for visual elements. If you need a random seed: CONFIG.seed = floor(random(99999)).

Generative Art Platform Support (fxhash / Art Blocks)

For generative art platforms, replace p5's PRNG with the platform's deterministic random:

javascript
// fxhash convention
const SEED = $fx.hash;              // unique per mint
const rng = $fx.rand;               // deterministic PRNG
$fx.features({ palette: 'warm', complexity: 'high' });

// In setup():
randomSeed(SEED);   // for p5's noise()
noiseSeed(SEED);

// Replace random() with rng() for platform determinism
let x = rng() * width;  // instead of random(width)

See references/export-pipeline.md § Platform Export.

Color Mode — Use HSB

HSB (Hue, Saturation, Brightness) is dramatically easier to work with than RGB for generative art:

javascript
colorMode(HSB, 360, 100, 100, 100);
// Now: fill(hue, sat, bri, alpha)
// Rotate hue: fill((baseHue + offset) % 360, 80, 90)
// Desaturate: fill(hue, sat * 0.3, bri)
// Darken: fill(hue, sat, bri * 0.5)

Never hardcode raw RGB values. Define a palette object, derive variations procedurally. See references/color-systems.md.

Noise — Multi-Octave, Not Raw

Raw noise(x, y) looks like smooth blobs. Layer octaves for natural texture:

javascript
function fbm(x, y, octaves = 4) {
  let val = 0, amp = 1, freq = 1, sum = 0;
  for (let i = 0; i < octaves; i++) {
    val += noise(x * freq, y * freq) * amp;
    sum += amp;
    amp *= 0.5;
    freq *= 2;
  }
  return val / sum;
}

For flowing organic forms, use domain warping: feed noise output back as noise input coordinates. See references/visual-effects.md.

createGraphics() for Layers — Not Optional

Flat single-pass rendering looks flat. Use offscreen buffers for composition:

javascript
let bgLayer, fgLayer, trailLayer;
function setup() {
  createCanvas(1920, 1080);
  bgLayer = createGraphics(width, height);
  fgLayer = createGraphics(width, height);
  trailLayer = createGraphics(width, height);
}
function draw() {
  renderBackground(bgLayer);
  renderTrails(trailLayer);   // persistent, fading
  renderForeground(fgLayer);  // cleared each frame
  image(bgLayer, 0, 0);
  image(trailLayer, 0, 0);
  image(fgLayer, 0, 0);
}
Performance — Vectorize Where Possible

p5.js draw calls are expensive. For thousands of particles:

javascript
// SLOW: individual shapes
for (let p of particles) {
  ellipse(p.x, p.y, p.size);
}

// FAST: single shape with beginShape()
beginShape(POINTS);
for (let p of particles) {
  vertex(p.x, p.y);
}
endShape();

// FASTEST: pixel buffer for massive counts
loadPixels();
for (let p of particles) {
  let idx = 4 * (floor(p.y) * width + floor(p.x));
  pixels[idx] = r; pixels[idx+1] = g; pixels[idx+2] = b; pixels[idx+3] = 255;
}
updatePixels();

See references/troubleshooting.md § Performance.

Instance Mode for Multiple Sketches

Global mode pollutes window. For production, use instance mode:

javascript
const sketch = (p) => {
  p.setup = function() {
    p.createCanvas(800, 800);
  };
  p.draw = function() {
    p.background(0);
    p.ellipse(p.mouseX, p.mouseY, 50);
  };
};
new p5(sketch, 'canvas-container');

Required when embedding multiple sketches on one page or integrating with frameworks.

WebGL Mode Gotchas
  • createCanvas(w, h, WEBGL) — origin is center, not top-left
  • Y-axis is inverted (positive Y goes up in WEBGL, down in P2D)
  • translate(-width/2, -height/2) to get P2D-like coordinates
  • push()/pop() around every transform — matrix stack overflows silently
  • texture() before rect()/plane() — not after
  • Custom shaders: createShader(vert, frag) — test on multiple browsers
Export — Key Bindings Convention

Every sketch should include these in keyPressed():

javascript
function keyPressed() {
  if (key === 's' || key === 'S') saveCanvas('output', 'png');
  if (key === 'g' || key === 'G') saveGif('output', 5);
  if (key === 'r' || key === 'R') { randomSeed(millis()); noiseSeed(millis()); }
  if (key === ' ') CONFIG.paused = !CONFIG.paused;
}
Headless Video Export — Use noLoop()

For headless rendering via Puppeteer, the sketch must use noLoop() in setup. Without it, p5's draw loop runs freely while screenshots are slow — the sketch races ahead and you get skipped/duplicate frames.

javascript
function setup() {
  createCanvas(1920, 1080);
  pixelDensity(1);
  noLoop();                    // capture script controls frame advance
  window._p5Ready = true;      // signal readiness to capture script
}

The bundled scripts/export-frames.js detects _p5Ready and calls redraw() once per capture for exact 1:1 frame correspondence. See references/export-pipeline.md § Deterministic Capture.

For multi-scene videos, use the per-clip architecture: one HTML per scene, render independently, stitch with ffmpeg -f concat. See references/export-pipeline.md § Per-Clip Architecture.

Agent Workflow

When building p5.js sketches:

  1. Write the HTML file — single self-contained file, all code inline
  2. Open in browser — open sketch.html (macOS) or xdg-open sketch.html (Linux)
  3. Local assets (fonts, images) require a server: python3 -m http.server 8080 in the project directory, then open http://localhost:8080/sketch.html
  4. Export PNG/GIF — add keyPressed() shortcuts as shown above, tell the user which key to press
  5. Headless export — node scripts/export-frames.js sketch.html --frames 300 for automated frame capture (sketch must use noLoop() + _p5Ready)
  6. MP4 rendering — bash scripts/render.sh sketch.html output.mp4 --duration 30
  7. Iterative refinement — edit the HTML file, user refreshes browser to see changes
  8. Load references on demand — use skill_view(name="p5js", file_path="references/...") to load specific reference files as needed during implementation

Performance Targets

MetricTarget
Frame rate (interactive)60fps sustained
Frame rate (animated export)30fps minimum
Particle count (P2D shapes)5,000-10,000 at 60fps
Particle count (pixel buffer)50,000-100,000 at 60fps
Canvas resolutionUp to 3840x2160 (export), 1920x1080 (interactive)
File size (HTML)< 100KB (excluding CDN libraries)
Load time< 2s to first frame

References

FileContents
references/core-api.mdCanvas setup, coordinate system, draw loop, push()/pop(), offscreen buffers, composition patterns, pixelDensity(), responsive design
references/shapes-and-geometry.md2D primitives, beginShape()/endShape(), Bezier/Catmull-Rom curves, vertex() systems, custom shapes, p5.Vector, signed distance fields, SVG path conversion
references/visual-effects.mdNoise (Perlin, fractal, domain warp, curl), flow fields, particle systems (physics, flocking, trails), pixel manipulation, texture generation (stipple, hatch, halftone), feedback loops, reaction-diffusion
references/animation.mdFrame-based animation, easing functions, lerp()/map(), spring physics, state machines, timeline sequencing, millis()-based timing, transition patterns
references/typography.mdtext(), loadFont(), textToPoints(), kinetic typography, text masks, font metrics, responsive text sizing
references/color-systems.mdcolorMode(), HSB/HSL/RGB, lerpColor(), paletteLerp(), procedural palettes, color harmony, blendMode(), gradient rendering, curated palette library
references/webgl-and-3d.mdWEBGL renderer, 3D primitives, camera, lighting, materials, custom geometry, GLSL shaders (createShader(), createFilterShader()), framebuffers, post-processing
references/interaction.mdMouse events, keyboard state, touch input, DOM elements, createSlider()/createButton(), audio input (p5.sound FFT/amplitude), scroll-driven animation, responsive events
references/export-pipeline.mdsaveCanvas(), saveGif(), saveFrames(), deterministic headless capture, ffmpeg frame-to-video, CCapture.js, SVG export, per-clip architecture, platform export (fxhash), video gotchas
references/troubleshooting.mdPerformance profiling, per-pixel budgets, common mistakes, browser compatibility, WebGL debugging, font loading issues, pixel density traps, memory leaks, CORS
templates/viewer.htmlInteractive viewer template: seed navigation (prev/next/random/jump), parameter sliders, download PNG, responsive canvas. Start from this for explorable generative art

Creative Divergence (use only when user requests experimental/creative/unique output)

If the user asks for creative, experimental, surprising, or unconventional output, select the strategy that best fits and reason through its steps BEFORE generating code.

  • Conceptual Blending — when the user names two things to combine or wants hybrid aesthetics
  • SCAMPER — when the user wants a twist on a known generative art pattern
  • Distance Association — when the user gives a single concept and wants exploration ("make something about time")
Conceptual Blending
  1. Name two distinct visual systems (e.g., particle physics + handwriting)
  2. Map correspondences (particles = ink drops, forces = pen pressure, fields = letterforms)
  3. Blend selectively — keep mappings that produce interesting emergent visuals
  4. Code the blend as a unified system, not two systems side-by-side
SCAMPER Transformation

Take a known generative pattern (flow field, particle system, L-system, cellular automata) and systematically transform it:

  • Substitute: replace circles with text characters, lines with gradients
  • Combine: merge two patterns (flow field + voronoi)
  • Adapt: apply a 2D pattern to a 3D projection
  • Modify: exaggerate scale, warp the coordinate space
  • Purpose: use a physics sim for typography, a sorting algorithm for color
  • Eliminate: remove the grid, remove color, remove symmetry
  • Reverse: run the simulation backward, invert the parameter space
Distance Association
  1. Anchor on the user's concept (e.g., "loneliness")
  2. Generate associations at three distances:
    • Close (obvious): empty room, single figure, silence
    • Medium (interesting): one fish in a school swimming the wrong way, a phone with no notifications, the gap between subway cars
    • Far (abstract): prime numbers, asymptotic curves, the color of 3am
  3. Develop the medium-distance associations — they're specific enough to visualize but unexpected enough to be interesting

© Tommy-yw, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 14 other files (scripts, references) in skills/creative/p5js of Tommy-yw/RunbookHermes.

  • SKILL.md
  • README.md
  • references/animation.md
  • references/color-systems.md
  • references/core-api.md
  • references/interaction.md
  • references/shapes-and-geometry.md
  • references/troubleshooting.md
  • references/typography.md
  • references/visual-effects.md
  • references/webgl-and-3d.md
  • scripts/render.sh
  • scripts/serve.sh
  • scripts/setup.sh
  • templates/viewer.html

Open the folder on GitHubat commit 7fd2b9a

Used in 1 other repository

We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in Tommy-yw/RunbookHermes, which our catalogue first saw on October 7, 2026.

Compare with similar skills

P5js next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

P5js compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
P5js this skillTommy-yw/RunbookHermes5461 repos~6.8kAutomated safety check: PassMIT
Painted Animationtuzhechen2005/opus-video-skills1461 repos~1.9kAutomated safety check: PassCustom licence
Kinetic Reeltuzhechen2005/opus-video-skills146—~1.8kAutomated safety check: PassCustom licence
Prismer P5jsPrismer-AI/PrismerCloud1.6k3 repos~6.9kAutomated safety check: PassMIT
Scenario Kinetic Music Videoscenario-labs/skills946—~4kAutomated safety check: PassMIT
Video Shader Generator0xsline/OpenChatCut2.2k1 repos~3.2kAutomated safety check: PassAGPL-3.0

Similar skills

  • Painted Animation

    tuzhechen2005/opus-video-skills

    Make hand-painted watercolour-and-ink cartoon videos (MP4) with code — p5.js + p5.brush rendered frame by frame in headless Chrome, encoded with ffmpeg — starring Clawd or any character.

    146 GitHub starsUsed in 1 repo~1.9k tokens
    Media & CreativeAuto-check passed
  • Kinetic Reel

    tuzhechen2005/opus-video-skills

    Make kinetic-typography motion reels (MP4) in code: showreels, portfolio or work reels, product promos, intro films, "motion design"-style videos with bold condensed type, HUD micro-type…

    146 GitHub stars~1.8k tokensUpdated 13 days ago
    Media & CreativeAuto-check passed
  • Prismer P5js

    Prismer-AI/PrismerCloud

    p5.js sketches: gen art, shaders, interactive, 3D. An agent skill from Prismer-AI/PrismerCloud.

    1.6k GitHub starsUsed in 3 repos~6.9k tokens
    Media & CreativeAuto-check passed
  • Scenario Kinetic Music Video

    scenario-labs/skills

    A skill your agent uses when turning a song into a kinetic-typography or motion-design music video, lyric video, visualizer or K-pop style MV with Scenario, landscape or vertical 9:16 for TikTok…

    946 GitHub stars~4k tokensUpdated today
    Media & CreativeAuto-check passed
  • Video Shader Generator

    0xsline/OpenChatCut

    Generates WebGL shaders for video effects, transitions, masks and color grades in the OpenChatCut editor, trying built-in catalog effects such as zoom before making anything new.

    2.2k GitHub starsUsed in 1 repo~3.2k tokens
    Media & CreativeAuto-check passed
  • Anidoodle

    alexgreensh/anidoodle

    Code-drawn stills, drawing timelapses, films, explainers and interactive web animations in 31 styles, with composed scores.

    874 GitHub stars~2.7k tokensUpdated 5 days ago
    Media & CreativeAuto-check passed

More from Tommy-yw/RunbookHermes

All 38 skills in this repo
  • Fastmcp

    Tommy-yw/RunbookHermes

    Build, test, inspect, install, and deploy MCP servers with FastMCP in Python.

    546 GitHub starsUsed in 3 repos~2.1k tokens
    Auto-check passed
  • Drug Discovery

    Tommy-yw/RunbookHermes

    Pharmaceutical research assistant for drug discovery workflows.

    546 GitHub starsUsed in 1 repo~2.3k tokens
    Auto-check passed
  • Youtube Content

    Tommy-yw/RunbookHermes

    Fetch YouTube video transcripts and transform them into structured content (chapters, summaries, threads, blog posts).

    546 GitHub starsUsed in 1 repo~785 tokens
    Auto-check passed
  • Oss Forensics

    Tommy-yw/RunbookHermes

    Supply chain investigation, evidence recovery, and forensic analysis for GitHub repositories.

    546 GitHub starsUsed in 3 repos~5k tokens
    Auto-check passed
  • Touchdesigner MCP

    Tommy-yw/RunbookHermes

    Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals.

    546 GitHub starsUsed in 2 repos~3.4k tokens
    Auto-check passed
  • 1password

    Tommy-yw/RunbookHermes

    Set up and use 1Password CLI (op). An agent skill from Tommy-yw/RunbookHermes.

    546 GitHub starsUsed in 1 repo~1.2k tokens
    Auto-check: notes

Questions about P5js

What does P5js do?

Production pipeline for interactive and generative visual art using p5.js. P5js is an agent skill from Tommy-yw/RunbookHermes.js.

When should I use P5js?

P5js fits situations like: users request: p5.js sketches; creative coding; interactive visualizations; canvas animations.

How do I install P5js in Claude Code?

Run `npx skills add Tommy-yw/RunbookHermes --skill p5js -a claude-code`. Or copy the skill folder (skills/creative/p5js in Tommy-yw/RunbookHermes) into .claude/skills/p5js in your project. Claude Code loads it when a task matches its description.

How do I install P5js in Codex?

Run `npx skills add Tommy-yw/RunbookHermes --skill p5js -a codex`. Or copy the skill folder (skills/creative/p5js in Tommy-yw/RunbookHermes) into .agents/skills/p5js in your project. Codex loads it when a task matches its description.

Can I use P5js in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Tommy-yw/RunbookHermes --skill p5js -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/p5js, .gemini/skills/p5js, .github/skills/p5js and .opencode/skills/p5js in your project.

What does P5js need to run?

Going by SKILL.md and its folder, P5js needs a shell for the scripts in its folder and the command-line tools its instructions call (python3, node, ffmpeg and bash). Our summary lists: Node.js; A Bash shell.

Does P5js access the network?

SKILL.md names 3 domains. In commands or code: cdnjs.cloudflare.com, unpkg.com and cdn.jsdelivr.net; the agent is likely to contact these when it follows the instructions. This is read from the text; nothing was executed.

Is P5js safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does P5js use?

P5js is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does P5js use?

About 6.8k tokens (SKILL.md is roughly 27k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 24k tokens, read only when the agent opens those files.

What are the alternatives to P5js?

Skills that share tags, products or a category with P5js: Painted Animation (tuzhechen2005/opus-video-skills, 146 stars), Kinetic Reel (tuzhechen2005/opus-video-skills, 146 stars), Prismer P5js (Prismer-AI/PrismerCloud, 1.6k stars) and Scenario Kinetic Music Video (scenario-labs/skills, 946 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains P5js?

Tommy-yw (a GitHub user) maintains it in Tommy-yw/RunbookHermes, which has 546 GitHub stars. The repository holds 38 skills in this directory. The repository was last updated on May 18, 2026.

Source: Tommy-yw/RunbookHermes on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.