How to write a lua plugin that is installable

Dear Community,

I am developing a plugin all about training neovim called nvim_training.
While I am good to go with most of the programming, I am stuck on the distribution.
This is obviously crucial to eventually publish the plugin and developing it with help from the community.

I did some research, but very few answers to these particular questions are available.
Through my experience with coding and computer science in general, I have identified the following hurdles:

How do I ensure that the installation works with “most” plugin managers?

My goal is to register a command like the following:

vim.api.nvim_create_user_command("Training", setup, {})

I am open to trying and tweaking until the plugin works for some subset of them,
but this seems error-prone and bound to raise conflicts between them.
I started with targeting packer because I use it myself.
As far as I can tell, most managers rely on some sort
of predetermined directory structure. Is this the case? How do I verify this?
I searched for “how to write an installable plugin” in various places and found nothing answering this particular question.

How do I load files relative to the plugin directory?

This is a question about Lua, but it fits into the goal stated above. After searching on stack overflow, I tried some version of starting
files relative to my current Lua file. But this seems ugly. Maybe this is solved by the packager manager? But my attempts have failed
because Lua was unable to locate my code after the installation.

How do I ship dependencies?

I rely on a luarock module for parsing JSON. I would like to include it with
the installation. Packer has support for these, but I would like to support most plugin managers eventually.

Edit: There has been a comment on reddit that mentioned the api vim.json.decode, which works in my use case. This question can be postponed.

I have posted a similar post over on reddit.
Since I found very little information on these topics, I will try to merge the answers into a “guide” after the fact.

Any help is appreciated.

Greetings,
Aaron

I saw that the person on reddit has already answered you. But just putting it here in case it helps. I tried writing plugin too, I saw most plugins follow this structure. You can use a variable to allow people to not load your plugin by providing a variable in format plugin_did_load .