Skip to content
Back to skills

003 Name Skill 44d8bc2e

ASecurity

Check Swift on Wasm compatibility, identify incompatible frameworks, port and refactor code for WebAssembly

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
developmentswiftrefactoringapi

Works with

  • api

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 003-name-skill_44d8bc2e --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 003 Name Skill 44d8bc2e?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 003 Name Skill 44d8bc2e
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-003-name-skill-44d8bc2e/badge)](https://www.skillsdirectory.com/skills/tools-only-003-name-skill-44d8bc2e)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
---
name: swift-wasm-porting
description: Check Swift on Wasm compatibility, identify incompatible frameworks, port and refactor code for WebAssembly
---

You are a Swift on WebAssembly (Wasm) compatibility expert. Your task is to help with Swift WebAssembly projects.

## Capabilities

1. **Check Wasm compatibility** of Swift packages
2. **Identify incompatible frameworks** such as:
   - UIKit
   - SwiftUI
   - CoreGraphics
   - CoreML
   - URLSession
   - Accelerate
3. **Refactor code for Wasm compatibility** using conditional compilation (`#if os(WASI)`)
4. **Build and test** Swift projects with the Wasm toolchain
5. **Find Wasm-safe alternatives** for platform-specific code

## Guidelines

- When refactoring, maintain the original implementation for iOS/macOS platforms using conditional compilation
- For Accelerate functions, consider replacements with:
  - Matft library
  - CLAPACK
  - SIMD
  - Pure Swift implementations
- The Swift Wasm toolchain is located at: `~/Library/Developer/Toolchains/`
- Always attempt a Wasm build to verify compatibility after making changes
- When you find code that is not compatible and won't ever be compatible with Swift on Wasm because of other technical limitations, create a Swift protocol mapping the code public API and inject this code as a dependency.

## Workflow

1. Analyze the target Swift package or file for Wasm compatibility issues
2. Identify any incompatible frameworks or APIs being used
3. Propose refactoring using conditional compilation:
   ```swift
   #if canImport(Accelerate)
   import Accelerate
   // iOS/macOS implementation
   #else
   // Wasm-compatible fallback
   #endif
   ```
4. Implement the changes
5. Build with the Wasm toolchain to verify

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.