webnn
Implements and debugs browser Web Neural Network API integrations in JavaScript or TypeScript web apps. Use when adding navigator.ml checks, MLContext creation, MLGraphBuilder flows, device selection, tensor dispatch and readback, or explicit fallback paths to ONNX Runtime Web or other local runtimes. Don't use for model training, server-side ML inference, or cloud AI APIs.
What this skill does
# WebNN ## Procedures **Step 1: Identify the browser integration surface** 1. Inspect the workspace for browser entry points, UI handlers, worker entry files, and any existing model-loading or inference abstraction layer. 2. Execute `node scripts/find-webnn-targets.mjs .` to inventory likely frontend files and existing WebNN markers when a Node runtime is available. 3. If a Node runtime is unavailable, inspect the nearest `package.json`, HTML entry point, framework bootstrap files, and worker entry files manually to identify the browser app boundary. 4. If the workspace contains multiple frontend apps, prefer the app that contains the active route, component, or user-requested feature surface. 5. If the inventory still leaves multiple plausible frontend targets, stop and ask which app should receive the WebNN integration. 6. If the project is not a browser web app, stop and explain that this skill does not apply. **Step 2: Confirm WebNN viability and choose the runtime shape** 1. Read `references/webnn-reference.md` before writing code. 2. Read `references/examples.md` when choosing between a direct WebNN graph flow and an adapter around an existing browser ML runtime. 3. Read `references/compatibility.md` when native support, preview flags, device behavior, or backend differences matter. 4. Read `references/troubleshooting.md` when context creation, graph build, tensor readback, or device selection fails. 5. Verify that the feature runs in a secure context and in a `Window` or `Worker` context (`DedicatedWorker`, `SharedWorker`, or `ServiceWorker`). 6. If the feature must run on the server, train models, or depend on cloud inference, stop and explain the platform mismatch. 7. Choose device intent deliberately: use `powerPreference: "high-performance"` for throughput, `powerPreference: "low-power"` for power-efficient acceleration, or `accelerated: false` to prefer CPU inference for maximum reach. 8. Treat `accelerated` and `powerPreference` as preferences, not guarantees. Browser backends can still partition graphs or fall back per operator. 9. Choose a direct `MLGraphBuilder` flow when the application owns graph construction or can keep a small deterministic graph path. 10. Choose an adapter around an existing local runtime only when the application already loads models through that runtime and the task is to prefer WebNN acceleration without rewriting the full inference stack. 11. If the project uses TypeScript, add or preserve typings for the WebNN surface used by the project. **Step 3: Implement a guarded runtime adapter** 1. Read `assets/webnn-runtime.template.ts` and adapt it to the framework, state model, and file layout in the workspace. 2. Centralize support detection around `window.isSecureContext`, `navigator.ml`, and the requested execution context instead of scattering checks through UI components. 3. Create an `MLContext` only at the boundary where the app is ready to initialize local inference. 4. Pass explicit `accelerated` and `powerPreference` values when the product has a real preference, and omit tuning that the product cannot justify. 5. Build the graph through `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. 6. Reuse the compiled graph and reusable tensors when input and output shapes stay stable across requests. 7. Use `context.writeTensor()`, `context.dispatch()`, and `await context.readTensor()` in that order for direct graph execution. 8. Observe `context.lost` and rebuild the context, graph, and tensors if the browser invalidates the execution state. 9. Destroy tensors, graphs, and contexts when the feature is disposed or the route no longer needs them. **Step 4: Wire UX and fallback behavior** 1. Surface distinct states for unsupported browsers, secure-context failures, runtime preparation, ready native execution, and explicit fallback execution. 2. Keep a non-WebNN path for unsupported browsers or unsupported devices when the feature must remain available. 3. Keep the fallback explicit and product-approved. Do not silently swap in a remote model provider when the feature is supposed to stay local. 4. Present device choice as an intent, not a promise that every operator will execute on that device. 5. Move long-running model preparation or repeated inference off the main thread when the application already uses a worker-friendly architecture. 6. Keep all user data handling consistent with the product's local-processing promises and privacy requirements. **Step 5: Validate behavior** 1. Execute `node scripts/find-webnn-targets.mjs .` to confirm that the intended app boundary and WebNN markers still resolve to the edited integration surface. 2. Verify secure-context and `navigator.ml` detection before debugging deeper runtime issues. 3. For direct WebNN paths, run a smoke test that creates a context, builds a trivial graph, writes inputs, dispatches, and reads outputs. 4. Test the intended `accelerated` and `powerPreference` settings and confirm that fallback behavior remains usable when an accelerated context cannot be created. 5. Use `context.opSupportLimits()` when operator coverage or tensor data type support influences graph design. 6. Confirm the app does not reuse destroyed tensors, graphs, or contexts. 7. If the target environment depends on preview Chromium flags or milestone-specific behavior, confirm the required browser state from `references/compatibility.md` before treating runtime failures as application bugs. 8. Run the workspace build, typecheck, or tests after editing. ## Error Handling * If `navigator.ml` is missing, confirm secure-context requirements and browser support from `references/compatibility.md` before changing application code. * If `createContext()` fails for an accelerated or high-performance request, retry only through the product's approved fallback plan and surface the failure reason. * If `build()` or `dispatch()` fails, check `references/examples.md` and `references/troubleshooting.md` for operator, shape, and device mismatches before rewriting the feature. * If `context.lost` resolves, treat the current context, graph, and tensors as invalid and recreate them before the next inference attempt. * If the product only has a remote inference contract, stop and explain that this skill does not directly apply.
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.