> For the complete documentation index, see [llms.txt](https://laot7490.gitbook.io/ltbridge/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://laot7490.gitbook.io/ltbridge/for-contributors/creating-modules.md).

# Creating Modules

LTBridge is built so anyone can add modules without touching complex config. If you have a useful function, contribute it.

{% stepper %}
{% step %}

### Fork and create a folder

In the LTBridge repo, create:

```
modules/@MyCategory/MyFunction/
├── client.lua    (optional)
├── server.lua    (optional)
├── shared.lua    (optional)
└── module.json   (dependencies)
```

Use `@Category` for the namespace (becomes `LT.Category.*`).
{% endstep %}

{% step %}

### Write your code

Add EmmyLua comments for autocomplete:

```lua
--- Give the player a reward item.
--- @param source number Player source
--- @param item string Item name
--- @return boolean
function GiveReward(source, item)
    return LT.Inventory.AddItem(source, item, 1)
end
```

Put code in `client.lua`, `server.lua`, or `shared.lua` depending on where it runs.
{% endstep %}

{% step %}

### Declare dependencies

`module.json`:

```json
{
  "dependencies": [
    "@Inventory/AddItem"
  ]
}
```

LTBridge resolves these automatically when someone uses your module.
{% endstep %}

{% step %}

### Submit a pull request

We'll review and merge. Once released, everyone can use `ltbridge add MyCategory/MyFunction`.
{% endstep %}
{% endstepper %}

See also: [@ltbridge Annotations](/ltbridge/for-contributors/ltbridge-annotations.md)
