deploy-infra

deploy-infra is a cursor rule for Cursor from golid-ai/golid. It costs 0 tokens per session (1,224 once invoked), scanned A, original, MIT.

Infrastructure rules for changing deployment scripts, Docker settings, environment variables, services, and Google Cloud configuration. They describe the full path from configuration files to service construction and deployment.

In plain words
What is it for?
Use them when adding environment variables, secrets, deployment settings, Docker changes, Cloud Run services, or infrastructure wiring.
Why use it?
They prevent configuration from being added in only one place, which can make local and deployed environments behave differently. They also keep secrets in Google Cloud Secret Manager rather than source files.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Install

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.

agentmods
npx agentmods add rules/golid-ai/golid/deploy-infra
Clone the repo
git clone --depth 1 https://github.com/golid-ai/golid

Made for: Cursor.

Wrote 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.

agentmods badge for deploy-infra

README.md
[![agentmods](https://agentmods.dev/badge/rules/golid-ai/golid/deploy-infra.svg)](https://agentmods.dev/rules/golid-ai/golid/deploy-infra)
Your own site
<a href="https://agentmods.dev/rules/golid-ai/golid/deploy-infra"><img src="https://agentmods.dev/badge/rules/golid-ai/golid/deploy-infra.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,224 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01224
Opus 5 $0.00000 $0.00612
Sonnet 5 $0.00000 $0.00245
Haiku 4.5 $0.00000 $0.00122

Measured 6d ago against content hash f5f96596f2c4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

deploy-infra scanned grade A with 1 finding 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 6d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- Health check: `HEALTHCHECK CMD curl -f http://localhost:8080/health || exit 1`
.cursor/rules/deploy-infra.mdc · 100 lines

How it starts

The opening of the file, as written. The whole thing — 100 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Infrastructure Change Patterns

Thesis: Every env var follows a full chain: config struct, env file, deploy script, service constructor. Secrets go through Secret Manager, never hardcoded.

High-risk, low-frequency changes. Follow the full chain for every modification.

Adding a New Environment Variable

Two chains depending on whether the value is a secret or plain config.

If it's a SECRET (API key, password, signing key):

  1. backend/internal/config/config.go — add field to Config struct + os.Getenv() in Load()
  2. config/.env.local — add with dev/sandbox value (local dev only)
  3. config/.env.example — add with placeholder
  4. Create in GCP Secret Manager: echo -n "value" | gcloud secrets create golid-{name}-{env} --data-file=- --project=PROJECT
  5. scripts/deploy.sh — add secret_exists guard + append to secrets string in ship_api()
  6. Service constructor in internal/wire/services.go (BuildServices) — pass cfg.NewField to the service

If it's plain CONFIG (URL, domain, feature flag):

  1. backend/internal/config/config.go — add field to Config struct + os.Getenv() in Load()
  2. config/.env.local — add with dev/sandbox value
  3. config/.env.example — add with placeholder (backend vars only)
  4. frontend/.env.example — add with placeholder (for VITE_* browser-exposed vars only). Per-environment values (e.g. QA vs prod VITE_API_URL) go in config/.env.{qa,prod} and are passed as build args during frontend image build.
  5. config/.env.qa — add with QA value
  6. config/.env.prod — add with production value
  7. scripts/deploy.sh — add to the env_vars block in ship_api() (if backend needs it at runtime)
  8. Service constructor in internal/wire/services.go (BuildServices) — pass cfg.NewField to the service
// config.go
type Config struct {
    // ...
    NewAPIKey string
}

// In Load():
NewAPIKey: os.Getenv("NEW_API_KEY"),

Docker Patterns

  • Multi-stage builds: build stage (Go compile) → runtime stage (minimal image)
  • Never copy .env files into images — env vars injected at runtime
  • Health check: HEALTHCHECK CMD curl -f http://localhost:8080/health || exit 1
  • Non-root user in production images

Read the full file on GitHub · 100 lines

Changes

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.

  1. 6d ago First seen · 100 lines · 0 tokens per session scan A f5f96596f2c4

Subscribe to this mod's changes

deploy-infra is a cursor rule published in the GitHub repository golid-ai/golid (40 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,224 tokens. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.