agentsclimarketplace

Clap review

Skill kunitoki/sonic-skills/skills/clap-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 clap-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 CLAP plugin implementations for spec compliance, thread safety, and correctness. Use when the user asks to review a CLAP plugin, audit a CLAP extension, or check whether their process() callback follows the CLAP threading model. Trigger on phrases like "review my CLAP plugin", "check CLAP extension", "is my CLAP process() safe", "audit my clap_plugin_t", or when you see clap_plugin_t, clap_process_t, or CLAP extension structs in the code.

SKILL.md

4.8 KB, as published. Nobody here has run it

CLAP Plugin Review

CLAP's threading model is explicit by design — every host method and extension entry point is tagged with a thread requirement. Violations are silent at compile time and often only surface under specific host implementations.

Step 0 — Run universal checks first

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

Step 1 — Identify plugin structure

Locate and characterize the plugin's registered interfaces:

ItemWhat to check
clap_plugin_tprocess, activate, deactivate, start_processing, stop_processing implemented
Extensions returned by get_extensionWhich of: audio-ports, params, state, gui, note-ports, log, timer-support, posix-fd-support
Host extensions queried in initWhich host callbacks are cached; which thread they may be called from
clap_plugin_descriptor_tid is stable and reverse-DNS formatted; features declared correctly

Step 2 — Scan for CLAP-specific violations

ViolationWhereRisk
Holding clap_event_* pointer after callback returnsprocess()Use-after-free — events are host-owned, lifetime ends when process() returns
Calling a host method from the wrong thread contextaudio↔main boundarySpec violation — obey each method's [main-thread], [audio-thread], or [thread-safe] tag
State save/restore doing I/O on wrong threadsave/load in state extensionThread safety violation — state methods run on main thread, not audio thread
Extension methods not guarded by thread_checkany extension handlerData race — extensions have per-method thread requirements; check each one
process() returning wrong clap_process_statusprocess()Host misinterprets plugin state — CLAP_PROCESS_SLEEP vs CLAP_PROCESS_CONTINUE affects scheduling
Param IDs not stable across save/load cyclesparams extensionBroken parameter recall — param IDs must be stable for the lifetime of the plugin ID
Audio port channel counts mismatched at runtime vs declaredaudio-ports extensionBuffer overread/underwrite — host allocates buffers based on declared port config
Calling host params->request_flush() from process()params extensionSpec violation — request_flush is [thread-safe, !audio-thread]; emit output events during process() instead
Querying plugin extensions before plugin->init()host/plugin setupSpec violation — get_extension() is forbidden before init, but allowed during and after init
Not handling CLAP_EVENT_TRANSPORT when transport-awareprocess()Incorrect playback position — transport events must be consumed each process call

Step 3 — Write the review

## CLAP Plugin Review: `[file / plugin id]`

### Verdict
[Spec-compliant | Has critical violations | Warnings only] — [one sentence summary]

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

### Warnings
[same format]

### What's Done Well
[correct patterns — proper event copying, thread_check guards, correct status codes, etc.]

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

Quick fix table

ViolationFix
Storing clap_event_* pointerCopy the event struct by value before process() returns
Host call from wrong threadUse only methods allowed for the current thread, or queue host->request_callback() and handle main-thread work in on_main_thread()
Wrong clap_process_statusReturn CLAP_PROCESS_SLEEP only when all voices are done; CLAP_PROCESS_CONTINUE otherwise
Unstable param IDsUse a fixed enum or stable hash derived from param name, never an index
Port count mismatchValidate audio_inputs_count / audio_outputs_count in process() against declared ports
Missing thread_check guardWrap host calls with host_thread_check->is_main_thread(host) before calling

For the full CLAP audit checklist organized by extension, threading rules, and BAD/GOOD code patterns see references/clap-spec-checklist.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.