Agent skill

Sokol Net

by elix22 in elix22/Sokol.NET

Sokol.NET framework development — use for ANY work in this repo: creating or debugging examples, building/running for desktop/Android/iOS/Web, writing or compiling shaders, adding a new C/C++…

MITAuto-check passedGame Development

Install Sokol Net

skills CLI
$ npx skills add elix22/Sokol.NET --skill sokol-net -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install elix22/Sokol.NET sokol-net --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/elix22/Sokol.NET.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/sokol-net .claude/skills/sokol-net && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
sokol-net
GitHub stars
154
Token cost
~2.8k tokens
SKILL.md length
996 words
Files
1
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Sokol.NET framework development — use for ANY work in this repo: creating or debugging examples, building/running for desktop/Android/iOS/Web, writing or compiling shaders, adding a new C/C++…

  • Works in 5 steps: NEVER hand-edit… → A change to shared C# or ext/ can… → UI must fit a phone (~360 logical px… → …
  • ANY work in this repo: creating
  • SKILL.md covers Hard rules (violations break…, Repo map, Building & running and Creating a new example, plus 7 more sections
  • Calls dotnet, git and adb

What it does

Sokol Net is an agent skill from elix22/Sokol.NET. Sokol.NET framework development — use for ANY work in this repo: creating or debugging examples, building/running for desktop/Android/iOS/Web, writing or compiling shaders, adding a new C/C++ library under ext/ and generating its C bindings with bindgen, rebuilding native libraries, and developing the framework itself under src/ (sokol bindings, Sokol.GUI, Framework/Render2D, imgui). Read BEFORE building, running, or editing bindings — the build system and binding generator have non-obvious rules.

Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Game Development, covering Shaders and Debugging. It works with C#, Android, iOS and C++. The repository describes itself as: Cross-platform graphics framework for C with .NET NativeAOT | Desktop • Mobile • Web | Direct3D • Metal • OpenGL • WebGL. The licence is MIT.

When your agent uses it

  • ANY work in this repo: creating
  • Debugging examples
  • Building/running for desktop/Android/iOS/Web
  • Compiling shaders

Example prompts

  • “/sokol-net”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. NEVER hand-edit src/sokol/generated/*.cs. It is generated from C headers.
  2. A change to shared C# or ext/ can silently break a different platform. State which
  3. UI must fit a phone (~360 logical px wide): overflowable content goes in a
  4. Shaders compile via MSBuild, never by invoking sokol-shdc directly
  5. Some directories under examples/ and ext/ are private repositories containing their

What it can do on your machine

Read from SKILL.md and the folder at commit 758c087. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • dotnet
    • git
    • adb
    • xcrun

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Sokol Net loads about 2.8k tokens when it runs. Until then it costs about 128 tokens; SKILL.md has 996 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~128
When it runs · the whole SKILL.md, loaded when a task matches
~2.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from elix22/Sokol.NET at commit 758c087, republished under its MIT licence (© elix22). 996 words, ~2,839 tokens.

Download SKILL.mdSave it as .claude/skills/sokol-net/SKILL.md (or your agent's skills folder).
name
sokol-net
description
Sokol.NET framework development — use for ANY work in this repo: creating or debugging examples, building/running for desktop/Android/iOS/Web, writing or compiling shaders, adding a new C/C++ library under ext/ and generating its C# bindings with bindgen, rebuilding native libraries, and developing the framework itself under src/ (sokol bindings, Sokol.GUI, Framework/Render2D, imgui). Read BEFORE building, running, or editing bindings — the build system and binding generator have non-obvious rules.

Sokol.NET Development

C# binding + application framework over the Sokol headers. One C# codebase targets Windows (D3D11), macOS/iOS (Metal), Linux (OpenGL/glsl430), Android (GLES3), and WebAssembly (WebGL2) via .NET NativeAOT. Home directory: /Users/elialoni/Development/Sokol.NET.

Hard rules (violations break the build or other platforms)

  1. NEVER hand-edit src/sokol/generated/*.cs. It is generated from C headers. Change the C header (or bindgen/) and run ./scripts/generate-bindings.sh.
  2. A change to shared C# or ext/ can silently break a different platform. State which platforms you verified on. WASM and Android GLES3 are the usual silent casualties.
  3. UI must fit a phone (~360 logical px wide): overflowable content goes in a ScrollView (src/GUI/Widgets/ScrollView.cs). See root CLAUDE.md §5 — mandatory.
  4. Shaders compile via MSBuild, never by invoking sokol-shdc directly: dotnet build examples/<name>/<name>.csproj -t:CompileShaders.
  5. Some directories under examples/ and ext/ are private repositories containing their own CLAUDE.md. If a directory's CLAUDE.md declares it private/proprietary, follow that file's rules first — and never git add such directories into this repo (no git add -A anywhere; stage exact paths only).

Repo map

src/sokol/            C# bindings: generated/ (26 files, DO NOT EDIT) + hand-written helpers
src/GUI/              Sokol.GUI — retained-mode widget toolkit (NOT Dear ImGui)
src/Framework/        Higher-level engine pieces (Assets, ECS, Scene, Renderer, Physics…)
src/Render2D/         GPU 2D renderer + particle system
src/imgui/            Dear ImGui bindings (from ext/cimgui)
ext/                  C/C++ submodules + ext/CMakeLists.txt (ONE file builds all native libs)
ext/sokol.c           Unified C compilation unit (includes the header implementations)
bindgen/              Python binding generator (gen.py = registry, gen_csharp.py = emitter)
libs/<plat>/<arch>/   Pre-built native libraries (committed; rebuild only when ext/ changes)
tools/SokolApplicationBuilder/   Cross-platform build orchestrator
tools/sokol-tools/    sokol-shdc shader compiler binaries
scripts/              build-*, generate-bindings.sh, add-project-to-vscode-config.*
docs/                 Deep guides — check here FIRST for any subsystem (list below)

One-time setup: ./register.sh (writes ~/.sokolnet_config/sokolnet_home) and git submodule update --init --recursive.

Building & running

tools/SokolApplicationBuilder is the orchestrator. Invocation pattern:

bash
dotnet run --project tools/SokolApplicationBuilder -- --task <task> --architecture <arch> [--type release|debug] --path examples/<name>
TaskPurpose
preparecompile shaders + copy assets (run before first desktop dotnet run)
buildfull build (+deploy/run on device for android/ios)
run / clean / cleanallas named
createproject --project my_app --destination <dir>scaffold a standalone project (docs/CREATE_PROJECT.md)
listdevicesenumerate attached Android/iOS devices (docs/DEVICE_LISTING.md)

Architectures: desktop (RID defaults to host), android, ios, web.

Fast paths:

bash
# Desktop, JIT (day-to-day dev loop — no NativeAOT wait):
dotnet run --project examples/cube/cube.csproj
# Web build, then serve:
dotnet run --project tools/SokolApplicationBuilder -- --task build --architecture web --path examples/cube
dotnet serve --directory examples/cube/bin/Release/net10.0/browser-wasm/AppBundle

.vscode/tasks.json has 500+ pre-made tasks (one per example × platform).

Creating a new example

Follow docs/CREATE_EXAMPLE.md. Anatomy of examples/<name>/ (copy from examples/cube):

  • <name>.csproj (desktop/mobile) and <name>web.csproj (WASM) — two csprojs per example.
  • Source/ — code. Entry: a sokol_main() returning sapp_desc with Init/Frame/Event/Cleanup callbacks; platform mains in Program.cs.
  • shaders/*.glsl — Sokol cross-compiled dialect; compiled output lands in shaders/compiled/.
  • Assets/, Directory.Build.props (per-example options: optional dynamic libs, package prefix, icons — docs/ANDROID_PROPERTIES.md, IOS_PROPERTIES.md, APP_ICON.md), wwwroot/ (web shell).

After creating: register VS Code tasks with ./scripts/add-project-to-vscode-config.sh <name>, run prepare, then verify desktop first, then web (web breaks most often), then mobile. For a project OUTSIDE the repo use --task createproject instead (template in docs/PROJECT_TEMPLATE.md).

Shaders

  • Write once in Sokol's .glsl dialect; -t:CompileShaders runs sokol-shdc for every backend: glsl430 (Linux), hlsl5 (D3D11), metal_macos/metal_ios, glsl300es (Android/WASM).
  • Full guide: docs/SHADER_GUIDE.md. Gotcha: RGBA32F/data textures read with texelFetch MUST be declared unfilterable-float + a nonfiltering sampler in sokol-shdc, or Mali GPUs panic.

Debugging examples

TargetHow
Desktopdotnet run (JIT — real breakpoints work); native crashes: lldb -- dotnet run …; sokol log → stderr
Androidadb logcat -s <AppTag>:V *:E (sokol log goes to logcat); --task build installs+launches; device pick: docs/ANDROID_DEVICE_SELECTION.md
iOSxcrun devicectl install/launch; logs in Console.app / devicectl output
Webbrowser devtools console; stale-build confusion → docs/Browser-Cache-Issues.md; struct-return crashes → see bindings section

Debug vs Release matters: NativeAOT Debug codegen is drastically slower — perf symptoms seen only in Debug are usually codegen, not your change. Graphics acceptance is visual: build + launch and give the user repro steps; the user supplies screenshots (Claude cannot screencapture here).

Known platform traps (verified, keep in mind when a bug "makes no sense"):

  • sapp_quit() is broken on stock Android — this repo's sokol_app.h defers shutdown post-frame and calls finishAndRemoveTask() via JNI.
  • NanoVG/Screen.Instance.Update() needs logical pixels (sw/dpr, sh/dpr) — passing physical clips drawing to the top-left quadrant.
  • ma_sound_stop() (MiniAudio) is not immediate; to silence a node instantly use ma_sound_uninit() + free.
Show full SKILL.md (451 more words)Show less

Adding a new ext/ library + C# bindings (the bindgen workflow)

Checklist — all steps required, in order:

  1. Vendor the source: git submodule add <url> ext/<lib> (or copy single-header libs in).
  2. Compile it natively: add it to ext/CMakeLists.txt (the ONE CMake file; follow the existing per-platform if (WIN32/APPLE/ANDROID/Emscripten/LINUX) guards). If the lib is C++ or must ship separately (like Assimp/Spine/Ozz), model it as an optional dynamic library configured via the example's Directory.Build.props instead of bundling into sokol.c.
  3. Register in the generator: add one row to the tasks list in bindgen/gen.py: [ '../ext/<lib>/<header>.h', '<prefix_>', ['<dep_prefix_', …] ] — prefix = the C symbol prefix to bind; dep prefixes = other bound libs whose types appear in this header. Output goes to src/sokol/generated/ by default (per-prefix overrides exist in gen_csharp.py).
  4. Generate: ./scripts/generate-bindings.sh. This also regenerates the struct-return wrapper headers (ext/sokol_csharp_internal_wrappers.h and per-lib variants): C functions returning structs by value cannot be P/Invoked from WASM, so the generator auto-creates *_internal(<args>, out*) C wrappers. A big new lib may need its own gen_c_<lib>_wrappers_header output wired in gen.py (copy the box2d/miniaudio pattern) and that header #included in the lib's compilation unit.
  5. Rebuild native libs for every platform you claim support for (next section) — the wrappers are C code; bindings without rebuilt libs = EntryPointNotFoundException.
  6. Smoke-test per platform, WASM explicitly — it is the platform the wrappers exist for. Read docs/C-Internal-Wrappers-Auto-Generation.md + docs/WebAssembly-Struct-Return-Workaround.md before touching any of this machinery.

Rebuilding native libraries (only when ext/ C/C++ changed)

bash
./scripts/build-xcode-macos.sh              # macOS
./scripts/build-ios-sokol-library.sh all    # iOS
./scripts/build-android-sokol-libraries-via-apk.sh  # Android (multi-arch: builds the `clear`
                                            # example APK debug+release and extracts the .so libs
                                            # into libs/android/ — NOT build-android-sokol-libraries.sh)
./scripts/build-web-library.sh              # Emscripten/WASM
./scripts/build-linux-library.sh            # Linux
.\scripts\build-vs2022-windows.ps1          # Windows

Outputs land in libs/<platform>/<arch>/ and are committed. Full doc: docs/BUILD_SYSTEM.md.

Framework development in src/

  • src/sokol: hand-written helpers wrap the generated bindings — extend via new hand-written files, never inside generated/.
  • src/GUI (Sokol.GUI) — retained-mode widgets, NanoVG-drawn. Rules:
    • There is ONE shared tween engine (AnimationManager) — never create a parallel one; never Unregister a tween from its own callback.
    • Validate clicks with HitTest(LocalPosition), not IsHovered.
    • A core GUI change must not break other consumers: rebuild all GUI consumers and regression-check the GUIDemo example's tabs before calling it done.
    • Button labels must never clip in any language — auto-size from MeasureText, never Label.Length heuristics.
  • Rendering split (standing rule): game/app views draw all 2D shapes on a Render2DSurface (GPU); NanoVG Draw() is for text only.
  • DPI: sapp_dpi_scale() lies on some Androids (returns 1.0) — scale UI from logical width (UiMetrics pattern); on WASM sapp_width() is physical/retina.

Key docs index (read the doc before reinventing)

docs/BUILD_SYSTEM.md · docs/SOKOL_APPLICATION_BUILDER.md · docs/CREATE_EXAMPLE.md · docs/CREATE_PROJECT.md · docs/SHADER_GUIDE.md · docs/C-Internal-Wrappers-Auto-Generation.md · docs/WEBASSEMBLY_BROWSER_GUIDE.md · docs/SOKOL_FILESYSTEM.md · docs/RENDER2D.md · docs/RENDER3D.md · docs/PHYSICS3D.md · docs/VSCODE_RUN_GUIDE.md · docs/QUICK_BUILD.md · docs/GITHUB_PAGES_SETUP.md (web deploy; macOS case-insensitivity breaks .wasm renames).

Definition of done

State acceptance criteria up front (root CLAUDE.md §4). A framework/example change is done when it builds and behaves on every platform it touches — at minimum desktop + web for rendering work, plus one real mobile device for UI/input work — and you have named the platforms verified.

© elix22, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/sokol-net of elix22/Sokol.NET.

Open the folder on GitHubat commit 758c087

Compare with similar skills

Sokol Net next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Sokol Net compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Sokol Net this skillelix22/Sokol.NET154—~2.8kAutomated safety check: PassMIT
Maui AI DebuggingRedth/Maui.Gtk101—~4.1kAutomated safety check: PassMIT
Debugging CodeJetBrains/skills3661 repos~3.8kAutomated safety check: PassNone
AppsFlyer Unity Bridge DebuggingAppsFlyerSDK/appsflyer-unity-plugin178—~492Automated safety check: PassMIT
Try Fix Alternative Approachdotnet/maui23k—~8.4kAutomated safety check: PassMIT
Genie API Service Docsqualcomm/qai-appbuilder247—~840Automated safety check: PassCustom licence

Similar skills

  • Maui AI Debugging

    Redth/Maui.Gtk

    End-to-end workflow for building, deploying, inspecting, and debugging .NET MAUI and MAUI Blazor Hybrid apps as an AI agent.

    101 GitHub stars~4.1k tokensUpdated 5 mo ago
    MobileAuto-check passed
  • Debugging Code

    JetBrains/skills

    Official

    A skill your agent uses for debugger-driven runtime root-cause analysis in Rider-supported solutions and projects, including .NET/C, F, VB, C++, Unity, Unreal Engine, and other GameDev or…

    366 GitHub starsUsed in 1 repo~3.8k tokens
    Game DevelopmentAuto-check passed
  • AppsFlyer Unity Bridge Debugging

    AppsFlyerSDK/appsflyer-unity-plugin

    Traces a failing call or callback between C# and the native Android or iOS wrappers of the AppsFlyer Unity plugin to find the first broken link.

    178 GitHub stars~492 tokensUpdated 5 days ago
    DevelopmentAuto-check passed
  • Official

    Attempts one alternative fix for a bug, runs the given test command against it and reports what happened, always differing from existing PR fixes.

    23k GitHub stars~8.4k tokensUpdated today
    DevelopmentAuto-check passed
  • Genie API Service Docs

    qualcomm/qai-appbuilder

    GenieAPIService technical documentation retrieval. An agent skill from qualcomm/qai-appbuilder.

    247 GitHub stars~840 tokensUpdated today
    DevelopmentAuto-check passed
  • Rsid SDK

    realsenseai/RealSenseID

    RealSenseID face authentication SDK reference. An agent skill from realsenseai/RealSenseID.

    122 GitHub stars~4.1k tokensUpdated 2 days ago
    Backend & APIsAuto-check passed

Questions about Sokol Net

What does Sokol Net do?

Sokol.NET framework development — use for ANY work in this repo: creating or debugging examples, building/running for desktop/Android/iOS/Web, writing or compiling shaders, adding a new C/C++…. NET.GUI, Framework/Render2D, imgui).

When should I use Sokol Net?

Sokol Net fits situations like: ANY work in this repo: creating; debugging examples; building/running for desktop/Android/iOS/Web; compiling shaders.

How do I install Sokol Net in Claude Code?

Run `npx skills add elix22/Sokol.NET --skill sokol-net -a claude-code`. Or copy the skill folder (.claude/skills/sokol-net in elix22/Sokol.NET) into .claude/skills/sokol-net in your project. Claude Code loads it when a task matches its description.

How do I install Sokol Net in Codex?

Run `npx skills add elix22/Sokol.NET --skill sokol-net -a codex`. Or copy the skill folder (.claude/skills/sokol-net in elix22/Sokol.NET) into .agents/skills/sokol-net in your project. Codex loads it when a task matches its description.

Can I use Sokol Net in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add elix22/Sokol.NET --skill sokol-net -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sokol-net, .gemini/skills/sokol-net, .github/skills/sokol-net and .opencode/skills/sokol-net in your project.

What does Sokol Net need to run?

Going by SKILL.md and its folder, Sokol Net needs the command-line tools its instructions call (dotnet, git, adb and xcrun). Our summary lists: Python 3.

Does Sokol Net access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Sokol Net safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Sokol Net use?

Sokol Net is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Sokol Net use?

About 2.8k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Sokol Net?

Skills that share tags, products or a category with Sokol Net: Maui AI Debugging (Redth/Maui.Gtk, 101 stars), Debugging Code (JetBrains/skills, 366 stars), AppsFlyer Unity Bridge Debugging (AppsFlyerSDK/appsflyer-unity-plugin, 178 stars) and Try Fix Alternative Approach (dotnet/maui, 23k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Sokol Net?

elix22 (a GitHub user) maintains it in elix22/Sokol.NET, which has 154 GitHub stars. The repository was last updated on October 8, 2026.

Source: elix22/Sokol.NET on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.