# Swift Wasm

> Swift WASM development for setup, build, optimize, debug, and test workflows in Raven and related apps. Use when this capability is needed.

- Skill: `tomevault-io/swift-wasm-2` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/swift-wasm-2`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/swift-wasm-2/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/swift-wasm-2

---


# Swift WASM Development Skill

Comprehensive guidance for Swift 6.2 WebAssembly workflows used by Raven.

## Quick Actions

- `setup`: Set up Swift toolchain and WASM SDK
- `build`: Build the current project for WASM
- `dev`: Start development workflow/server
- `optimize`: Build an optimized production bundle
- `debug`: Diagnose build/runtime WASM issues
- `test`: Run tests and browser validation

## Project Docs To Prefer

- `QUICKSTART.md`
- `Documentation/GettingStarted.md`
- `Docs/bundle-size-quickstart.md`

## Setup Commands

```bash
brew install swiftly
swiftly install 6.2.3
swiftly use 6.2.3
swift --version

swift sdk install \
  https://download.swift.org/swift-6.2.3-release/wasm-sdk/swift-6.2.3-RELEASE/swift-6.2.3-RELEASE_wasm.artifactbundle.tar.gz \
  --checksum 394040ecd5260e68bb02f6c20aeede733b9b90702c2204e178f3e42413edad2a

swift sdk list
```

## Build Commands

```bash
swift build --swift-sdk swift-6.2.3-RELEASE_wasm
swift build --swift-sdk swift-6.2.3-RELEASE_wasm -c release -Xswiftc -Osize
```

## Optimization Commands

```bash
swift build \
  --swift-sdk swift-6.2.3-RELEASE_wasm \
  -c release \
  -Xswiftc -Osize \
  -Xswiftc -whole-module-optimization \
  -Xlinker --lto-O3 \
  -Xlinker --gc-sections \
  -Xlinker --strip-debug
```

## Typical Issues

- "No available targets compatible with wasm32-unknown-wasip1": wrong Swift toolchain or missing WASM SDK
- large WASM bundle: missing `-Osize` / LTO / strip
- stale browser behavior: cached WASM artifact

## Working Norms

- Prefer official swift.org toolchains for reproducible builds.
- For example apps, build inside each example directory when possible.
- Confirm output location under `.build/wasm32-unknown-wasip1/`.

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/briannadoubt) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-16 -->

