agentleFS
germanfndezgermanfndez/fiveai-skills/skills/ox-inventory/SKILL.md

ox-inventory

Skill19 starsChanged 2 months agoMITView on GitHub

Trigger: ox_inventory, items, stash, AddItem, RemoveItem, metadata, item registration, inventory hooks, shops. Server and client exports for ox_inventory.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Call everything through exports.ox_inventory:<fn>(...).

    line 20
  2. Very specific:

    Check CanCarryItem BEFORE taking payment or removing the traded item, never after.

    line 23
  3. Very specific:

    Never invent item names. An item must exist in data/items.lua or it silently fails.

    line 24
  4. Distinctive:

    Use hooks instead of polling when reacting to moves, opens or purchases.

    line 48

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

ox_inventory

Slot-based inventory with weight, metadata, stashes, shops and hooks. Supports ox_core, esx and qbx_core.

Activation Contract

Load this skill when the user asks to give, take, count or check items, register a stash or shop, define a new item, react to inventory actions, or migrate from qb-inventory or esx inventory.

Hard Rules

  • Call everything through exports.ox_inventory:<fn>(...). There is no global table.
  • Grant, remove and count items on the SERVER only. Client exports are for display and UI decisions.
  • AddItem can fail. Always check the return value: the player may be over weight or out of slots.
  • Check CanCarryItem BEFORE taking payment or removing the traded item, never after.
  • Never invent item names. An item must exist in data/items.lua or it silently fails.
  • inv is a player source, an identifier, or a stash id. Passing the wrong one returns nil, not an error.
  • Metadata makes items non-stackable when it differs. Do not put volatile data in metadata.

Decision Gates

GoalCall
Give an itemAddItem(inv, item, count, metadata, slot)
Take an itemRemoveItem(inv, item, count, metadata, slot)
Check space firstCanCarryItem(inv, item, count, metadata)
How many does the player haveGetItemCount(inv, item, metadata, strict)
Read one slotGetSlot(inv, slot)
Find items across slotsSearch(inv, 'slots'|'count', item, metadata)
Persistent storageRegisterStash(...)
Short-lived storageCreateTemporaryStash(properties)
React to a player actionregisterHook(event, cb, options)

Execution Steps

  1. Confirm ox_inventory starts after ox_lib and the framework core.
  2. Decide the side: mutation is server, display is client.
  3. For a trade or reward, order the calls: CanCarryItem -> take payment -> AddItem -> verify the return.
  4. Define any new item in data/items.lua before referencing it. Read rules/items.md.
  5. Use hooks instead of polling when reacting to moves, opens or purchases.

Output Contract

Return runnable Lua using exports.ox_inventory, with the server/client split explicit. Include the data/items.lua entry whenever a new item is introduced.

References

  • rules/server-exports.md — item and inventory functions on the server.
  • rules/client-exports.md — weight, current weapon, opening inventories.
  • rules/items.md — defining items in data/items.lua.
  • rules/stashes.md — stashes, shops and temporary storage.
  • rules/hooks.md — registerHook and cancelling actions.

Upstream docs: https://overextended.dev/ox_inventory

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.