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/maccman/ai-monorepo-scaffoldWrote 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/maccman/ai-monorepo-scaffold/env-vars)<a href="https://agentmods.dev/rules/maccman/ai-monorepo-scaffold/env-vars"><img src="https://agentmods.dev/badge/rules/maccman/ai-monorepo-scaffold/env-vars/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/maccman/ai-monorepo-scaffold/env-vars"><img src="https://agentmods.dev/badge/rules/maccman/ai-monorepo-scaffold/env-vars.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.00012 | $0.01261 |
| Opus 5 | $0.00006 | $0.00630 |
| Sonnet 5 | $0.00002 | $0.00252 |
| Haiku 4.5 | $0.00001 | $0.00126 |
Grade A, and why
env-vars 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 9d 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.
Environment Variables (Astro Way): Astro provides type-safe environment variables. Follow these steps:
**1. Define in astro.config.ts:**
```typescript
// astro.config.ts
env: {
schema: {
MY_ENV_VAR: envField.string({
context: 'server', // 'server' or 'client'
access: 'secret', // 'secret' or 'public'
optional: false, // true if the variable is optional
}),
PUBLIC_API_URL: envField.string({
context: 'client',
access: 'public',
optional: false,
}),
},
},
```
**2. Import and use in your code:**
```typescript
// Server-side variables (access: 'secret', context: 'server')
import { DATABASE_URL, MAILGUN_WEBHOOK_SIGNING_KEY } from 'astro:env/server'
// Client-side variables (access: 'public', context: 'client')
import { LIVEKIT_API_KEY } from 'astro:env/client'
```
**Key guidelines:**
- **Server variables** (`context: 'server'`): Only accessible in server-side code, import from `astro:env/server`
- **Client variables** (`context: 'client'`): Accessible in both client and server code, import from `astro:env/client`
- **Secret variables** (`access: 'secret'`): Should never be exposed to the client
- **Public variables** (`access: 'public'`): Can be safely exposed to the client
- All environment variables are type-safe and validated at build time
- Ignore linter errors on recently created env vars. Astro needs to rerun its dev server to update its internal types references first.
**Example usage:**
```typescript
// apps/web/src/server/db.ts
import { setupDb } from '@app/db'
import { DATABASE_URL } from 'astro:env/server'
export const db = setupDb({
connectionString: DATABASE_URL,
})
```
Passing Environment Variables to tRPC: To make environment variables available in tRPC procedures, follow this pattern:
**1. Define the Env interface in context.ts:**
```typescript
// packages/api/src/context.ts
export interface Env {
appEndpoint: string
gcsProjectId: string
...
}
export interface Context {
db: Kysely<DB>
env: Env
session: Session | null
user: SelectableUser | null
}
```
**2. Pass environment variables in the tRPC handler:**
```typescript
// apps/web/src/pages/api/trpc/[trpc].ts
import { LIVEKIT_API_KEY } from 'astro:env/client'
import {
GCS_BUCKET,
GCS_CLIENT_EMAIL,
GCS_PRIVATE_KEY,
GCS_PROJECT_ID,
GEMINI_API_KEY,
LIVEKIT_API_SECRET,
LIVEKIT_URL,
PERPLEXITY_API_KEY,
} from 'astro:env/server'
async function createContext({ req }: CreateContextOptions): Promise<Context> {
const env: Env = {
appEndpoint: getAppEndpoint(req),
gcsProjectId: GCS_PROJECT_ID,
...
}
return { db, session: session ?? null, env, user }
}
```
**3. Access environment variables in tRPC procedures:**
```typescript
// In any tRPC procedure
export const myProcedure = protectedProcedure
.input(z.object({ /* ... */ }))
.mutation(async ({ ctx, input }) => {
// Access env vars through ctx.env
const gcsProjectId = ctx.env.gcsProjectId
// ... use the environment variables
})
```
**Key guidelines for tRPC env vars:**
- Always define new env vars in the `Env` interface in `context.ts`
- Import env vars from Astro's env system in the tRPC handler
- Map them to the `env` object in `createContext`
- Access them via `ctx.env` in any tRPC procedure
- This ensures type safety and centralized env var management
Build and CI Configuration: When adding new environment variables, you must also update build and CI configuration files:
**1. Update turbo.json:**
Add new environment variables to the `env` array under the `build` task so Turborepo can properly cache builds:
```json
// turbo.json
{
"tasks": {
"build": {
"outputs": ["dist/**"],
"dependsOn": ["^build"],
"env": [
"DATABASE_URL",
"AUTH_SECRET",
"MY_NEW_ENV_VAR", // Add your new env var here
// ... other env vars
]
}
}
}
```
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.
- 9d ago First seen · 154 lines · 12 tokens per session scan A bc6a33a52e59
env-vars is a cursor rule published in the GitHub repository maccman/ai-monorepo-scaffold (304 stars, last pushed 10mo ago), licensed MIT. It adds 12 tokens to every session and 1,261 once invoked, about $0.0001 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
ponytail
Ponytail, lazy senior dev mode. Always pick the simplest solution that works.
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
cli-error-handling
CLI command error handling patterns.
prefer-assertions-over-defensive-checks
Prefer assertions over defensive checks when data is guaranteed to be valid.
prefer-direct-imports-over-module-mocks
Prefer extracting a testable core over vi.mock / vi.resetModules when unit tests need to reach production logic entangled with config, env, or singletons.