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 swiftwasm/Swift-Wasm-Agent-Skill --skill bridge-jsgit clone --depth 1 https://github.com/swiftwasm/Swift-Wasm-Agent-SkillWrote 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/swiftwasm/swift-wasm-agent-skill/bridge-js)<a href="https://agentmods.dev/skills/swiftwasm/swift-wasm-agent-skill/bridge-js"><img src="https://agentmods.dev/badge/skills/swiftwasm/swift-wasm-agent-skill/bridge-js/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/swiftwasm/swift-wasm-agent-skill/bridge-js"><img src="https://agentmods.dev/badge/skills/swiftwasm/swift-wasm-agent-skill/bridge-js.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.00082 | $0.00892 |
| Opus 5 | $0.00041 | $0.00446 |
| Sonnet 5 | $0.00016 | $0.00178 |
| Haiku 4.5 | $0.00008 | $0.00089 |
Grade A, and why
bridge-js 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 9d 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 — 37 lines — stays where its author put it; the contents beside it link to each section on GitHub.
BridgeJS
BridgeJS is a code-generation layer in JavaScriptKit that makes Swift–JavaScript interop faster and easier than raw JSObject/JSValue: you declare the API shape in Swift (or TypeScript), and the tool generates glue code. Two directions: export Swift to JavaScript and import JavaScript into Swift.
Referencing official docs
When you need details, read DocC from the checked-out JavaScriptKit repository: Sources/JavaScriptKit/Documentation.docc/ when inside the JavaScriptKit repo, or .build/checkouts/JavaScriptKit/Sources/JavaScriptKit/Documentation.docc/ when in a project that depends on JavaScriptKit.
Two directions
- Export Swift: Use
@JS(and@JS(namespace:enumStyle:identityMode:)) on functions, classes, structs, enums, closures, protocols, etc. JavaScript then calls into your Swift code. See references/exporting.md. - Import JavaScript: (1) Declare bindings in Swift with
@JSFunction,@JSClass,@JSGetter,@JSSetter; use@JSGetter(from: .global)for globals likedocument/console; inject other implementations viagetImports(). See references/importing.md. (2) Or usebridge-js.d.tsto generate the same Swift bindings. See references/importing-ts.md.
Key concepts
- Type mapping: Primitives,
Optional↔null,JSUndefinedOr↔undefined, arrays,Record<string, V>↔[String: V],JSTypedArray<T>↔ TypedArray (by reference), unbridged →JSObject/JSValue. See references/types.md if present. - Semantics: classes, protocols,
JSTypedArray, and closures cross by reference; structs, enums, and plain arrays cross by copy. - Errors: Only
throws(JSException)is supported at the bridge; plainthrowsis not. - Async: Exported
asyncfunctions/methods/closures becomePromise-returning JS functions (requireJavaScriptEventLoop.installGlobalExecutor()). Imported standalone@JSFunctioncannot be async, but imported async callbacks (closure parameters) are supported. - Preview interfaces: For previewing d.ts → Swift locally, run the ts2swift script from the checked-out JavaScriptKit: from a project that depends on JavaScriptKit use
node .build/checkouts/JavaScriptKit/Plugins/BridgeJS/Sources/TS2Swift/JavaScript/bin/ts2swift.js <input.d.ts> [options]; Run with--helpfor usage. - Closures: Use JSTypedClosure when passing or returning Swift closures to JS, and call
release()when the closure is no longer needed by JS. Plain Swift closure types also work as parameters/returns, released automatically viaFinalizationRegistry. Closure signatures may bethrows(JSException)and/orasync. When receiving callbacks from JS (e.g. imported APIs), use regular closure types in Swift ((Args) -> Return).
What ships with it
7 files 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.
- 9d ago First seen · 37 lines · 82 tokens per session scan A a5b72358eaaa
bridge-js is a skill published in the GitHub repository swiftwasm/Swift-Wasm-Agent-Skill (48 stars, last pushed 1mo ago), licensed MIT. It adds 82 tokens to every session and 892 once invoked, about $0.0004 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-30.
Other skills, from other repositories
electron-vue-init-skill
A starter generator for desktop applications built with Electron, Vue 3, and TypeScript. Electron lets web technologies run inside a desktop window.
expo-module
Guide for writing Expo native modules and views using the Expo Modules API (Swift, Kotlin, TypeScript). Covers module definition DSL, native views, shared objects, config plugins, lifecycle hooks, autolinking, and type system. Use when building or modifying native modules for Expo.
migrate-to-strict-api
Use when migrating a React Native project to the Strict TypeScript API — the default JavaScript API from React Native 0.87, available as an opt-in preview since 0.80. Handles tsconfig.json setup, dependency updates, rewriting deep imports to root imports, and resolving breaking type changes. Invoke with…
build-nitro-modules
Builds React Native Nitro Modules from scratch in a monorepo. Scaffolds with Nitrogen, authors HybridObject TypeScript specs, generates native boilerplate, implements in C++/Swift/Kotlin, wires an example app, and prepares for npm publishing. Use when creating a new Nitro Module, implementing native functionality via…
firebase SDK
name: "Firebase Swift & TypeScript SDK Best Practices" description: "Guidelines and best practices for integrating and using the Google Firebase SDK in Swift (for Apple platforms) and TypeScript (for web/Node), covering setup, architecture, data handling, security, and usage across supported services and platforms."…
no-bare-casts
Writing as in TypeScript or TSX production code, modifying a file that contains a bare as cast, silencing a type error with a cast, encountering as unknown as, or reviewing a cast site.