Skip to content
Skill

Bridge js

Lets an agent write Swift–JavaScript interop code with BridgeJS bindings and exports

Bridge js is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

Scripts
None
Platforms
Claude Code, Codex, Cursor
GitHub stars
49
Last commit
License
MIT
Listing updated

Similar skills

About Bridge js

BridgeJS is a code generation layer in JavaScriptKit for passing values and calls between Swift and JavaScript. Instead of hand-writing raw JSObject and JSValue handling, the developer declares the API shape in Swift using @JS-style macros or in a bridge-js.d.ts file, and the generated glue code handles the boundary. The skill points the agent to the DocC documentation in the JavaScriptKit checkout for details rather than relying on memory.

The skill covers both directions: exporting Swift types and functions so JavaScript can call them, and importing JavaScript or TypeScript APIs into Swift through declared bindings, globals such as document or console, and injected imports. It explains how types map across the boundary, which values are passed by reference and which by copy, how errors must be typed as throws(JSException), and how async functions turn into Promises.

Work with this skill assumes a Swift project that depends on JavaScriptKit. The skill also references a local ts2swift script for previewing how a d.ts file converts to Swift, and it includes reference files on project setup, testing and known limitations.

When your agent uses it

Export Swift to JavaScript and import JavaScript/TypeScript into Swift using BridgeJS; type-safe bindings via @JS and related macros or bridge-js.d.ts; setup, config, AOT. Use when using or setting up BridgeJS, exporting Swift APIs to JS, importing JS/TS APIs into Swift, writing bridge-js.d.ts, configuring BridgeJS, or debugging BridgeJS boundaries.

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 8 files (35 KB) on GitHub on 5 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

This skill ships in the bridge-js plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add swiftwasm/Swift-Wasm-Agent-Skill
/plugin install bridge-js@swiftwasm-skills

Or copy only this skill to ~/.claude/skills/bridge-js:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/swiftwasm/Swift-Wasm-Agent-Skill.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/bridge-js &&
cp -R "$tmp/bridge-js" ~/.claude/skills/bridge-js &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/bridge-js inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/bridge-js to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/swiftwasm/Swift-Wasm-Agent-Skill.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/bridge-js &&
cp -R "$tmp/bridge-js" ~/.agents/skills/bridge-js &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/bridge-js inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/bridge-js to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/swiftwasm/Swift-Wasm-Agent-Skill.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/bridge-js &&
cp -R "$tmp/bridge-js" ~/.cursor/skills/bridge-js &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/bridge-js inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/swiftwasm/Swift-Wasm-Agent-Skill.git --path bridge-js

Or copy the folder to ~/.gemini/skills/bridge-js yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/bridge-js:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/swiftwasm/Swift-Wasm-Agent-Skill.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/bridge-js &&
cp -R "$tmp/bridge-js" ~/.copilot/skills/bridge-js &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/bridge-js inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/swiftwasm/Swift-Wasm-Agent-Skill.git

Then copy Swift-Wasm-Agent-Skill/bridge-js into your agent's skills folder as bridge-js. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Swift to JavaScript export
Shows how to expose Swift functions, classes, enums and closures to JavaScript using @JS annotations.
JavaScript import bindings
Covers declaring JavaScript functions, classes, getters and setters in Swift with import macros.
TypeScript declaration generation
Explains generating Swift bindings from a bridge-js.d.ts file and previewing the output with ts2swift.
Type mapping rules
Summarizes how optionals, undefined, arrays, records and typed arrays cross the Swift and JS boundary.
Closure and async handling
Describes passing closures in both directions, releasing typed closures, and Promise-returning async exports.
Boundary debugging guidance
Points to setup, configuration, testing and limitations references for troubleshooting interop issues.

Good for

  • Export a Swift struct and its methods so a JavaScript frontend can call them
  • Import a browser API such as document or console into a Swift WebAssembly app
  • Generate Swift bindings from a TypeScript d.ts file for an existing JS library
  • Convert a Swift closure into a JavaScript callback and release it correctly
  • Configure BridgeJS in a JavaScriptKit project and debug a failing boundary call

Bridge js FAQ

What does the skill need to be used?

It assumes a project that depends on JavaScriptKit, and it refers to the checked-out JavaScriptKit repository for the DocC documentation and the ts2swift script.

Does Bridge js run scripts or change my code?

The skill itself has no scripts. It gives the agent instructions and references for writing BridgeJS exports, imports and bindings.

Which errors are supported across the bridge?

Only throws(JSException) is supported at the bridge; plain throws is not.

How are async Swift functions exposed to JavaScript?

Exported async functions, methods and closures become Promise-returning JavaScript functions and require JavaScriptEventLoop.installGlobalExecutor().

How do I install Bridge js in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/bridge-js to use it in all your projects, or to .claude/skills/bridge-js in one project. Or install the bridge-js plugin, which includes it: /plugin marketplace add swiftwasm/Swift-Wasm-Agent-Skill, then /plugin install bridge-js@swiftwasm-skills.

Does Bridge js run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Bridge js?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

What are the best alternatives to Bridge js?

The closest alternatives to Bridge js are Javascriptkit, TypeScript best practices, TypeScript, Axiom swift and JavaScript TypeScript jest.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from swiftwasm/Swift-Wasm-Agent-Skill

  1. Guides Swift developers building WebAssembly web apps with JavaScriptKit

    • Open source
    • 49 GitHub stars
    • Developer tools
  2. Helps Swift code check, port and refactor packages to compile for WebAssembly

    • Open source
    • 49 GitHub stars
    • Developer tools