Hi Dave, welcome!
You’ll need to register your directive. You can call RegisterDirective() (or RegisterHandlerDirective()) in init() somewhere to do that.
Make sure to read these docs about extending the HTTP Caddyfile, specifically this section about directives:
Also the next section about directive ordering is important. HTTP handlers are invoked in a certain order during requests, but it’s (unfortunately) impossible to properly put an extension’s directive in order unless it’s manually configured. So even though you register your directive, you’ll either have to add an order global option to the top of your Caddyfile or use it only within route { } blocks. The linked docs should explain this.
(We probably could make this more discoverable, but the introductory “Extending Caddy” tutorial is about modules generally and doesn’t go into specifics for different kinds of modules, like HTTP handlers. So I’m not sure how to improve the docs in that sense.)
Hope that helps.