resource-best-practices
Installation
SKILL.md
Resource best practices
The defaults every FiveM resource follows, on any framework. The examples use ox_lib. Where a rule needs a framework hook, such as a logout event or a vehicle spawner, use the framework's own. This skill doesn't cover security or NUI. Keep every server-side check as it is.
Reference
Read each file whose condition the code meets.
| Read | When the code |
|---|---|
| ENTITIES.md | Creates, deletes or takes control of an entity, passes entity or network ids, attaches props, plays sounds, ragdolls a ped, or calls a native on an entity it may not own |
| LIFECYCLE.md | Creates something that needs cleanup (entities, blips, cameras, timers, per-player state), or registers handlers, commands or zones |
| EVENTS.md | Loops, triggers or handles events or callbacks, yields inside a server handler, or uses state bags |
| DATA.md | Queries the database, adds config or convars, or logs |
Writing
- Before writing, read every file whose condition your change meets.
- Follow those rules. In existing code, fix violations in the lines you touch, and list the others you saw at the end.