Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/golid-ai/golidWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/golid-ai/golid/go-handler)<a href="https://agentmods.dev/rules/golid-ai/golid/go-handler"><img src="https://agentmods.dev/badge/rules/golid-ai/golid/go-handler/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/golid-ai/golid/go-handler"><img src="https://agentmods.dev/badge/rules/golid-ai/golid/go-handler.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.01160 |
| Opus 5.5 | $0.00000 | $0.00464 |
| Sonnet 5.5 | $0.00000 | $0.00232 |
| Haiku 4.5 | $0.00000 | $0.00116 |
Grade A, and why
go-handler scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 154 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Go Handler Layer Patterns
Thesis: Handlers are thin translators between HTTP and services. They validate input, extract auth, delegate to services, and return JSON — nothing more.
Refrain:
Extract → Validate → Delegate → Return
Reference files: auth.go, user.go, middleware/stack.go
Before modifying a module's handler (changes to validation, auth, or route
registration), read docs/modules/{module}/spec.md for API surface and
validation rules. For cross-module request chains, also check docs/flows.md.
Structure
type XHandler struct { xService xServicer }
func NewXHandler(xService *service.XService) *XHandler { ... }
- Handlers are thin — validate input, delegate to service, return JSON.
- No business logic in handlers. No direct DB access.
- Struct field is the interface (
xServicer), constructor takes the concrete type. This is the standard pattern —make new-modulegenerates it automatically.
Service Interfaces
Handlers use unexported interfaces (authServicer, userServicer, sseHubber), not concrete service types. This enables mock-based testing. Constructor takes concrete types (callers unchanged), struct field is the interface. See handler/interfaces.go.
Scaffold Output
make new-module name=items generates:
handler/item.go— Handler with interface-typed service fieldhandler/item_test.go— Mock struct + 5 test stubs (Create success, Create validation, List, GetByID not found, Delete)- Interface entry appended to
handler/interfaces.go - Fill in test bodies for your specific validation logic and error paths.
Auth Extraction
Every protected handler starts with:
userID, err := requireUserID(c)
if err != nil { return err }
userType, err := requireUserType(c)
if err != nil { return err }
Role guards (when needed) go after extraction:
if userType != "admin" {
return apperror.Forbidden("Only admins can create items")
}
Resource-level authorization is handled by the service layer, not the handler.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3mo ago First seen · 154 lines · 0 tokens per session scan A 09a97dd86628
go-handler is a cursor rule published in the GitHub repository golid-ai/golid (41 stars, last pushed 5mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,160 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
go-handler compared with cursor rules from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| go-handlergolid-ai/golid | Cursor rule | 41 | 5mo ago | MIT | A | 0 | Cursor |
| backend0xJacky/nginx-ui | Cursor rule | 12k | yesterday | AGPL-3.0 | A | 441 | Cursor |
| go-rulesbeel-collab/presets.dev | Cursor rule | 3 | 10d ago | MIT | A | 0 | Cursor |
| cursor-rule-templatesingchia/gospec | Cursor rule | 7 | 7mo ago | MIT | A | 0 | Cursor |
| go-backend-scalability-cursorrules-prompt-filePatrickJS/awesome-cursorrules | Cursor rule | 41k | 6mo ago | CC0-1.0 | A | 1,200 | Cursor |
| go-servemux-rest-api-cursorrules-prompt-filePatrickJS/awesome-cursorrules | Cursor rule | 41k | 6mo ago | CC0-1.0 | A | 389 | Cursor |
| usecasehiromaily/go-crypto-wallet | Cursor rule | 129 | 7mo ago | MIT | A | 0 | Cursor |