
writing-assistance-apis
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.
- Installs
- 478
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/webmaxru/web-ai-agent-skills --skill writing-assistance-apis- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads writing-assistance-apis automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Writing Assistance APIs
Procedures
Step 1: Identify the browser integration surface
- Inspect the workspace for browser entry points, UI handlers, and any existing AI abstraction layer.
- Execute
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. - If a Node runtime is unavailable, inspect the nearest
package.json, HTML entry point, and framework bootstrap files manually to identify the browser app boundary. - If the workspace contains multiple frontend apps, prefer the app that contains the active route, component, or user-requested feature surface.
- If the inventory still leaves multiple plausible frontend targets, stop and ask which app should receive the Writing Assistance API integration.
- If the project is not a browser web app, stop and explain that this skill does not apply.
Step 2: Confirm API viability and choose the right surface
- Read
references/writing-assistance-reference.mdbefore writing code. - Read
references/examples.mdwhen the feature needs a session shape for monitoring downloads, batch output, streaming output, or cancellation. - Read
references/compatibility.mdwhen preview flags, browser channels, hardware requirements, or iframe constraints matter. - Read
references/troubleshooting.mdwhen availability checks, creation, streaming, or session cleanup fail. - Verify that the feature runs in a secure
Windowcontext and that the relevant permissions-policy feature allows access from the current frame. - Choose the narrowest surface that matches the task:
Summarizerfor article, document, or conversation summaries.Writerfor generating new text from a short prompt or writing task.Rewriterfor transforming existing text while preserving its intent.
- If the feature must run in a worker, on the server, or against a remote model provider, stop and explain the platform mismatch.
- If the project uses TypeScript, add or preserve typings that cover the specific browser APIs used by the feature.
Step 3: Implement a guarded session wrapper
- Read
assets/writing-assistance-session.template.tsand adapt it to the framework, state model, and file layout in the workspace. - Gate session creation behind the API's
availability()method using the same create options that will be used at runtime. - Treat
availability()as a capability check, not a guarantee that creation will succeed without user interaction or download time. - Create sessions only after user activation when creation may initiate a download.
- Use the
monitoroption duringcreate()when the UI needs download progress. - Use
AbortControllerfor cancelable create and run calls, and calldestroy()when the session is no longer needed. - Recreate the session instead of mutating options after creation; session options are fixed per instance.
- If the feature lives in a cross-origin iframe, require explicit delegation for each API that the frame needs.
Step 4: Wire UX and fallback behavior
- Surface distinct states for missing APIs, unavailable devices, downloadable or downloading models, ready sessions, in-flight generation, and aborted work.
- Keep a non-AI fallback for unsupported browsers, blocked frames, or devices that do not meet the current preview requirements.
- Strip or normalize HTML before summarization or rewriting when the source text comes from rendered page content.
- Use the batch methods when the feature needs the full result before continuing, and use the streaming methods when the UI should reveal output incrementally.
- Pass
sharedContextonly for persistent session-wide guidance, and pass per-callcontextonly for request-specific background detail. - Keep language options explicit when the feature depends on supported input, context, or output languages.
- Do not route generic chatbot, tool-calling, or open-ended assistant tasks through these APIs; switch to the Prompt API or another approved capability when the task is not summarization, writing, or rewriting.
Step 5: Validate behavior
- Execute
node scripts/find-writing-assistance-targets.mjs .to confirm that the intended app boundary and API markers still resolve to the edited integration surface. - Verify feature detection, secure-context checks, and
availability()behavior before debugging deeper runtime failures. - Test at least one batch call and one streaming call when the feature exposes both modes.
- Confirm that cancellation stops generation cleanly and that destroyed sessions are not reused.
- If the target environment depends on preview browser flags or channel-specific behavior, confirm the required browser state from
references/compatibility.mdbefore treating failures as application bugs. - Run the workspace build, typecheck, or tests after editing.
Error Handling
- If
Summarizer,Writer, orRewriteris missing, keep a non-AI fallback and confirm that the environment satisfies the browser and preview requirements before changing product logic. - If
availability()returnsdownloadableordownloading, require user-driven session creation before promising that generation is ready. - If
create()throwsNotAllowedError, check permissions-policy constraints, missing user activation for downloads, browser policy restrictions, or user rejection. - If
create()or a run call throwsNotSupportedError, align the requested languages, output format, summary type, tone, or length with the browser's supported combinations. - If a call throws
QuotaExceededError, shrinksharedContext, per-callcontext, or the user input before retrying. - If the feature must run in a worker or server context, stop and explain that the Writing Assistance APIs are window-only browser APIs.
FAQ
What does the writing-assistance-apis skill do?
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.
How do I install writing-assistance-apis?
Run npx skills add https://github.com/webmaxru/web-ai-agent-skills --skill writing-assistance-apis in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/writing-assistance-apis/ (personal) or .claude/skills/writing-assistance-apis/ (project).
Which AI agents can use writing-assistance-apis?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is writing-assistance-apis safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains writing-assistance-apis?
It is published by webmaxru in webmaxru/web-ai-agent-skills. It has 478 recorded installs.
More from webmaxru/web-ai-agent-skills
webmcp
webmaxru/web-ai-agent-skills
Implements 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.
language-detector-api
webmaxru/web-ai-agent-skills
Implements 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.
github-agentic-workflows
webmaxru/web-ai-agent-skills
Authors, reviews, installs, and debugs GitHub Agentic Workflows in repositories, including workflow markdown, frontmatter, gh aw compile and run flows, safe outputs, security guardrails, and operational patterns. Use when creating or maintaining GH-AW automation. Don't use for standard deterministic GitHub Actions YAML, generic CI pipelines, or non-GitHub automation systems.
proofreader-api
webmaxru/web-ai-agent-skills
Implements 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-api
webmaxru/web-ai-agent-skills
Open the skill to read its SKILL.md instructions.
webnn
webmaxru/web-ai-agent-skills
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.
Popular docs & writing skills
grill-with-docs
mattpocock/skills
A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.
lark-markdown
open.feishu.cn
飞书 Markdown:查看、创建、上传、编辑和比较飞书中的原生 Markdown 文件。当用户要操作飞书 Markdown 文件,或比较其远端版本及本地草稿时使用。纯本地 Markdown 文件操作不触发本 skill。不负责将 Markdown 导入为飞书在线文档,也不负责文件搜索、权限、评论、移动、删除等云空间管理操作。
writing-beats
mattpocock/skills
Writing, exploit; assemble raw material into a journey of beats, grounding each term before a beat leans on it.
writing-shape
mattpocock/skills
Writing, exploit: shape raw material into an article, paragraph by paragraph.
writing-fragments
mattpocock/skills
Writing, explore: mine raw fragments, no structure yet.
writing-for-agents
mattpocock/skills
Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.