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.
npx agentmods add rules/golid-ai/golid/dynamic-image-httpgit 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/dynamic-image-http)<a href="https://agentmods.dev/rules/golid-ai/golid/dynamic-image-http"><img src="https://agentmods.dev/badge/rules/golid-ai/golid/dynamic-image-http.svg" alt="Measured on agentmods" 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 | $0.00033 | $0.00820 |
| Opus 5 | $0.00016 | $0.00410 |
| Sonnet 5 | $0.00007 | $0.00164 |
| Haiku 4.5 | $0.00003 | $0.00082 |
Grade A, and why
dynamic-image-http 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 4d 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 — 97 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Dynamic Image HTTP
Thesis: HTTP-facing dynamic image endpoints need explicit cache posture, render budgets, and byte caps so clients/CDNs behave predictably without unbounded work or stale conditional-GET surprises.
Rule 3: Cache headers per response
Different paths emit different cache headers. Never use the same Cache-Control for all responses — it creates cache oracles for disabled or missing resources.
| Response | Cache-Control |
|---|---|
200 image/png (success) |
public, max-age=300, stale-while-revalidate=3600 |
304 Not Modified (ETag match) |
inherits success headers |
404 Not Found (any miss case) |
no-store |
500 Internal Server Error |
no-store |
The miss-case no-store is critical for privacy when the
endpoint resolves auth/visibility state — a max-age 404 would
let an attacker confirm a slug's existence via response time after
the cache expires.
Also set X-Content-Type-Options: nosniff on success responses so
clients don't sniff the bytes as something other than PNG.
Rule 4: Per-request render budget
Image rendering is CPU-bound and unbounded by default (a huge name
- long skills + many fields can take seconds). Always wrap the
render in a
context.WithTimeout.
const RenderBudget = 750 * time.Millisecond
func Handler(c echo.Context) error {
ctx, cancel := context.WithTimeout(c.Request().Context(), RenderBudget)
defer cancel()
img, err := RenderImage(ctx, profile)
// ...
}
func RenderImage(ctx context.Context, profile *Profile) (*Image, error) {
// Check ctx.Err() before each expensive step (gradient, text, encode)
if err := ctx.Err(); err != nil { return nil, err }
drawGradient(img)
drawText(...)
encodePNG(img)
return result, nil
}
A render that exceeds the budget returns 500 with no-store so a
transient slow render doesn't poison the cache.
Rule 5: Max encoded bytes ceiling
Define an explicit MaxBytes constant and reject renders that
exceed it. Unfurlers have their own caps (Slack 5MB, LinkedIn 5MB,
Twitter 5MB, Facebook 8MB) but you want to fail fast on a runaway
render before you hit the wire.
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.
- 4d ago First seen · 97 lines · 33 tokens per session scan A c16d12f16a1c
dynamic-image-http is a cursor rule published in the GitHub repository golid-ai/golid (40 stars, last pushed 2mo ago), licensed MIT. It adds 33 tokens to every session and 820 once invoked, about $0.0002 per session on Opus 5. 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.
Other cursor rules, from other repositories
adapter-features
Database-specific features must be implemented in the specialized adapter only. Base adapters (postgres, mysql, etc.) must remain database-agnostic.
unit-tests-tdd
TDD required for behavior changes; ≥80% package coverage on touched packages; unit-test conventions.
integration-tests
Human-readable integration test requests; helpers vs httptest; suites/ vs per-DB placement.
state-management
Use the following stack. Do not introduce or recommend Redux or React Context for shared/global state.
backend
You are an expert in Go, Gin, Gorm, Gen, Cosy (https://cosy.uozi.org/) with a deep understanding of best practices and performance optimization techniques in these technologies.
core
Core token-efficiency and response discipline rules. Always active.