raylib
Skill1 starsChanged 5 months agoMITView on GitHub
Guide for developing 2D and 3D games using the Raylib framework (v6.0). Use for creating, structuring, and building games in C/C++ or Go, handling graphics, input, audio, 3D models, and compiling to WebAssembly.
In this repository6 other files it gives its agents.
- alvar-design-systemSkill
- ebitengineSkill
- estonian-grammarSkill
- unitySkill
- unreal-engineSkill
- skill-nameSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
Use bundled scaffolding instead of regenerating build files from memory.
- Distinctive: line 42
Do not read script source into context unless debugging the skill itself.
- Very specific: line 49
Web/HTML5 Loop: When targeting the web via Emscripten, you cannot use a blocking while(!WindowShouldClose()) loop.
- Very specific: line 50
Memory Leaks: Always pair Load* with Unload* (e.g., LoadTexture -> UnloadTexture).
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Raylib Game Development
This skill provides guidelines and patterns for building 2D and 3D games using Raylib, focusing on version 6.0 features.
Overview
Raylib is a highly modular, simple, and easy-to-use C library for videogame programming. It abstracts OpenGL and provides a straightforward imperative API without forcing any specific engine architecture (no built-in ECS, no hidden object models). It is widely used in C/C++, but also has extremely popular Go bindings (raylib-go).
Raylib 6.0 introduces major features like a Software Renderer backend (rlsw) for CPU-only rendering, new memory and Win32/Emscripten backends, redesigned Skeletal Animation System (GPU skinning with blending), redesigned fullscreen modes, and a massive new File System and Text Management API. It also introduces rexm, the official Raylib examples manager.
Reading Documentation
For detailed API usage and architectural patterns, read the bundled references:
references/architecture_patterns.md: Core concepts, game loop, memory management, and Web/HTML5 specific patterns.references/api_cheatsheet.md: Quick reference for window, drawing, input, textures, text, 3D models, and audio.references/deployment_guide.md: Production build pipelines, CMake setup, Emscripten (WebAssembly) compilation, and Go cross-compilation.references/ecosystem_libraries.md: Curated list of the best Raylib ecosystem libraries, GUI frameworks (raygui, Dear ImGui), extensions, and tools.
Templates and Scripts
Use bundled scaffolding instead of regenerating build files from memory.
- Run
scripts/new_project.pywhen creating a new raylib project. Prefer this over hand-assembling files.- Example:
python scripts/new_project.py --out ./my-game --name "My Game" --lang c --layout single - Supports
--lang c|cpp|goand--layout single|multi.
- Example:
- Read files under
templates/when adding a missing build file or matching the canonical project shape.templates/c/main.c: desktop and web loop withUpdateDrawFrame()andemscripten_set_main_loop().templates/c/CMakeLists.txt: raylib 6.0 FetchContent pattern.templates/multi-file/: screen-state-machine layout for larger games.
- Run
scripts/build.shorscripts/build.ps1for CMake desktop builds. - Run
scripts/build_web.shorscripts/build_web.ps1for Emscripten web builds (setRAYLIB_PATHfirst). - Run
scripts/cross_compile_go.shorscripts/cross_compile_go.ps1for raylib-go cross-compilation.
On Windows, use the .ps1 scripts. On Linux and macOS, use the .sh scripts. Run scripts from the skill directory or pass the user's project path as the first argument.
Do not read script source into context unless debugging the skill itself; execute scripts and use their output.
Best Practices
- Window Initialization First: You MUST call
InitWindow()before loading any textures, models, or shaders, because these require an active OpenGL context. - Flipping Textures: To draw a texture flipped horizontally or vertically, use
DrawTextureRec()orDrawTexturePro()and pass a source rectangle with a negative width or height. - Audio Streaming: Short sound effects should use
Sound(LoadSound,PlaySound). Long background music must useMusic(LoadMusicStream,PlayMusicStream) and MUST callUpdateMusicStream()every frame. - Web/HTML5 Loop: When targeting the web via Emscripten, you cannot use a blocking
while(!WindowShouldClose())loop. Extract the loop body into anUpdateDrawFrame()function and useemscripten_set_main_loop(). - Memory Leaks: Always pair
Load*withUnload*(e.g.,LoadTexture->UnloadTexture). - No Built-in Timers: Raylib does not have a built-in timer object. Manage time manually using
GetTime()(total time) andGetFrameTime()(delta time). - 3D GPU Skinning: For animated 3D models, Raylib 5.5+ supports GPU skinning. Ensure you use the updated skeletal animation API if performance is a concern.
- Language Choice: While Raylib is written in C, Alvar Laigna frequently uses Go (
raylib-go). When writing Go code, ensure you usegithub.com/gen2brain/raylib-go/rayliband handle CGO dependencies correctly. Before building ask developer which language is preferred for the project - C or Go.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

