AGENT SKILL

nodejs-server

Use Porcupine from Node.js server-side JavaScript or TypeScript for file and microphone wake-word detection.

License 许可
Apache-2.0
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
nodejs-server
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Use Porcupine from Node.js server-side JavaScript or TypeScript for file and microphone wake-word detection.
disable-model-invocation
true

02 资源文件 4

03 SKILL.md 正文

Porcupine Node.js Server Skill

Use this sub-skill when the task is to run Porcupine from Node.js 18+ in a server, CLI, Electron main-process, or other non-browser JavaScript/TypeScript runtime.

Route here for

  • Installing and importing @picovoice/porcupine-node.
  • Constructing new Porcupine(accessKey, keywords, sensitivities, options).
  • Choosing built-in keyword enum values versus custom .ppn keyword file paths.
  • Processing 16 kHz, 16-bit, mono PCM frames with process(frame) and calling release().
  • Listing inference devices with Porcupine.listAvailableDevices().
  • Building file-based WAV scanning or microphone capture workflows in Node.js.
  • Diagnosing native .node package loading, AccessKey, frame-shape, sensitivity, and lifecycle failures.

Route elsewhere

  • Browser, WebAssembly, React hooks, or browser microphone work: ../web-and-react/SKILL.md.
  • Custom keyword training, language model .pv selection, platform-specific .ppn assets, and Picovoice Console/API limits: ../custom-keywords-and-assets/SKILL.md.
  • Python CLI/API workflows: ../python-and-cli/SKILL.md.
  • C, MCU, mobile, JVM, .NET, Flutter, or React Native SDKs: the relevant sibling sub-skill.
  • Cross-cutting install/AccessKey/platform issues shared by every SDK: ../../references/troubleshooting.md.

First reads

  1. references/nodejs-api-reference.md for API signatures, built-in keyword names, options, exported helpers, package/build facts, and validation rules.
  2. references/nodejs-workflows.md for file WAV and microphone workflow recipes.
  3. references/troubleshooting.md before changing code around native loading, AccessKey, keyword arrays, PCM frames, or cleanup.
  4. scripts/porcupine_node_file_template.js when a safe starting point for a Node file-detection helper is useful.

Operating guardrails

  • Treat @picovoice/porcupine-node as a Node-only native package; do not use it in browser bundles.
  • Do not hard-code AccessKeys or require them for help, keyword listing, or device-listing tasks. An AccessKey is required only when constructing a Porcupine engine for detection.
  • Prefer BuiltinKeyword.<NAME> values for built-in English wake words. Use custom .ppn paths only for trained or non-bundled keyword models, and route asset/training decisions to custom-keywords-and-assets.
  • Keep every audio frame at handle.frameLength, handle.sampleRate, mono, 16-bit linear PCM. Use Int16Array in new code.
  • Always release the Porcupine handle in a finally block or shutdown handler; release microphone recorders separately.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351