/web-ai-skills:webnnfrom web-ai-skills
Implements and debugs browser Web Neural Network API (WebNN) integrations in JavaScript/TypeScript web apps. Handles navigator.ml checks, MLContext creation, MLGraphBuilder flows, device selection, tensor dispatch, and fallback paths to ONNX Runtime Web.
Ships in web-ai-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Step 1: Identify the browser integration surface
node scripts/find-webnn-targets.mjs . to inventory likely frontend files and existing WebNN markers when a Node runtime is available.package.json, HTML entry point, framework bootstrap files, and worker entry files manually to identify the browser app boundary.Step 2: Confirm WebNN viability and choose the runtime shape
references/webnn-reference.md before writing code.references/examples.md when choosing between a direct WebNN graph flow and an adapter around an existing browser ML runtime.references/compatibility.md when native support, preview flags, device behavior, or backend differences matter.references/troubleshooting.md when context creation, graph build, tensor readback, or device selection fails.Window or Worker context (DedicatedWorker, SharedWorker, or ServiceWorker), and that the webnn Permissions Policy feature is allowed when running inside a cross-origin iframe.powerPreference: "high-performance" for throughput, powerPreference: "low-power" for power-efficient acceleration, or accelerated: false to prefer CPU inference for maximum reach.accelerated and powerPreference as preferences, not guarantees. Browser backends can still partition graphs or fall back per operator.MLGraphBuilder flow when the application owns graph construction or can keep a small deterministic graph path.Step 3: Implement a guarded runtime adapter
assets/webnn-runtime.template.ts and adapt it to the framework, state model, and file layout in the workspace.window.isSecureContext, navigator.ml, and the requested execution context instead of scattering checks through UI components.MLContext only at the boundary where the app is ready to initialize local inference.accelerated and powerPreference values when the product has a real preference, and omit tuning that the product cannot justify.MLGraphBuilder when the feature uses direct WebNN operations, or route existing model execution through the app's existing local runtime adapter when that runtime is already responsible for model loading and pre/post-processing.context.writeTensor(), context.dispatch(), and await context.readTensor() in that order for direct graph execution.context.lost and rebuild the context, graph, and tensors if the browser invalidates the execution state.Step 4: Wire UX and fallback behavior
Step 5: Validate behavior
node scripts/find-webnn-targets.mjs . to confirm that the intended app boundary and WebNN markers still resolve to the edited integration surface.navigator.ml detection before debugging deeper runtime issues.accelerated and powerPreference settings and confirm that fallback behavior remains usable when an accelerated context cannot be created.context.opSupportLimits() when operator coverage or tensor data type support influences graph design.references/compatibility.md before treating runtime failures as application bugs.navigator.ml is missing, confirm secure-context requirements and browser support from references/compatibility.md before changing application code.createContext() fails for an accelerated or high-performance request, retry only through the product's approved fallback plan and surface the failure reason.build() or dispatch() fails, check references/examples.md and references/troubleshooting.md for operator, shape, and device mismatches before rewriting the feature.context.lost resolves, treat the current context, graph, and tensors as invalid and recreate them before the next inference attempt.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
webnn, browser-ml, neural-network-api, client-side-inference
web-ai-skills@webmaxru-ai-native-dev is listed by webmaxru/ai-native-dev — review the source before installing
npx claudepluginhub webmaxru/ai-native-dev --plugin web-ai-skills7 skills in this plugin
/language-detector-apiImplements and debugs browser Language Detector API integrations in JavaScript or TypeScript web apps. Use when adding LanguageDetector support checks, availability and model download flows, session creation, detect() calls, input-usage measurement, permissions-policy handling, or compatibility fallbacks for built-in language detection. Don't use for server-side language detection SDKs, cloud translation services, or generic NLP pipelines./prompt-apiImplements and debugs browser Prompt API integrations in JavaScript or TypeScript web apps. Use when adding LanguageModel availability checks, session creation, prompt or promptStreaming flows, structured output, download progress UX, or iframe permission-policy handling. Don't use for server-side LLM SDKs, REST AI APIs, or non-browser providers./proofreader-apiImplements and debugs browser Proofreader API integrations in JavaScript or TypeScript web apps. Use when adding Proofreader availability checks, monitored model downloads, proofread flows, correction metadata handling, or permissions-policy checks for built-in proofreading. Don't use for generic prompt engineering, server-side LLM SDKs, or cloud AI services./translator-apiImplements and debugs browser Translator API integrations in JavaScript or TypeScript web apps. Use when adding Translator support checks, language-pair availability flows, model download UX, session creation, translate() or translateStreaming() calls, input-usage measurement, or permissions-policy handling for on-device translation. Don't use for server-side translation SDKs, cloud translation services, or generic multilingual content pipelines./webmcpImplements and debugs browser WebMCP integrations in JavaScript or TypeScript web apps. Use when exposing imperative tools through document.modelContext (with a navigator.modelContext fallback), annotating HTML forms for declarative tools, handling agent-invoked form flows, or validating WebMCP behavior in the current Chrome preview. Don't use for server-side MCP servers, REST tool backends, or non-browser providers./writing-assistance-apisImplements and debugs browser Summarizer, Writer, and Rewriter integrations in JavaScript or TypeScript web apps. Use when adding availability checks, model download UX, session creation, summarize or write or rewrite flows, streaming output, abort handling, or permissions-policy constraints for built-in writing assistance APIs. Don't use for generic prompt engineering, server-side LLM SDKs, or cloud AI services.Other plugins' skills for the same job