Hi everyone,
Many of us are now using AI coding agents like Cursor, Claude Code, and so on. While they are great for general Swift tasks, they often struggle with the specifics of Swift on WebAssembly. They might suggest incorrect environment setups or provide buggy JavaScriptKit code that ignores the memory management model.
To bridge this gap, we've published a new repository: swiftwasm/skills.
It follows the Agent Skills format, a standardized way to provide domain-specific instructions and scripts directly to your AI agent. By loading these "skills", your agent gains a much better understanding of the Swift on Wasm ecosystem.
What's included so far:
- Reliable Project Initialization: Proper setup for
swiftlyand the Wasm SDK. - Verified JS Interop Recipes: Tested patterns for DOM manipulation, calling JS APIs, and handling
JSClosurelifetimes.
We're starting with the javascriptkit skill, but the goal is to expand this into a comprehensive knowledge base for everything Wasm-related in Swift.
How to use it
You can start using these skills today depending on your preferred agent:
- Claude Code:
claude plugin marketplace add swiftwasm/skills claude plugin install javascriptkit@swiftwasm-skills - Cursor / Windsurf / Codex: Clone the repository or copy the
skills/directory into your project. The agents will discover theSKILL.mdfiles and use them as high-priority instructions for your tasks. - Gemini CLI:
gemini extensions install https://github.com/swiftwasm/skills.git --consent
Once loaded, you can ask your agent things like: "Initialize a new JavaScriptKit project in this directory" or "How do I safely pass a Swift closure to a JS button click?" and it will follow the verified patterns in the repo.
If you're building for the web with Swift, give it a try! I'd love to hear your feedback, and PRs for new interop recipes or patterns are very welcome.
Happy coding :)
I started this project after seeing this post, thanks to @taylorswift for the inspiration.