bridge-js

bridge-js is a skill for Claude Code from swiftwasm/Swift-Wasm-Agent-Skill. It costs 82 tokens per session (892 once invoked), scanned A, original, MIT.

A code-generation layer for connecting Swift with JavaScript or TypeScript. It creates the supporting code needed for Swift APIs to be called from JavaScript and JavaScript APIs to be used from Swift.

In plain words
What is it for?
Use it to configure BridgeJS, expose Swift functions or types to JavaScript, import JavaScript libraries into Swift, or generate bindings from bridge-js.d.ts files.
Why use it?
It reduces the amount of low-level interop code developers must write and helps keep the two sides’ API shapes aligned.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the swiftwasm-skills plugin — 3 skills shipped together

Good fit Use it to configure BridgeJS, expose Swift functions or types to JavaScript, import JavaScript libraries into Swift, or generate bindings from bridge-js.d.ts files.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/swiftwasm/swift-wasm-agent-skill/bridge-js
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 swiftwasm/Swift-Wasm-Agent-Skill --skill bridge-js
Clone the repo
git clone --depth 1 https://github.com/swiftwasm/Swift-Wasm-Agent-Skill

Made for: Claude Code.

Or install swiftwasm-skills, the plugin that ships this one along with the rest of its 3 skills.

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 bridge-js

README.md
[![agentmods](https://agentmods.dev/badge/skills/swiftwasm/swift-wasm-agent-skill/bridge-js/github.svg)](https://agentmods.dev/skills/swiftwasm/swift-wasm-agent-skill/bridge-js)
Your own site
<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.

agentmods 80×15 button for bridge-js

Your own site · 80×15
<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>
Per session 82 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 892 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.
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.00082 $0.00892
Opus 5 $0.00041 $0.00446
Sonnet 5 $0.00016 $0.00178
Haiku 4.5 $0.00008 $0.00089

Measured 9d ago against content hash a5b72358eaaa, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

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.

bridge-js/SKILL.md · 37 lines

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 like document/console; inject other implementations via getImports(). See references/importing.md. (2) Or use bridge-js.d.ts to generate the same Swift bindings. See references/importing-ts.md.

Key concepts

  • Type mapping: Primitives, Optionalnull, JSUndefinedOrundefined, 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; plain throws is not.
  • Async: Exported async functions/methods/closures become Promise-returning JS functions (require JavaScriptEventLoop.installGlobalExecutor()). Imported standalone @JSFunction cannot 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 --help for 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 via FinalizationRegistry. Closure signatures may be throws(JSException) and/or async. When receiving callbacks from JS (e.g. imported APIs), use regular closure types in Swift ((Args) -> Return).

Read the full file on GitHub · 37 lines

Files

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.

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. 9d ago First seen · 37 lines · 82 tokens per session scan A a5b72358eaaa

Subscribe to this mod's changes

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.

Related

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.

jiushiwon/wg-skills · 192 tokens

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.

openai/plugins · 59 tokens

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…

react-native-community/skills · 78 tokens

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…

riteshshukla04/agent-skills · 84 tokens

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."…

mosif16/codex-Skills · 0 tokens

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.

prisma/orm · 52 tokens