Algorithmic Art
Create generative p5.js artwork with reproducible seeds and adjustable parameters.
npx skills add anthropics/skills --skill algorithmic-art What it does
A generative artwork needs an intentional visual system rather than arbitrary random shapes. Algorithmic Art connects a written creative direction to a parameterized, seed-controlled p5.js sketch.
What changes after install
- Develops an algorithmic visual concept before writing the sketch.
- Uses seeded randomness and parameters to make variations reproducible.
- Provides a viewer template for exploring and exporting the artwork.
Install
Run this command with Node.js 22.20 or later and select your agent in the Skills CLI.
npx skills add anthropics/skills --skill algorithmic-art Before using Algorithmic Art
- Use a browser that can run the p5.js artwork, and keep the upstream viewer template and generator guidance available to the agent.
Read the reviewed setup instructions for the selected workflow.
When to use it
- Creating original flow fields, particle systems, or other code-driven artwork.
- Exploring a family of visual variations while retaining a reproducible seed.
When not to use it
- Generating a photograph or reproducing an existing artist's work.
A worked example
“Create a generative composition inspired by tidal movement, with adjustable line density and a seed I can save.” Ask for a browser viewer in which a curator can return to one arrangement and compare it with a denser version. Use the slow movement of water around a headland as the reference. The curator is looking for different traces from one underlying process, not a random selection of finished illustrations.
- Describe the algorithmic idea before drawing. For this brief, several sets of lines could bend around a fixed shoreline and leave wider gaps on one side. Write down which relationships must survive every variation: the open water should remain distinguishable from the shore and a few broad channels should stay visible among the smaller traces.
- Open the supplied viewer template. Keep its seed controls, action buttons, sidebar organization and branding. Replace the artwork and parameter controls with ones that match the tidal idea. A density slider answers a specific question about the number of visible traces; a generic slider labeled “intensity” gives the curator little clue what should change.
- Build the composition in p5.js and seed both random choices and any noise field used to place the lines. Keep the starting conditions together. Rebuilding with a saved seed and the same parameters should begin from the same arrangement. A sketch that also uses an unseeded random call for its shoreline can move the coast even when the displayed seed stays fixed.
- Try one seed at three density settings. Give the lines room to separate at the lowest setting and follow a channel through the most crowded one. If changing density also regenerates the entire field, the curator is comparing two different coastlines. Decide which features the control should preserve and regenerate the sketch accordingly.
- Deliver the viewer with the algorithm included in the HTML as directed by the template. Record one promising seed together with its parameter values. A seed alone cannot recover the same print if the density, scale or drawing algorithm changes. Give the curator a short way to return to that combination before exploring the next variation.
Upstream instructions: SKILL.md and templates/viewer.html.
Troubleshooting
- Returning to a seed produces a different coastline. Look for random values assigned before seeding or state left over from the previous draw. Reset the seed and clear the old particles or paths when regenerating. Compare two fresh starts at the same parameters before interpreting a change as artistic variation.
- The viewer opens but the canvas is blank away from the studio network. Check how the HTML loads p5.js and whether that resource is available in the intended environment. Open the delivered file there and inspect the browser’s first loading error. A single HTML deliverable can still depend on a library loaded over the network.
- The density control makes the page stop responding. Try the same seed at the low and high ends and record which setting causes the delay. Limit the number of marks or the work done per redraw. Inspect the dense image after that change: reducing the workload can also erase the channels the curator wanted to keep.
How it chooses an approach
A repeated process and a few meaningful controls give the viewer a reason to explore. Pick the algorithm from the movement in the brief. Slowly bent traces, clustered deposits and a hard break at the headland suggest different rules. The example generator is useful for understanding where parameters and initialization belong. Its demonstration pattern need not become the subject of the finished piece.
Keep the viewer and the algorithm distinct. The template establishes how someone enters a seed or resets the work, leaving the parameters and composition open. A control for shoreline curvature belongs beside density if the curator needs to compare coastal shapes. A control for every internal constant can make the viewer difficult to navigate while exposing decisions the artist intended to keep stable.
For a static output selected from the viewer, write down the seed and parameters as a pair. For animation, establish which moment the curator wants to preserve as well. The same seed can describe the starting state without identifying a particular frame halfway through a drawing. A saved image gives the curator a reference if the algorithm is revised later.
When to use another skill
Choose Algorithmic Art for visual work produced through code when the viewer should be able to explore variations. Canvas Design is the more direct starting point for a static exhibition poster with fixed wording, margins and a single approved composition. If the curator selects one tidal print for that poster, pass along the chosen image, its seed and parameter settings together with the title and print dimensions.
What to check after it runs
- Enter a seed, note the density and regenerate. Change to another seed and return to the first with the original settings. Compare the bend at the headland and the position of one distinctive channel across the two renderings.
- Hold the seed fixed and move the density control from minimum to maximum. Check that the number of visible traces changes in the intended direction. At the highest setting, try another control and confirm it still responds while the image updates.
- Use the template’s reset and seed navigation controls. Compare the displayed values with the picture they produce, especially after entering a seed by hand. A label that still shows yesterday’s density can make an otherwise reproducible image impossible for a visitor to repeat.
- Open the delivered HTML in the intended browser environment. Inspect the canvas, operate the controls and save the chosen variation if the handoff calls for a still. Open that saved image separately and compare the edges and background with the actual viewer.
Related workflows
More in Design
FAQ
- Why does the skill use a seed?
- A seed helps recreate a selected variation and compare parameter changes without changing every random choice.
- Does it create only a static image?
- The upstream workflow centers on an interactive HTML viewer with a p5.js algorithm, while also supporting the artwork workflow around that viewer.