Take a look at any of the plugins on Download Caddy, look at their github repos to see how the files are structured.
Your module needs a name, generally it’s a github repo “URL” (not a real URL) which Go can use to pull the module.
You can do a module replacement using xcaddy to make it use your local copy when developing/debugging like this: --with github.com/your/module=../path/to/your/module. See the syntax here GitHub - caddyserver/xcaddy: Build Caddy with plugins