drawnui/drawnui.net/drawnui-web-app
Claude Code and agent skill by drawnui/drawnui.net
- community
- ext:[{"type":"plugin","description":"Custom plugin integration"}]
Checking that the SKILL.md file is still in the repository.
Scaffold a DrawnUi.Web app — pure WebAssembly (no Blazor) DrawnUI in the browser. Create a new standalone web app, or extract shared DrawnUI code from an existing app (MAUI/OpenTK) into a shared-source project and add a web head that references it. Also covers hunting intermittent WASM runtime bugs (frozen lotties, dead caches, Task.Run starvation) with probes + CPU throttling. Trigger on "drawnui web app", "drawnui.web", "drawnui.wasm", "DrawnUi.Wasm", "src/Wasm", "pure wasm drawnui", "run my drawnui app in browser", "extract drawnui shared code", "add web target to drawnui", "bug only on slow device", "lottie not playing in browser".
Install
npx vskill@latest install drawnui/drawnui.net/drawnui-web-appSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
DrawnUi.Web App Scaffolding
Create or extend a pure-WebAssembly DrawnUI app (DrawnUi.Web package — NO Blazor, NO Razor, only [JSImport]/[JSExport]). Built on the DRAWNUI_NET base (SharedNet + Net shims), same base as OpenTK.
Load the `drawnui` skill for control/layout/caching rules and `drawnui-fluent` for code-behind composition. This skill covers ONLY the project plumbing.
Naming note: the library project issrc/Wasm/DrawnUi/DrawnUi.Wasm.csproj. ItsPackageIdis `DrawnUi.Web` (also the static-asset base path), its assembly name is `DrawnUi.Wasm` (noAssemblyNameoverride). So:PackageReference Include="DrawnUi.Web",_content/DrawnUi.Web/drawnui-web.js, butgetAssemblyExports('DrawnUi.Wasm'). Game addon: packageDrawnUi.Web.Game(src/Wasm/Addons/DrawnUi.Wasm.Game).
Canonical reference in the DrawnUi repo: shared-source src/Shared/Samples/Pong.Shared (Pong.Shared.shproj + .projitems) consumed by the web head src/Wasm/Samples/PongWeb (the only pure-web sample; the same shared code also runs in MauiPong, OpenTkPong, WpfPong). Docs: docs/articles/web/index.md + getting-started.md.
Decide the flow
- New standalone web app → do PART A only.
- Existing DrawnUI app (MAUI/OpenTK) → also runs in browser → do PART B (extract shared) then PART A (web head imports shared).
Core rule: shared code is SHARED-SOURCE, not a class library
DrawnUI base types differ per target via #if and per-head NuGet package (DrawnUi.Maui vs DrawnUi.Web vs DrawnUi.OpenTk). A normal class library would bind to ONE package and break the others.
Use a Shared Project (.shproj + .projitems): the .cs files compile INTO each head with that head's package + constants. This is why Pong.Shared is .shproj, not a .csproj.
Put in shared: scenes, controls, game logic, view models, the Canvas/scene factory. Keep platform entry points (Main/MauiProgram) in each head.
PART A — Web head (new app, or web head for shared code)
A1. csproj
Microsoft.NET.Sdk.BlazorWebAssembly SDK (for static-asset/host plumbing) but NO Blazor code. WasmBuildNative=true is required so emcc relinks with the GPU js-library (SkiaSharpInterop.js) that DrawnUi.Web flows in through buildTransitive (without it a NuGet consumer fails to link: undefined symbol: InterceptBrowserObjects).
Match the SkiaSharp/HarfBuzz native-asset versions to what DrawnUi.Web itself references (check src/Wasm/DrawnUi/DrawnUi.Wasm.csproj: SkiaSharp 4.148.0, HarfBuzzSharp 14.2.0 at 1.10.6.22) to avoid native mismatch; a lower direct HarfBuzz pin than the package's is a NuGet downgrade.
A2. wwwroot/index.html
One <canvas id> + the loader module. Set touch-action:none on the canvas as the pre-boot default: with Gestures = Enabled the library replaces it with the axes the page can scroll (vertical always inside an iframe), Lock keeps none.
A3. wwwroot/main.js
Boots the runtime and calls the app's [JSExport] Main, wiring DrawnUI input/frame/resize. Copy the full reference from src/Wasm/Samples/PongWeb/wwwroot/main.js (showLoader / hideLoader / showError from drawnui-web.js, recursive Main lookup). Essential glue:
A4. Program.cs
RunAsync(elementId, factory) wires rendering, input, the rAF loop, resize, fonts and gestures.
PART B — Extract shared code from an existing DrawnUI app
B1. Create the shared project folder
B2. MyApp.Shared.shproj (one fresh GUID, reused below)
B3. MyApp.Shared.projitems (SAME GUID; list EVERY shared .cs)
B4. Move code + add to projitems
- Move scenes/controls/logic out of the existing head into
src/Shared/. - Add each moved file as a
<Compile Include=.../>in.projitems. - Expose a scene factory the heads call (e.g.
public static Canvas BuildScene()or aSkiaControlsubclass) instead of building the tree insideMain/MauiProgram.
B5. Import the shared project into EVERY head
Existing head (e.g. MAUI .csproj) and the new web head:
(Relative path from each head to the .projitems.) The existing head keeps its DrawnUi.Maui/DrawnUi.OpenTk package; the web head adds DrawnUi.Web. Same source, compiled per target.
B6. Guard platform-specific code in shared files
Audit moved code for MAUI-only APIs (MainThread, native handlers, FileSystem.OpenAppPackageFileAsync) and gate or abstract them.
Web-specific gotchas (carry from the drawnui skill)
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingdocs/skills/drawnui-web-app/SKILL.md
Popularity
- Repository stars
- 409
- Repository forks
- 39
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
pluginCustom plugin integration
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/drawnui/drawnui.net/drawnui-web-app)