Discourse 有自定义插件模板吗,如何写自定义插件呢

Yes, as linked above:

You can also run a dev env in Guthub Codespaces: