Implements 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.
76
96%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
—
The risk profile of this skill
Step 1: Identify the browser integration surface
node scripts/find-writing-assistance-targets.mjs . to inventory likely frontend files and existing Summarizer, Writer, or Rewriter usage 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 right surface
references/writing-assistance-reference.md before writing code.references/examples.md when the feature needs a session shape for monitoring downloads, batch output, streaming output, or cancellation.references/compatibility.md when preview flags, browser channels, hardware requirements, or iframe constraints matter.references/troubleshooting.md when availability checks, creation, streaming, or session cleanup fail.Window context and that the relevant permissions-policy feature allows access from the current frame.Summarizer for article, document, or conversation summaries.Writer for generating new text from a short prompt or writing task.Rewriter for transforming existing text while preserving its intent.Step 3: Implement a guarded session wrapper
assets/writing-assistance-session.template.ts and adapt it to the framework, state model, and file layout in the workspace.availability() method using the same create options that will be used at runtime.availability() as a capability check, not a guarantee that creation will succeed without user interaction or download time.monitor option during create() when the UI needs download progress.AbortController for cancelable create and run calls, and call destroy() when the session is no longer needed.Step 4: Wire UX and fallback behavior
sharedContext only for persistent session-wide guidance, and pass per-call context only for request-specific background detail.Step 5: Validate behavior
node scripts/find-writing-assistance-targets.mjs . to confirm that the intended app boundary and API markers still resolve to the edited integration surface.availability() behavior before debugging deeper runtime failures.references/compatibility.md before treating failures as application bugs.Summarizer, Writer, or Rewriter is missing, keep a non-AI fallback and confirm that the environment satisfies the browser and preview requirements before changing product logic.availability() returns downloadable or downloading, require user-driven session creation before promising that generation is ready.create() throws NotAllowedError, check permissions-policy constraints, missing user activation for downloads, browser policy restrictions, or user rejection.create() or a run call throws NotSupportedError, align the requested languages, output format, summary type, tone, or length with the browser's supported combinations.QuotaExceededError, shrink sharedContext, per-call context, or the user input before retrying.f4c5a23
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.