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.5 $0.00033 $0.00357
Sonnet 5.5 $0.00016 $0.00178
Haiku 4.5 $0.00008 $0.00089

Measured 3mo ago against content hash a5b72358eaaa, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 3mo 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, 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; 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. 3mo 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 (49 stars, last pushed 3mo ago), licensed MIT. It adds 82 tokens to every session and 892 once invoked, about $0.0003 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

bridge-js compared with skills from other repositories

bridge-js next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
bridge-jsswiftwasm/Swift-Wasm-Agent-SkillSkill493mo agoMITA82Claude Code
electron-vue-init-skilljiushiwon/wg-skillsSkill1546d agoApache-2.0A192Claude Code, Codex
expo-moduleopenai/pluginsSkill8.5k12d agononeA59Codex
migrate-to-strict-apireact-native-community/skillsSkill283mo agoMITA78Claude Code
ktlintmoabualruz/fulcrumSkill62mo agoMITA67Claude Code
build-nitro-modulesriteshshukla04/agent-skillsSkill358mo agononeA84Claude Code, Codex
firebase SDKmosif16/codex-SkillsSkill181y agononeA0Claude Code, Codex