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.
npx skills add portals-labs/portals-plugin-claude --skill portals-sdkgit clone --depth 1 https://github.com/portals-labs/portals-plugin-claudeWrote 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.
[](https://agentmods.dev/skills/portals-labs/portals-plugin-claude/portals-sdk)<a href="https://agentmods.dev/skills/portals-labs/portals-plugin-claude/portals-sdk"><img src="https://agentmods.dev/badge/skills/portals-labs/portals-plugin-claude/portals-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.
<a href="https://agentmods.dev/skills/portals-labs/portals-plugin-claude/portals-sdk"><img src="https://agentmods.dev/badge/skills/portals-labs/portals-plugin-claude/portals-sdk.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00120 | $0.01261 |
| Opus 5 | $0.00060 | $0.00630 |
| Sonnet 5 | $0.00024 | $0.00252 |
| Haiku 4.5 | $0.00012 | $0.00126 |
Grade A, and why
portals-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 4d 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.
How it starts
The opening of the file, as written. The whole thing — 50 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Portals SDK
The Portals global connects a hosted web game to the Portals player and host: identity, the player's public username and playable avatar, saved progress, casual scores, leaderboard reads, and closing the game.
Read references/portals-sdk.md for the full API, code examples, and the method reference table. It is the official documentation, copied verbatim.
Wiring
Portals stamps the SDK into every processed preview and published bundle. Include it from the game's own origin, before game code:
<script src="./_portals/sdk.js"></script>
<script src="./game.js"></script>
Never download, edit, or bundle _portals/sdk.js — Portals replaces the managed copy on every process and publish. TypeScript declarations live at https://portals.to/portals-sdk/portals.d.ts; they are not part of the game's files.
Host UI reserve
Every launched game keeps a trusted Portals controls trigger above the game iframe. The current closed trigger is 44×44 CSS pixels at left: max(12px, env(safe-area-inset-left)) and top: max(12px, env(safe-area-inset-top)); a party badge may extend 4px beyond it. Keep essential and interactive HUD UI outside that top-left footprint. For a top HUD, use padding-left: calc(max(12px, env(safe-area-inset-left)) + 56px); for a left HUD, use the equivalent top inset. A full-bleed non-interactive playfield is fine.
The host control is outside and above untrusted game code. Never try to hide, restyle, intercept, or out-z-index it. Its expanded panel may temporarily cover more of the game and owns focus while open, so pause or otherwise keep gameplay safe until focus returns.
Rules that are easy to get wrong
await Portals.ready()before reading the player or using any hosted capability.session.contextisstandaloneon a game page,roominside a Portals room.- Call
Portals.identity.requestLogin()only from a direct player action such as a button click. Portals owns the sign-in UI — never ask for a Portals password or account credential in-game. playerIdis stable per player within one game and deliberately different across games. It is not a Portals account ID and must not be used to correlate a player across games. It isnullfor signed-out players, so always render a fallback name.Portals.player.get()reads the current public profile —usernamewithout the@, andavatar, the playable look saved on the Portals/avatarscreen.avatarUrlis only a 2D profile image; never load it as a 3D character. Both arenullfor a guest. The first signed-in read is cached for the game load, so call it again afterrequestLogin().Portals.avatar.openPicker()opens the trusted global avatar UI from a direct click and resolves to the refreshed profile once the player saves; Cancel rejects. It is unavailable in the editor preview — catch the rejection, keep the preview playable, and verify the flow in a published host. Games never read inventory or equip items by ID;avatar.wearablesis render data, not ownership proof.- Saved state must be JSON-serializable and at most 64 KB encoded. Signed-out players cannot save;
loadState()returnsnullwhen nothing is saved. Version the shape (schemaVersion) when it may change. - Scores and saves require sign-in. A score mode is lowercase letters, numbers, and hyphens, max 32 characters, defaulting to
default.getLeaderboardtakes a limit of 1–100, default 10. submitScorekeeps the player's highest score for a mode. Pass{ replace: true }as the third argument —Portals.submitScore(score, mode, { replace: true })— only when the game's score can legitimately go down and the new value must replace a higher stored one.- Scores are client-reported. Never use them to award currency, paid prizes, access, or any other valuable entitlement.
- The leaderboard works in draft play too —
submitScoreandgetLeaderboardare live in the editor preview and behind a shared?draft=link. Draft play uses a separate draft board, so test a leaderboard before publishing; those scores never reach the published game's ranking, and the published board starts empty. - Every async method can reject — no host, invalid request, missing access, network failure. Catch at the player action that caused it and keep the game playable when an optional Portals feature is unavailable.
- Never put API keys, Firebase tokens, payment details, or signed asset URLs in game code, saved state, score modes, logs, or leaderboard UI.
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 4d ago Changed · +1 lines d30d3ca4c6a6
- 12d ago First seen · 49 lines · 120 tokens per session scan A 8917654feb7c
portals-sdk is a skill published in the GitHub repository portals-labs/portals-plugin-claude (4 stars, last pushed 3d ago), licensed ISC. It adds 120 tokens to every session and 1,261 once invoked, about $0.0006 per session on Opus 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-31.
Other skills, from other repositories
worker-visualizer
A real-time data/particle/simulation visualizer whose heavy compute runs in a Web Worker (off the main thread), optionally sharing memory with the UI via SharedArrayBuffer, and renders to a canvas at 60fps. Produced as a single self-contained index.html. Use when the brief asks for a "web worker", "simulation"…
react-three-fiber
React Three Fiber 3D renderer for json-render. Use when working with @json-render/react-three-fiber, building 3D scenes from JSON specs, rendering meshes/lights/models/environments, or integrating Three.js with json-render catalogs.
vgpu
Build, debug, test, and optimize WebGPU projects using vgpu, its CLI, or @vgpu packages. Use for vgpu API questions, WGSL workflows, browser or Node rendering, integrations, testing, and performance work.
matterjs
Use when implementing 2D physics interactions with Matter.js, including Engine/World setup, Render/Runner configuration, adding bodies and constraints, and scroll/interaction-friendly canvas scenes.
html-to-ugui
A pipeline for turning HTML interface prototypes into Unity UGUI Prefabs, which are reusable Unity interface objects. It uses browser-rendered layout data to preserve positions, images, text, controls, and device-adaptation intentions.
threejs-game-director
Entrypoint for building, upgrading, and finishing Three.js browser games. Routes work across the sibling threejs- skills for gameplay, graphics, UI, 3D/image/audio asset generation, debugging, and release. Use for build-a-game, upgrade, polish, premium, AAA, high-fidelity, showcase, from-scratch, endless runner…