spherse-use-ui-sdk

spherse-use-ui-sdk is a skill for Claude Code, Codex from mengrru/Spherse. It costs 92 tokens per session (6,622 once invoked), scanned A, original, MIT.

A browser-side JavaScript interface injected into Spherse HTML pages. It lets page controls communicate with the Spherse app, including opening files or sessions, sending messages, storing data, and showing notifications.

In plain words
What is it for?
Use it to build Spherse welcome pages, previews, or chat cards with buttons that open files, start or control sessions, send messages, read or save data, list files, and react to file changes.
Why use it?
It removes the need to build the communication layer between an HTML page and the Spherse app yourself. The page can call the provided interface directly.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to build Spherse welcome pages, previews, or chat cards with buttons that open files, start or control sessions, send messages, read or save data, list files, and react to file changes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mengrru/spherse/spherse-use-ui-sdk
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add mengrru/Spherse --skill spherse-use-ui-sdk
Clone the repo
git clone --depth 1 https://github.com/mengrru/Spherse

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for spherse-use-ui-sdk

README.md
[![agentmods](https://agentmods.dev/badge/skills/mengrru/spherse/spherse-use-ui-sdk/github.svg)](https://agentmods.dev/skills/mengrru/spherse/spherse-use-ui-sdk)
Your own site
<a href="https://agentmods.dev/skills/mengrru/spherse/spherse-use-ui-sdk"><img src="https://agentmods.dev/badge/skills/mengrru/spherse/spherse-use-ui-sdk/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for spherse-use-ui-sdk

Your own site · 80×15
<a href="https://agentmods.dev/skills/mengrru/spherse/spherse-use-ui-sdk"><img src="https://agentmods.dev/badge/skills/mengrru/spherse/spherse-use-ui-sdk.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 92 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,622 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00092 $0.06622
Opus 5.5 $0.00037 $0.02649
Sonnet 5.5 $0.00018 $0.01324
Haiku 4.5 $0.00009 $0.00662

Measured 1mo ago against content hash e65ec5b10f56, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

spherse-use-ui-sdk scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/presets/skills/spherse-use-ui-sdk/SKILL.md · 503 lines

How it starts

The opening of the file, as written. The whole thing — 503 lines — stays where its author put it; the contents beside it link to each section on GitHub.

UI SDK — window.spherse

Spherse 中的 HTML 内容(欢迎页、自定义侧边面板、Content Browser 预览、聊天 HtmlCard)都在 iframe 中展示。App 会自动向每个 HTML 注入一个零依赖的 SDK 脚本,暴露 window.spherse(另有别名 window.Spherse,其它大小写不可用)。你不需要手写 postMessage、不需要内联 Promise wrapper、不需要引入任何脚本标签 —— 直接用即可。

快速上手

<button onclick="spherse.openFile('world/characters.md')">打开角色档案</button>
<button onclick="startWriting()">开始写作</button>

<script>
  function startWriting() {
    spherse.createSession({ agentId: "writer", message: "开始新的写作会话" });
  }
</script>

SDK 已由 App 注入,不要再自己写 <script> 加载它,也不要复制 spherseCall 之类的 wrapper —— 那些都已内置。

API 总览

window.spherse 提供以下能力:

类别 方法 说明
触发型(fire-and-forget) openSession / openFile / openExternalLink / floatSession / unfloatSession / floatContent / unfloatContent / emitAgentTriggerEvent / toast 单向触发,无返回值
请求型(Promise) createSession(params) → Promise<{ sessionId }> 创建会话,返回新会话 ID
请求型(Promise) sendMessage(params) → Promise 等待发送结果
请求型(Promise) data.get / data.set / data.delete / data.keys / data.entries / data.mutate key-value 持久化 + manifest 结构性变更
请求型(Promise) uploadFile(params) → Promise<{ path, bytes, renamed }> 把 Blob/File 上传到项目目录
请求型(Promise) api.call(op, args) 及 api.* 命名方法 只读查询项目信息(agents / sessions / content / fileTree)
事件型 events.on("file:update", filter, handler) 订阅指定项目文件的变化信号
事件型 events.on("navigate", handler) 感知宿主主视图跳转(订阅即回放当前页面)
运行时 spherse.runtime(同步读)/ spherse.getRuntime()(Promise) 获取当前会话上下文(仅 HtmlCard 有值)

所有请求型方法都返回 Promise,内部已处理 requestId 匹配与超时(默认 10 秒,uploadFile 为 60 秒),失败时 reject。

运行时上下文(聊天 HtmlCard 专属)

当 HTML 作为聊天 HtmlCard 渲染时,spherse.runtime 携带当前会话信息;Welcome Page、自定义侧边面板与 Content Browser 预览中为 null,且这些场景下 await spherse.getRuntime() 永远不会 resolve——不要在页面加载时调用它。

  • 交互式卡片(用户点击才触发):直接读 spherse.runtime
  • 加载即使用:用 await spherse.getRuntime()(内部已处理竞态,无需自己注册 message 监听)

Read the full file on GitHub · 503 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed e65ec5b10f56
  2. 1mo ago Changed · +31 lines 474801c60c26
  3. 1mo ago Changed · +26 lines 078269affa2e
  4. 2mo ago First seen · 446 lines · 92 tokens per session scan A dd6fbceb35e1

Subscribe to this mod's changes

spherse-use-ui-sdk is a skill published in the GitHub repository mengrru/Spherse (98 stars, last pushed 8d ago), licensed MIT. It adds 92 tokens to every session and 6,622 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

spherse-use-ui-sdk compared with skills from other repositories

spherse-use-ui-sdk next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
spherse-use-ui-sdkmengrru/SpherseSkill988d agoMITA92Claude Code, Codex
llmlintnotnotype/neuro-bookSkill7787d agoAGPL-3.0A128Claude Code, Codex
profile-system-guidenotnotype/neuro-bookSkill7787d agoAGPL-3.0A48Claude Code
novel-technique-character-card-workshopnotnotype/neuro-bookSkill7787d agoAGPL-3.0A163Claude Code, Codex
RP模式notnotype/neuro-bookSkill7787d agoAGPL-3.0A50Claude Code
novel-writer-executionnotnotype/neuro-bookSkill7787d agoAGPL-3.0A44Claude Code
novel-import-silly-tavern-cardnotnotype/neuro-bookSkill7787d agoAGPL-3.0A75Claude Code, Codex