oxlib — скилл для Claude Code: что делает и как установить
Скилл для Claude Code помогает писать Lua-код для ox_lib в ресурсах FiveM. Подключается при работе с интерфейсом, зонами, командами или обменом данными между клиентом и сервером.
MIT 117 установок ★ 20 обновлён 2026-10-17
npx skills add germanfndez/fiveai-skills --skill oxlib -a claude-codeЧто делает oxlib
oxlib подсказывает, как использовать глобальный lib для уведомлений, диалогов, меню, полос прогресса, TextUI, callback-функций, команд и зон. Он формирует исполняемый Lua-код и явно указывает, какая часть работает на клиенте, а какая — на сервере.
Для нового ресурса скилл добавляет shared_scripts { '@ox_lib/init.lua' } в fxmanifest.lua. ox_lib должен запускаться раньше ресурса, иначе lib будет nil. UI-функции вызываются на клиенте, а lib.addCommand работает на сервере; зоны тоже нужно создавать на клиенте. Для сетевых запросов скилл предпочитает lib.callback вместо парных событий.
Какие задачи решает
- показать уведомление или диалог в ресурсе FiveM
- передать запрос между клиентом и сервером через callback
- добавить серверную команду с параметрами и ограничением доступа
- создать зону, реагирующую на вход и выход игрока
Примеры запросов агенту
- Добавь уведомление через
lib.notifyв мой ресурс FiveM. - Сделай запрос с клиента на сервер через
lib.callback.await. - Создай зону
lib.zones.boxс обработчиками входа и выхода.
Как установить oxlib
1Через Skills CLI (Vercel)
npx skills add germanfndez/fiveai-skills --skill oxlib -a claude-code2Вручную: положить файлы
~/.claude/skills/oxlib/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/oxlib/
1Через Skills CLI (Vercel)
npx skills add germanfndez/fiveai-skills --skill oxlib -a codex2Вручную: положить файлы
.agents/skills/oxlib/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add germanfndez/fiveai-skills --skill oxlib -a cursor2Вручную: положить файлы
.cursor/skills/oxlib/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install germanfndez/fiveai-skills skills/oxlib2Вручную: положить файлы
.github/skills/oxlib/SKILL.md1Через Skills CLI (Vercel)
npx skills add germanfndez/fiveai-skills --skill oxlib -a gemini-cli2Командой платформы
gemini skills install https://github.com/germanfndez/fiveai-skills --path skills/oxlibВручную: положить файлы
.devin/skills/oxlib/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add germanfndez/fiveai-skills --skill oxlib -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы об oxlib
Как установить oxlib в Claude Code?
Выполни npx skills add germanfndez/fiveai-skills --skill oxlib -a claude-code. Файл скилла устанавливается в ~/.claude/skills/oxlib/SKILL.md.
Что делает oxlib?
Скилл помогает писать Lua-код для интерфейса ox_lib, callback-функций, серверных команд и зон в FiveM. Он также подсказывает, где разместить код — на клиенте или сервере.
Что нужно для работы oxlib?
Нужна библиотека ox_lib: добавь shared_scripts { '@ox_lib/init.lua' } в fxmanifest.lua и запускай ox_lib раньше ресурса.
Исходный текст
SKILL.md · MIT
---
name: oxlib
description: "Trigger: ox_lib, lib.notify, lib.alertDialog, lib.inputDialog, lib.callback, lib.addCommand, lib.zones, menus, progress bars, keybinds, client-server callbacks. Use ox_lib UI, callbacks, commands and zones."
license: MIT
metadata:
author: germanfndez
version: "1.0.0"
---
# ox_lib
Shared FiveM library: UI (notify, dialogs, menus, progress), client/server callbacks, commands and zones via the global `lib`.
## Activation Contract
Load this skill when the user needs notifications, alert or input dialogs, menus, progress bars, TextUI, a client-server request/response, a typed server command, zones ("player enters/leaves area"), keybinds, or any resource that depends on ox_lib.
## Hard Rules
- Add `shared_scripts { '@ox_lib/init.lua' }` to `fxmanifest.lua` and ensure `ox_lib` starts before the resource; without it `lib` is nil.
- Prefer `lib.callback` / `lib.callback.await` over paired events or framework-specific callbacks for data across the network.
- `lib.callback.register(name, function(source, ...))` on the server receives `source` first; validate arguments there.
- Callback names must be unique (`resourcename:action`).
- UI functions (`lib.notify`, `lib.alertDialog`, `lib.inputDialog`, `lib.progress`, `lib.context`, `lib.menu`, `lib.showTextUI`) render on the CLIENT; from the server trigger the client to call them.
- Icons are Font Awesome 6, default style `solid`; brand icons use `{'fab', 'name'}`.
- `lib.addCommand` is SERVER-side; use `restricted` for permissions and typed `params` (`number`, `playerId`, `string`, `longString`).
- Zones: `onEnter`, `onExit` and `inside` do not work on the server; create zones on the client. Keep the returned zone to call `zone:remove()`.
- Modules load on first use or via `ox_libs { ... }` / `lib.require`.
## Decision Gates
| Need | Call |
|---|---|
| Toast message | `lib.notify({ title, description, type })` |
| Confirm / OK dialog | `lib.alertDialog({ header, content, centered, cancel })` |
| Form input | `lib.inputDialog(title, rows)` |
| Client asks server | `lib.callback.await(name, false, ...)` + server `lib.callback.register` |
| Server asks client | `lib.callback.await(name, source, ...)` + client `lib.callback.register` |
| Chat command with args | `lib.addCommand(name, { help, params, restricted }, cb)` |
| Area trigger | `lib.zones.poly` / `lib.zones.box` / `lib.zones.sphere` |
## Execution Steps
1. Add the manifest line and start order (read rules/init.md).
2. Pick the call from Decision Gates; read the matching rules file for the option table.
3. Put request handling on the server callback; put UI on the client.
4. Name callbacks and commands with the resource prefix.
5. Store zone handles for removal.
## Output Contract
Return runnable Lua using the global `lib`, with the manifest line when the resource is new and the client/server side explicit.
## References
- rules/init.md — fxmanifest, shared_script, ox_libs, lib.require.
- rules/callback.md — lib.callback, await, register on both sides.
- rules/interface.md — notify, alertDialog, inputDialog, other UI modules, icons.
- rules/addCommand.md — server commands with help, params, restricted.
- rules/zones.md — poly, box, sphere zones, methods and utilities.
Upstream docs: https://overextended.dev/ox_lib
© germanfndez · MIT · germanfndez/fiveai-skills