### Run the example: scaffold, install, render still, gate, emit Source: https://github.com/alexgreensh/anidoodle/blob/main/plugins/anidoodle/skills/anidoodle/example/README.md Commands to set up and run the example. Requires the engine's scaffold tool and the example's modules importing ../core. The dead-air check needs a rendered MP4; without one it reports that and the other two bars still run. ```bash node /engine/tools/scaffold.mjs ~/study --example cd ~/study && npm install node tools/still.mjs mechanicalLepidoptera --out out/look.png node tools/gate.mjs mechanicalLepidoptera --mp4 out/mechanical-lepidoptera.mp4 node tools/emit.mjs mechanicalLepidoptera --out out/mechanical-lepidoptera.html ``` -------------------------------- ### Install optional sound pack and check scores with soundfetch.mjs and music.mjs Source: https://github.com/alexgreensh/anidoodle/blob/main/README.md Commands for managing the optional sound pack and checking scores. Run soundfetch.mjs list to see the install directory and what is installed; run soundfetch.mjs get all to download the 373 MB pack, verify it by hash, and unpack (the agent will ask first). Run node tools/music.mjs check to validate a score's key/mode, loudness, masking, balance, and novelty before listening. ```bash node /engine/tools/soundfetch.mjs list # the install directory and what is installed node /engine/tools/soundfetch.mjs get all # download (373 MB), verify by hash, unpack; your agent asks you first ``` ```bash node tools/music.mjs check ``` -------------------------------- ### Sound pack management commands Source: https://github.com/alexgreensh/anidoodle/blob/main/plugins/anidoodle/skills/anidoodle/references/music/README.md Commands to list, download, decline, locate, verify, and remove sound pack components. The `get` command downloads and installs the pack, while `decline` remembers the user's refusal. `verify` re-hashes installed files, and `remove` drops a specific instrument or rooms. ```bash node tools/soundfetch.mjs list # the install directory and what is installed; no network node tools/soundfetch.mjs get harp rooms # the one command that downloads: hash, unpack, install (`all` = 373 MB) node tools/soundfetch.mjs decline # the user said no: remembered, nobody is asked again node tools/soundfetch.mjs where # the install directory node tools/soundfetch.mjs verify # re-hash every installed file node tools/soundfetch.mjs remove # drop one instrument, or `rooms` ``` -------------------------------- ### Install anidoodle in Claude Code Source: https://github.com/alexgreensh/anidoodle/blob/main/README.md Adds the anidoodle marketplace and installs the plugin in Claude Code. Run both commands in order. ```bash /plugin marketplace add alexgreensh/anidoodle /plugin install anidoodle@alexgreensh-anidoodle ``` -------------------------------- ### begin(g, f, z?) Source: https://github.com/alexgreensh/anidoodle/blob/main/skills/anidoodle/references/camera.md Starts the transform path for drawing in world coordinates. The camera rides the Gfx transform stack, so dirty boxes stay right. Pass the plane's z for parallax. ```APIDOC ## begin(g, f, z?) ### Description Starts the transform path for drawing in world coordinates. The camera rides the Gfx transform stack, so dirty boxes stay right. Pass the plane's z for parallax. ### Parameters - **g** (Gfx) - Required - The graphics context. - **f** (number) - Required - The current frame. - **z** (number) - Optional - Depth plane. Default 0 (hero plane). Positive z recedes; negative z crosses the lens. ### Example ```ts cam.begin(g, f); // hero plane meadow(g, f); cam.end(g); cam.begin(g, f, 2.2); // a farther plane hills(g, f); cam.end(g); ``` ``` -------------------------------- ### Scaffold, render, gate, emit, and fetch sounds Source: https://github.com/alexgreensh/anidoodle/blob/main/plugins/anidoodle/skills/anidoodle/SKILL.md Workflow for scaffolding a film project, installing dependencies, rendering a still and MP4, running the gate, emitting a self-contained player, and fetching the sound pack. The soundfetch commands require explicit user consent; the piano pack is 233 MB and the full pack 373 MB. ```bash node /engine/tools/scaffold.mjs ~/art --film intro --format 9x16 --duration 12 # seconds cd ~/art && npm install && npx playwright-core install chromium node tools/still.mjs intro --frame 0 --out out/look.png --scale 2 # a still, with its hash node tools/render.mjs intro # MP4; --out x.gif|x.webm|x.apng node tools/gate.mjs intro # determinism, contract, dead air node tools/emit.mjs intro --out out/intro.html # one self-contained offline player node /engine/tools/soundfetch.mjs list # no network. Nothing installed and not declined: ask the user now node /engine/tools/soundfetch.mjs get piano rooms # on their yes (piano 233 MB, all 373 MB). On no: soundfetch.mjs decline ``` -------------------------------- ### Launch film template usage (launchTemplate.ts) Source: https://github.com/alexgreensh/anidoodle/blob/main/plugins/anidoodle/skills/anidoodle/references/workflows/launch-video-kit.md Example of using makeLaunchFilm to define a launch film with title, asks, words, tagline, install lines, and score. ```ts import { C } from "./launchKit"; import { makeLaunchFilm } from "./launchTemplate"; import { dashboardSketch, onboardingSketch } from "./myProductPlates"; // drawn for YOUR subject import { myProductScore } from "./myProductScore"; // composed for YOUR brief import { myInbox } from "./myProductUI"; // YOUR product's UI, as data (productUI.ts) export const myLaunch = makeLaunchFilm({ title: "Your Product", subtitle: "the one line it lives by", asks: [ { prompt: "sketch my dashboard, as a print", plate: dashboardSketch, label: "print ยท drawn in code" }, { kind: "ui", ui: myInbox, prompt: "match every receipt" }, // the product's own UI, before -> after ], words: [[{ text: "IDEA IN.", style: "ink", color: C.ink }, { text: "ART OUT.", style: "ink", color: C.accent }]], tagline: "One sentence that says what it is", install: ["npm install your-product", "your-product init"], bpm: 96, // the tempo of the score you composed; the brief sets it, there is no default askBeats: 6, typeBeats: 4, endBeats: 8, claimBar: 4, score: myProductScore, // or null for a silent film }); ``` -------------------------------- ### Install anidoodle in Grok Build with --trust Source: https://github.com/alexgreensh/anidoodle/blob/main/README.md Adds the marketplace and installs the anidoodle plugin in Grok Build. The --trust flag confirms the install; without it, Grok shows what the plugin can run and stops. Alternatively, install from the Marketplace tab in /plugins. ```bash grok plugin marketplace add alexgreensh/anidoodle grok plugin install anidoodle --trust ``` -------------------------------- ### Scaffold and drive anidoodle engine Source: https://github.com/alexgreensh/anidoodle/blob/main/README.md Scaffolds a new art project and then drives the anidoodle engine directly. Requires Node 20 or newer; stills need only the browser installed by the scaffold, anything that moves also uses ffmpeg. The emit command writes one offline HTML file around 100 KB that plays the piece with sound on a double-click. ```bash node /engine/tools/scaffold.mjs ~/art --still hero --film intro --format 9x16 --duration 60 cd ~/art && npm install && npx playwright-core install chromium node tools/still.mjs hero --out out/hero.png --scale 2 # a finished illustration, print size node tools/render.mjs intro --out out/intro.gif # a loop; also .mp4 with score, .webm with alpha node tools/emit.mjs intro --out out/intro.html # the whole piece as one offline file node tools/gate.mjs hero # determinism, contract and dead air in one pass node tools/verify-export.mjs intro --file out/intro.mp4 # the file you ship, decoded and checked node tools/music.mjs check score.ts#myScore # your score: key, loudness, balance, novelty node tools/launch.mjs new myLaunch # a launch film spec; then: launch.mjs ship myLaunch ``` -------------------------------- ### productUI.ts - uiSettles and springLand Source: https://github.com/alexgreensh/anidoodle/blob/main/skills/anidoodle/references/workflows/launch-video-kit.md Get each item's landing frame and the frame any spring first reaches its target. ```APIDOC ## uiSettles and springLand ### Description `uiSettles` gives each item's landing frame and `springLand(t0, omega, zeta)` the frame any spring first reaches its target (where its sound goes). ### Functions - **uiSettles** - Returns each item's landing frame. - **springLand(t0, omega, zeta)** - Returns the frame a spring first reaches its target. ### Usage Use to determine landing frames for UI items. ``` -------------------------------- ### launchLayout.ts - launchLayout Source: https://github.com/alexgreensh/anidoodle/blob/main/skills/anidoodle/references/workflows/launch-video-kit.md Get a shape's whole composition and text role sizes, checked against phone-safe minimums. ```APIDOC ## launchLayout(shape, content) ### Description Gives a shape's whole composition (the chat geometry, the thread, the camera's rests, the word pages, the split columns, the end card, the caption band) and the size of every text role, checked against the phone-safe minimums (`MIN_PX`). `drawChatFrame`, `caretAt`, `inkDrop` and `inkCard` take its `chat` geometry; `chatGeom(rect, k, px, promptPx, lines)` is the same chat component at any size. ### Parameters - **shape** - Shape object. - **content** - Content object. ### Returns - Composition object with chat geometry, thread, camera rests, word pages, split columns, end card, caption band, and text role sizes. ### Usage Use to get layout for a shape. ``` -------------------------------- ### launchLayout.ts - chatGeom Source: https://github.com/alexgreensh/anidoodle/blob/main/skills/anidoodle/references/workflows/launch-video-kit.md Get chat geometry at any size. ```APIDOC ## chatGeom(rect, k, px, promptPx, lines) ### Description Same chat component at any size. ### Parameters - **rect** - Rectangle. - **k** - Scale factor. - **px** - Pixel size. - **promptPx** - Prompt pixel size. - **lines** - Number of lines. ### Returns - Chat geometry object. ### Usage Use to get chat geometry at any size. ``` -------------------------------- ### voices line from check/render Source: https://github.com/alexgreensh/anidoodle/blob/main/plugins/anidoodle/skills/anidoodle/references/music/README.md Example output line from check and render commands, showing which parts used recordings and which were modeled. ```plaintext voices recordings: lead (piano), accomp (piano.upright); modeled: bass (bass), drums (kick) ``` -------------------------------- ### Add anidoodle marketplace in Codex Source: https://github.com/alexgreensh/anidoodle/blob/main/README.md Adds the anidoodle marketplace in Codex. Then install the plugin from the Codex TUI by navigating to /plugins. ```bash codex plugin marketplace add alexgreensh/anidoodle ``` -------------------------------- ### Camera constructor Source: https://github.com/alexgreensh/anidoodle/blob/main/skills/anidoodle/references/camera.md Constructor for the Camera class. Creates a camera that animates through keyframes over a frame range. The camera is a pure function of the frame, so the same camera question gets the same answer on any machine, in any order. ```APIDOC ## Camera ### Description Creates a camera that animates through keyframes over a frame range. The camera is a pure function of the frame, so the same camera question gets the same answer on any machine, in any order. ### Constructor `new Camera(centre, keys, opts?)` ### Parameters - **centre** (array of two numbers) - Required - The centre of the frame, e.g. `[W / 2, H / 2]`. - **keys** (array of key objects) - Required - Keyframes defining the camera path. Each key has: - **f** (number) - Required - Frame number. - **look** (array of two numbers) - Required - World coordinates the camera looks at. - **zoom** (number) - Required - Zoom level. - **ease** (string) - Optional - Easing for the segment this key LEAVES. Default `"inout"` (easeInOutCubic). Other options: `"linear"`, `"out"`, `"in"`. - **opts** (object) - Optional - Options: - **monoZoom** (boolean) - Optional - If true, run one monotone cubic through all zoom keys in log2 space. - **path** (function) - Optional - A function `(f) => ({ look, zoom })` to define an authored path instead of keys. ### Example ```ts const cam = new Camera([W / 2, H / 2], [ { f: 0, look: [400, 300], zoom: 1, ease: "inout" }, { f: 90, look: [900, 300], zoom: 2 }, { f: 150, look: [900, 300], zoom: 2 }, { f: 240, look: [400, 300], zoom: 1 }, ]); ``` ``` -------------------------------- ### launchSound.ts - mixLaunch/launchAudio Source: https://github.com/alexgreensh/anidoodle/blob/main/skills/anidoodle/references/workflows/launch-video-kit.md Place cues from the sfx kit, pan each by screen x, duck the score, raise buried cues, and hold the mix under -1 dBTP. ```APIDOC ## mixLaunch/launchAudio ### Description Place cues from the sfx kit (`music/sfx`), pan each by its screen x (`panOf`), duck the score, raise a buried cue until it is heard, and hold the mix under -1 dBTP. ### Functions - **mixLaunch** - Mixes launch audio. - **launchAudio** - Places audio cues. - **panOf** - Pans by screen x. ### Usage Use to mix launch audio. ``` -------------------------------- ### launchKit.ts - Camera Utilities Source: https://github.com/alexgreensh/anidoodle/blob/main/skills/anidoodle/references/workflows/launch-video-kit.md Camera utilities: Cam, camLerp, useCam, toScreen. For longer camera work, see references/camera.md. ```APIDOC ## Camera Utilities ### Description Provides camera utilities: `Cam`, `camLerp` (zoom travels in log space), `useCam`, and `toScreen`. For longer camera work, see `references/camera.md`. ### Functions - **Cam** - Camera object. - **camLerp** - Camera lerp with zoom in log space. - **useCam** - Hook/function to use camera. - **toScreen** - Convert world coordinates to screen coordinates. ### Usage Use these utilities for camera control in launch films. ``` -------------------------------- ### launchGallery.ts Source: https://github.com/alexgreensh/anidoodle/blob/main/plugins/anidoodle/skills/anidoodle/references/workflows/launch-video-kit.md Gallery wall rendering with growing focus card. ```APIDOC ## launchGallery.ts ### Description Provides a rolling wall of style cards where the focus card grows toward the viewer. ### Functions - `drawWall` - Draw the wall. - `wallCam` - Camera for the wall. ### Notes - The proof-of-range beat. ``` -------------------------------- ### end(g) Source: https://github.com/alexgreensh/anidoodle/blob/main/skills/anidoodle/references/camera.md Ends the transform path started by `begin`. Restores the graphics context. ```APIDOC ## end(g) ### Description Ends the transform path started by `begin`. Restores the graphics context. ### Parameters - **g** (Gfx) - Required - The graphics context. ### Example ```ts cam.begin(g, f); meadow(g, f); cam.end(g); ``` ``` -------------------------------- ### Create a camera with keyframed move and shake Source: https://github.com/alexgreensh/anidoodle/blob/main/plugins/anidoodle/skills/anidoodle/references/camera.md Constructs a Camera with a center and keyframes for look, zoom, and easing. The ease property governs the segment the key leaves. Shake registers an impact with amplitude in screen pixels and rotation in radians. ```ts import { Camera } from "./camera"; const cam = new Camera([W / 2, H / 2], [ { f: 0, look: [400, 300], zoom: 1, ease: "inout" }, // ease governs the segment this key LEAVES { f: 90, look: [900, 300], zoom: 2 }, { f: 150, look: [900, 300], zoom: 2 }, // a hold: say it, don't imply it { f: 240, look: [400, 300], zoom: 1 }, ]); cam.shake({ from: 96, to: 126, amp: 14, seed: 7, rot: 0.004 }); // an impact, ringing down ``` -------------------------------- ### Render a style module and the style gallery Source: https://github.com/alexgreensh/anidoodle/blob/main/skills/anidoodle/references/styles.md Render a single style module (koi) to a PNG, or render the whole style gallery sheet. The first command outputs to out/koi.png; the second renders the full sheet of all nine styles. ```shell node tools/still.mjs koi --out out/koi.png ``` ```shell node tools/still.mjs styleGallery ``` -------------------------------- ### Check, stems, and render commands for music.mjs Source: https://github.com/alexgreensh/anidoodle/blob/main/plugins/anidoodle/skills/anidoodle/references/music/styles/lofi-electronic.md Three CLI commands for the music.mjs tool: check runs the full gate including stems, stems shows the stem table while balancing, and render produces an output MP3 with stems. Use these to verify and export a composition. ```bash node tools/music.mjs check .ts# # the whole gate, stems included node tools/music.mjs stems .ts# # the stem table alone, while you balance node tools/music.mjs render .ts# out.mp3 --stems ``` -------------------------------- ### Ship with QA gate using launch.mjs Source: https://github.com/alexgreensh/anidoodle/blob/main/plugins/anidoodle/skills/anidoodle/references/workflows/launch-video.md Runs the full QA gate for every shape shipped: framecheck, the gate (determinism, contract, dead air), and verify-export --delivery. Writes the poster and captions. Add --first-frame #rrggbb for a brand colour. ```bash launch.mjs ship --shapes ... --gate ``` -------------------------------- ### Emit, gate, record commands (CLI) Source: https://github.com/alexgreensh/anidoodle/blob/main/plugins/anidoodle/skills/anidoodle/references/workflows/interactive.md Commands to emit the interactive HTML and module, replay it to a JSON file, and record it to an MP4. The .mjs is the module for real sites, while the .html inlines it for file:// compatibility. ```bash node tools/emit-interactive.mjs myPiece --page page.html --out out/my-piece.html # also writes out/my-piece.mjs node tools/replay.mjs out/my-piece.html --out out/my-piece.replay.json node tools/record-interactive.mjs out/my-piece.html choreo.mjs --out out/my-piece.mp4 ``` -------------------------------- ### List music vocabulary styles Source: https://github.com/alexgreensh/anidoodle/blob/main/plugins/anidoodle/skills/anidoodle/references/music/compose.md Run the music tool to list vocabulary styles. The first command shows all styles; the second filters by a specific style name. ```shell node tools/music.mjs vocab ``` ```shell node tools/music.mjs vocab