hazeliscoding

Sdl3 Porter — Development skill for Claude Code

Development community

Port SDL2 code to SDL3 without the bugs that still compile.

How to install Sdl3 Porter

This entry records only its repository, not the path inside it, so there is no exact command to give. Open hazeliscoding/sdl3-porter and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Sdl3 Porter does

Port SDL2 code to SDL3 without the bugs that still compile. An agent skill that runs SDL's rename scripts, fixes the build and catches runtime traps, each proven by fixtures in CI.

Alternatives in Development

  • Porters Five Forces — Porter's Five Forces competitive analysis with strategic insights 7.8k ★
  • MCP Language Server — mcp-language-server gives MCP enabled clients access semantic tools like get definition, references, rename, a 1.5k ★
  • Agentlas One — Turn the persistent Agentlas One personal agent on or off, or rename it 1.1k ★

README

sdl3-porter

**Port SDL2 code to SDL3 without the bugs that still compile.** sdl3-porter is an agent skill that ports C and C++ code from SDL2 to SDL3, then checks the port for the changes that build cleanly but break at runtime.

SDL's rename scripts handle most of a port, and the compiler catches most of the rest. Neither catches code that still compiles but now means something else. SDL3 functions return `true` on success, so a leftover `if (SDL_Init(...) != 0)` exits on every launch. A device opened with `SDL_OpenAudioDeviceStream` starts paused, so the ported game plays no sound. Textures now filter linearly by default, so pixel art blurs. Coding agents make the same mistakes, because most of the SDL code they learned from is SDL2.

**Status:** v1.0.2, tested against SDL 3.2.0 and 3.4.18, and evaluated on Sonnet 5 and Haiku 4.5. [ROADMAP.md](ROADMAP.md) has what's next.

![Claude Code loads sdl3-porter, ports the bounce sample, builds and runs it, and reports each trap it fixed by file, line and trap id](docs/demo/port.gif)

A real port of [`samples/bounce`](samples/bounce) with sdl3-porter 0.3.0 and Claude Opus 5.5, sped up 4×.

Before and after

This port compiles against SDL3 without a warning:

if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) != 0) {  // SDL3 returns true on success
    SDL_Log("SDL_Init failed: %s", SDL_GetError());
    return 1;                                          // so this runs on every launch
}

SDL_AudioStream *music = SDL_OpenAudioDeviceStream(
    SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, &spec, NULL, NULL);
SDL_PutAudioStreamData(music, samples, size);          // the device is paused: silence

The report after sdl3-porter fixes the port:

3 traps found, 3 fixed

src/main.c:14     bool-returns         SDL_Init returns true on success, so `!