AGENTS.md@internal/modules · git:20261021.b28f51a · 2026-10-21 · sha256 d1c11223415347a6
AGENTS.md@internal/modules git:20261021.b28f51aA
Immutable. This exact content never changes and is served at /api/v1/blob/d1c11223415347a6.
# Module Guide
Interaction entry points: command, form, webhook, webservice, cron, page, event. Not provider clients. Repo-wide standing orders: root [AGENTS.md](../../AGENTS.md).
## Entry points
```text
modules/<name>/
├── module.go # moduleHandler + module.Base, Register(), Init(), Rules(), Webservice()
├── command.go / form.go / webhook.go / webservice.go
├── *_test.go
└── utils.go
```
`Register()` wired via `fx.Invoke` in `internal/modules/fx.go` → `modules.Modules`. Wired today: `example`, `hub`, `analytics`, `web`, `automate`. `analytics` has no HTTP rules; its pages live in `web`. Reference: `internal/modules/example/`.
## Boundaries
- Provider wiring belongs in `pkg/capability/<provider>/adapter.go`
- Routes: `/service/{module}/*` for module business APIs; hub **management** APIs under `/hub/*` — never put hub management under `/service/hub/*` (hub module business routes may still live under `/service/hub`). Exception: [web `GET /service/audit`](web/AGENTS.md).
## Testing
Which layer: [docs/testing/README.md](../../docs/testing/README.md). Owning BDD specs live under `tests/specs/`.