/web-ai-skills:translator-apifrom web-ai-skills
Implements and debugs browser Translator API integrations in JS/TS web apps. Use for on-device translation support checks, language-pair availability, model download UX, session creation, translate calls, and permissions-policy handling.
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-translator-targets.mjs . to inventory likely frontend files and existing Translator API markers when a Node runtime is available.package.json, HTML entry point, and framework bootstrap files manually to identify the browser app boundary.Step 2: Confirm API viability and choose the integration shape
references/translator-reference.md before writing code.references/examples.md when the feature needs a session wrapper, download-progress UI, streaming output, cancellation, or cleanup shape.references/compatibility.md when preview flags, browser channels, iframe rules, or environment constraints matter.references/troubleshooting.md when support checks, session creation, translation, or cleanup fail.Window context.translator permissions-policy feature.Translator.create() for a fixed language pair and full-result translationcreate() when the UI must surface model download progresstranslateStreaming() when the UI should reveal translated output incrementallymeasureInputUsage() when quota or input-size budgeting affects the flowStep 3: Implement a guarded translator session
assets/translator-session.template.ts and adapt it to the framework, state model, and file layout in the workspace.globalThis.isSecureContext, Translator, and the same sourceLanguage and targetLanguage shape the feature will use at runtime.Translator.availability() using the same language pair that will be passed to Translator.create().availability() as a capability check, not a guarantee that creation will succeed without download time, policy approval, or user activation.monitor option during create() when the product needs download progress.AbortController for cancelable create(), translate(), translateStreaming(), or measureInputUsage() calls, and call destroy() when the session is no longer needed.sourceLanguage or targetLanguage after creation; session options are fixed per instance.allow="translator".Step 4: Wire UX and fallback behavior
translate() when downstream logic needs the full result before continuing, and use translateStreaming() when the UI should reveal translated text incrementally.measureInputUsage() when large inputs can exceed session quota.Step 5: Validate behavior
node scripts/find-translator-targets.mjs . to confirm that the intended app boundary and Translator API markers still resolve to the edited integration surface.Translator feature detection, and availability() behavior before debugging deeper runtime failures.create() plus translate() flow with representative user text for the target language pair.translateStreaming() separately and confirm partial output stops cleanly on abort.measureInputUsage() behavior before sending large input.references/compatibility.md before treating failures as application bugs.Translator is missing, keep a non-AI fallback and confirm secure-context, browser, channel, and flag requirements before changing product logic.availability() returns downloadable or downloading, require user-driven session creation before promising that translation is ready.create() throws NotAllowedError, check permissions-policy constraints, missing user activation for downloads, browser policy restrictions, or user rejection.create() throws OperationError, treat model initialization as failed and retry only after checking browser state, required flags, and download readiness.QuotaExceededError, reduce the input size or measure usage before retrying.NotReadableError or UnknownError, surface a visible fallback instead of retrying blindly with the same input.assets/translator-session.template.ts (opens in a new tab)references/compatibility.md (opens in a new tab)references/examples.md (opens in a new tab)references/translator-reference.md (opens in a new tab)references/troubleshooting.md (opens in a new tab)scripts/find-translator-targets.mjs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
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./Other plugins' skills for the same job