Command Palette

Search for a command to run...

Назад к скиллам
скилл № 12216

dev-ui-lesson

Add a UI lesson — TTF parsing, font rasterization, immediate-mode UI controls, layout

БесплатноБез исполняемых скриптов
Nebulavenusот Nebulavenus★ 51 звезда на GitHub

Установить dev-ui-lesson в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Create a new UI lesson teaching how to build an immediate-mode UI system from scratch — font parsing, text rasterization, layout, and interactive controls.

UI lessons produce CPU-side data (textures, vertices, indices, UVs) that a separate GPU lesson will later render. The UI library itself contains no GPU code — it is a pure data-generation layer.

When to use this skill:

  • You need to teach TTF font parsing or glyph rasterization
  • A learner wants to build immediate-mode UI controls (buttons, sliders, text)
  • You want to explain text layout, font metrics, or atlas packing
  • A lesson should cover UI patterns for games (health bars, inventories) or developer tools (property editors, debug overlays)

Smart behavior:

  • Before creating a lesson, check if an existing UI lesson already covers it
  • UI lessons are data-oriented — they output textures, vertex arrays, and index buffers, not rendered pixels
  • Focus on why each data structure exists and how it feeds into a renderer
  • Show visual results through BMP images generated by the program and diagram assets (matplotlib), not GPU rendering
  • Cross-reference math lessons (vectors, rects) and engine lessons (memory, structs) where the concept appears in practice

Arguments

The user (or you) can provide:

  • Number: two-digit lesson number (e.g. 01, 02)
  • Topic name: kebab-case (e.g. ttf-parsing, immediate-mode-basics)
  • Description: what this teaches (e.g. "Parse TTF font files, extract glyph outlines")

If any are missing, infer from context or ask.

Steps

1. Analyze what's needed

  • Check existing UI lessons: Is there already a lesson for this topic?
  • Check common/ui/: Does relevant library code already exist?
  • Identify the scope: What specific concepts does this lesson cover?
  • Find cross-references: Which math/engine/GPU lessons relate?

2. Create the lesson directory

lessons/ui/NN-topic-name/

3. Create a demo program (main.c)

A focused C program that demonstrates the UI concept by producing data and verifying it. UI lesson programs must write BMP images as their primary visual output. These images are committed to assets/ and embedded in the README so readers see results immediately. Programs typically:

  • Write output BMP images showing glyphs, atlases, or layouts
  • Parse or generate font/UI data structures
  • Print supplementary metrics, bounding boxes, or layout results to the console
  • Validate data correctness (glyph counts, atlas coverage, vertex winding)

Requirements:

  • Standalone — Builds independently with its own CMakeLists.txt
  • No GPU code — All output is CPU-side (images, vertex arrays, console)
  • Clear output — Shows the concept through printed results or saved images
  • Well-commented — Explains what's happening and why
  • Uses shared libraries — #include "math/forge_math.h" for vec2/rect math, #include "ui/forge_ui.h" for UI types (once the library exists)

Template structure:

/*
 * UI Lesson NN — Topic Name
 *
 * Demonstrates: [what this shows]
 *
 * SPDX-License-Identifier: Zlib
 */

#include <SDL3/SDL.h>
#include "math/forge_math.h"

int main(int argc, char *argv[])
{
    (void)argc;
    (void)argv;

    if (!SDL_Init(0)) {
        SDL_Log("SDL_Init failed: %s", SDL_GetError());
        return 1;
    }

    /* Demonstrate the UI concept here */

    SDL_Quit();
    return 0;
}

Console output formatting:

  • Use ASCII-only characters for console output (cross-platform compatibility)
  • Avoid Unicode box-drawing, symbols, or special characters that may not render on Windows Terminal
  • Good: -, =, *, |, ->, [OK], [!], "px", "glyph", "atlas"
  • Bad: ─, ═, •, ↓, →, ✓, ⚠ (may render as garbled text on Windows)

4. Create CMakeLists.txt

add_executable(NN-topic-name main.c)
target_include_directories(NN-topic-name PRIVATE ${FORGE_COMMON_DIR})
target_link_libraries(NN-topic-name PRIVATE SDL3::SDL3)

if(TARGET SDL3::SDL3-shared)
    add_custom_command(TARGET NN-topic-name POST_BUILD
        COMMAND ${CMAKE_COMMAND} -E copy_if_different
            $<TARGET_FILE:SDL3::SDL3-shared>
            $<TARGET_FILE_DIR:NN-topic-name>
    )
endif()

Adapt as needed: Later lessons may link against a shared UI library (common/ui/) once it exists.

5. Create README.md

Structure:

# UI Lesson NN — Topic Name

[Brief subtitle explaining what this teaches]

## What you'll learn

[Bullet list of UI concepts covered]

## Why this matters

[1-2 paragraphs connecting this topic to real game/tool UI development.
Explain when and why a developer will need this.]

## Result

[Brief description of what the example program produces]

[Embed PNG images generated by the program. The program writes BMP files
(no libpng dependency needed in C), so convert them to PNG before committing.
Copy the PNGs to the lesson's `assets/` directory and reference them with
`![alt
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл dev-ui-lesson?

Add a UI lesson — TTF parsing, font rasterization, immediate-mode UI controls, layout

Как установить скилл dev-ui-lesson?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл dev-ui-lesson запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить dev-ui-lesson с