Skip to main content
skill CX Codex

fivem-basics — Claude Code skill for FiveM resource structure

A FiveM Lua skill that lays out a resource across client, server and shared, writes the manifest and wires the sides with events and exports.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add germanfndez/fiveai-skills --skill fivem-basics -a claude-code
Open on GitHub

What fivem-basics does

The skill loads when you create or edit a FiveM resource, an fxmanifest.lua, a client*.lua or server*.lua, ask how events and exports work, or bring a bug that needs server console or F8 logs.

Eight reference files sit behind it: resource structure, manifest, client/server split, events, exports, debugging, optimization and doc links. The rules are strict about a few things. The manifest needs fx_version 'cerulean' and game 'gta5', networked events go through RegisterNetEvent, and money or item transactions stay on the server. GetInvokingResource() returns nil for any net event that crosses the network, so it is not an authentication check — validate types, ranges and server-owned state instead.

Choosing which side runs what is still your call; the skill gives the rules and a decision table. Event names are advised to follow resource:side:action.

What it helps with

  • split a resource into client, server and shared folders
  • write an fxmanifest.lua with the right entries
  • pick between TriggerServerEvent, TriggerClientEvent and a plain TriggerEvent
  • move money and item checks to the server
  • work out whether you need server logs or F8 logs

Example prompts for the agent

  • Create a FiveM shop resource: the client draws the menu, the server checks the money
  • Why did GetInvokingResource() return nil inside a net event handler?
  • Split this script into client and server and validate the handler arguments

How to install fivem-basics

1Skills CLI (Vercel)

npx skills add germanfndez/fiveai-skills --skill fivem-basics -a claude-code

2Manually: put the files in place

~/.claude/skills/fivem-basics/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/fivem-basics/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about fivem-basics

How do I install fivem-basics in Claude?

Run npx skills add germanfndez/fiveai-skills --skill fivem-basics -a claude-code. The skill lands in ~/.claude/skills/fivem-basics/SKILL.md.

What does fivem-basics do?

It explains how a FiveM resource is put together: manifest, client/server separation, networked events, exports and log-based debugging. It covers Lua.

How do networked events differ from local ones?

Networked events are registered with RegisterNetEvent; local-only ones use AddEventHandler alone. When data has to come back across the network, the skill points to a callback rather than paired events.

Source text

SKILL.md · MIT
---
name: fivem-basics
description: "Trigger: FiveM resource, fxmanifest, client/server script, RegisterNetEvent, TriggerServerEvent, TriggerClientEvent, exports, F8 logs, how FiveM works. Structure resources, manifests, events and exports for FiveM Lua."
license: MIT
metadata:
  author: germanfndez
  version: "1.0.0"
---

# FiveM basics

Resource structure, fxmanifest, client/server split, events, exports and debugging for FiveM Lua.

## Activation Contract

Load this skill when the user creates or edits any FiveM resource, `fxmanifest.lua`, `client*.lua` or `server*.lua`, asks how client/server, events or exports work, or reports a bug that needs server vs F8 logs.

## Hard Rules

- Manifest: `fx_version 'cerulean'` and `game 'gta5'` (or `'rdr3'` / `'common'`); every client-served file goes in `files`.
- Register networked events with `RegisterNetEvent`; local-only events use `AddEventHandler` alone, never `RegisterNetEvent`.
- Server handlers read the sender from `source`; broadcast with `TriggerClientEvent(event, -1, ...)`.
- `GetInvokingResource()` is nil for every net event that crosses the network; it is not an authentication check. Validate types, ranges and server-owned state instead.
- Never handle money or item transactions on the client; validate and apply on the server.
- No game natives in `shared_scripts` unless guarded by environment.
- Use `PlayerPedId()` not `GetPlayerPed(-1)`; use `#(a - b)` not `GetDistanceBetweenCoords`.
- Prefer `local`; prefer variable `Wait()` over fixed `Wait(0)`.
- Resource names use underscores, no spaces or special characters.

## Decision Gates

| Need | Use |
|---|---|
| Client to server | `TriggerServerEvent(event, ...)` |
| Server to one / all clients | `TriggerClientEvent(event, playerId \| -1, ...)` |
| Same side only | `TriggerEvent` + `AddEventHandler` |
| Data back across the network | a callback (ox_lib / framework), not paired events |
| Single-resource, non-networked call | a plain function, not an event |
| Cross-resource function | `exports` / `server_export` in manifest, `exports.res:fn()` |
| Bug with clean server console | ask for F8 client logs |

## Execution Steps

1. Lay out `client/`, `server/`, `shared/` and the manifest; read rules/structure.md and rules/fxmanifest.md.
2. Decide the side for each piece of logic (natives on client, data and validation on server).
3. Wire communication from Decision Gates; name events `resource:side:action`.
4. Validate every server handler argument; add distance and state checks.
5. Point to https://docs.fivem.net/natives/ for native lookups.

## Output Contract

Return the manifest plus runnable Lua split by side, with event names, validation and `source` handling explicit.

## References

- rules/structure.md — scope, client/server separation, naming.
- rules/fxmanifest.md — manifest entries, globbing, minimal example.
- rules/client-server.md — what runs where and how sides communicate.
- rules/events.md — register, trigger, naming, events vs functions, security.
- rules/exports.md — defining and consuming exports.
- rules/debugging.md — server console vs F8 logs.
- rules/optimization.md — locals, tables, natives, loops, security.
- rules/reference-links.md — official docs and natives reference.

Upstream docs: https://docs.fivem.net/docs/

© germanfndez · MIT · germanfndez/fiveai-skills

Similar skills

Everything for Game dev and 3D: Unity, Unreal, Godot, Blender →

From the same set4

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor