agentleFS
SpeakingColorsSpeakingColors/claude-skills/skills/juce-headless-test-snapshot/SKILL.md

juce-headless-test-snapshot

Skill0 starsChanged 23 days agoMITView on GitHub

Use to test a JUCE plugin without a DAW or screen: console-app processor tests, parameter and thread gotchas, offscreen editor snapshot to PNG with xvfb, crash backtraces, CI steps.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Add a juce_add_console_app target that compiles the processor .cpp with JUCE_STANDALONE_APPLICATION=1 and a macro such as MEOW_NO_EDITOR …

    line 11
  2. Distinctive:

    Test: record now, record on input (silence first), pre-roll length, append take, edit then undo, playback output magnitude, WAV round trip, …

    line 14
  3. Distinctive:

    Start offsets matter: a take that begins with pre-roll silence has a silent first 10000 samples.

    line 15
  4. Very specific:

    Use JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR and run the test under ASan/UBSan in CI when the engine is pure C++ too.

    line 17

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Headless JUCE plugin tests and editor snapshots

Companion to juce-expert and plugin-ship-checklist. Labels: MEASURED (a recorder/editor plugin, Linux, JUCE 8.0.16), UNVERIFIED.

Processor tests (no window)

  • Add a juce_add_console_app target that compiles the processor .cpp with JUCE_STANDALONE_APPLICATION=1 and a macro such as MEOW_NO_EDITOR that makes hasEditor() false. Call prepareToPlay, then processBlock on 10 ms buffers.
  • Helper threads need real time: sleep 2 ms per block and 40 ms at the end of a feed, or the worker has not run yet.
  • Set parameters with getParameter(id)->setValueNotifyingHost(convertTo0to1(v)). Writing through getRawParameterValue(id) does not update the ValueTree, so a state save/load round trip loses the value. MEASURED.
  • Test: record now, record on input (silence first), pre-roll length, append take, edit then undo, playback output magnitude, WAV round trip, state restore with garbage input ignored, preview then restore, count-in clicks then record.
  • Start offsets matter: a take that begins with pre-roll silence has a silent first 10000 samples; start playback checks after it. MEASURED.
  • State machines owned by two threads: a worker that recomputes the state after each drain overwrote the "count-in" state with "off". The test caught it. Compute the state from all the flags in one place. MEASURED.
  • Use JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR and run the test under ASan/UBSan in CI when the engine is pure C++ too.

Editor snapshot

  • A console app with ScopedJuceInitialiser_GUI, build the editor, setVisible(true), MessageManager::getInstance()->runDispatchLoopUntil(400), then createComponentSnapshot(getLocalBounds(), true, 1.0f) and write a PNG. Run it with xvfb-run -a. Pass arguments to open other views and selections.
  • Pass an ABSOLUTE output path: xvfb-run hid a relative path ("not found") on the first try. MEASURED.
  • Crash? xvfb-run -a gdb -batch -ex run -ex bt --args ./snapshot out.png. The backtrace pointed straight at a refresh call inside the constructor. MEASURED.
  • Compare with a Playwright screenshot of the mockup. Look at the image yourself; do not trust a passing build.

CI

  • Build, run the engine tests, run the processor test, upload the VST3 and standalone as artifacts. Add pluginval --strictness-level 5 (use --skip-gui-tests on headless runners) and sanitizer jobs. See plugin-ship-checklist.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.