agentsclimarketplace

Juce review

Skill kunitoki/sonic-skills/skills/juce-review

Modular Markdown-based audio skills for AI agents and developers, covering signal processing, synthesis, effects, analysis, and spatial audio.

Install
npx -y skills add kunitoki/sonic-skills --skill juce-review

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 14 stars14 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Reviews JUCE audio plugin code for JUCE-specific correctness issues: thread safety, APVTS parameter patterns, MessageManager usage, ValueTree, and MIDI handling. Use when the user asks to review a JUCE plugin, check a processBlock, audit parameter handling, or asks "is this JUCE code safe?". Trigger on phrases like "review my JUCE plugin", "check my AudioProcessor", "is this APVTS usage correct?", or when you see AudioProcessor, AudioProcessorEditor, or AudioProcessorValueTreeState in the code.

SKILL.md

4.8 KB, as published. Nobody here has run it

JUCE Audio Plugin Review

JUCE abstractions hide thread boundaries — always trace which thread each piece of code runs on before declaring it safe.

Step 0 — Run universal checks first

Invoke audio-dsp-review and audio-numerics-review before this skill. This skill adds JUCE-specific checks on top; it does not replace realtime-safety or numerics reviews.

Step 1 — Identify plugin structure

Locate the three core classes and their thread ownership:

  • AudioProcessor — audio thread owns processBlock; message thread owns everything else
  • AudioProcessorEditor — message thread only; never call from audio thread
  • AudioProcessorValueTreeState — parameter tree lives on message thread; audio thread must use getRawParameterValue() raw pointers only

Step 2 — Scan for JUCE violations

ViolationWhere to lookRisk
juce::String construction/concatenationprocessBlock, DSP helpersMay allocate and may touch shared string/logging machinery; realtime unsafe
DBG() macroAny audio-thread codeLogger I/O in debug builds; blocks indefinitely
MessageManager::getInstance() from audio threadAudio callbacks, DSP helpersNot thread-safe; undefined behaviour
apvts.getParameter(...) or apvts.state from audio threadprocessBlock and DSP helpersAPVTS/ValueTree access is not an audio-thread data path; use raw pointer cache instead
ValueTree listener callbacks assumed on audio threadListener overridesDispatched via MessageManager; runs on message thread
AudioBuffer::setSize() inside processBlockBuffer management codeTriggers allocation; causes xrun
Modifying MIDI buffer while iterating itMIDI event loopsIterator invalidation; undefined behaviour
prepareToPlay not resetting all state (e.g. filters, envelopes, delay lines)prepareToPlay bodyDouble-call leaves stale state; causes audio artefacts
juce::CriticalSection::tryEnter() or enter() on audio threadprocessBlock, DSP helpersexit()/destructor does a syscall to wake waiting threads — not realtime-safe even with tryEnter()
juce::SpinLock::enter() on audio threadprocessBlock, DSP helpersBusy-waits on audio thread — use tryEnter() + fallback only; non-audio thread should use progressive back-off

Step 3 — Write the review

## JUCE Plugin Review: `[file / class]`

### Verdict
[Safe | Has critical violations | Warnings only] — [one sentence summary]

### Critical Violations
**[Category]: [description]**
`file:line` — `offending code`
Why: [one sentence on thread / correctness risk]
Fix: [concrete JUCE-idiomatic suggestion]

### Warnings
[same format]

### What's Done Well
[correct patterns observed]

### Recommended Fixes (priority order)
1. ...

Quick fix table

ViolationFix
juce::String in processBlockPre-format on message thread; pass IDs/scalars via AbstractFifo or atomics
DBG() in audio codeRemove entirely or gate behind a lock-free ring buffer drained on message thread
MessageManager from audio threadUse juce::MessageManager::callAsync from message thread only
apvts.getParameter(id) in audio threadCache getRawParameterValue(id) once after APVTS construction; read atomically in processBlock
ValueTree listener on audio threadHandle listener callbacks on message thread; pass state to audio thread via atomics
AudioBuffer::setSize() in processBlockCall only in prepareToPlay; never resize during playback
Mutating MIDI buffer mid-iterationCollect into a preallocated member buffer or bounded event array, then swap/write back after iteration
Missing state reset in prepareToPlayReset filters, envelopes, delay lines, and position counters unconditionally
CriticalSection::tryEnter() in audio threadReplace with std::atomic<T> or lock-free SPSC queue; tryEnter() + exit() is not safe because exit() does a syscall
SpinLock::enter() on audio threadUse tryEnter() + fallback only; non-audio thread should use progressive back-off (see references/juce-violations.md Section 4)

For full code examples (BAD/GOOD patterns, AbstractFifo usage, async dispatch) see references/juce-violations.md.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.