env-files

env-files is a cursor rule for Cursor from blockmatic/basilic. It costs 0 tokens per session (820 once invoked), scanned A, original, MIT.

A set of rules for managing environment files, which store settings that vary between development, testing, and production. It covers file templates, naming, and alignment with t3 createEnv.

In plain words
What is it for?
Use it when creating environment-file templates, choosing environment variable names, or keeping them aligned with t3 createEnv.
Why use it?
It helps keep environment settings organised and consistent across the project.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when creating environment-file templates, choosing environment variable names, or keeping them aligned with t3 createEnv.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/blockmatic/basilic/env-files
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.

Clone the repo
git clone --depth 1 https://github.com/blockmatic/basilic

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 env-files

README.md
[![agentmods](https://agentmods.dev/badge/rules/blockmatic/basilic/env-files/github.svg)](https://agentmods.dev/rules/blockmatic/basilic/env-files)
Your own site
<a href="https://agentmods.dev/rules/blockmatic/basilic/env-files"><img src="https://agentmods.dev/badge/rules/blockmatic/basilic/env-files/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.

agentmods 80×15 button for env-files

Your own site · 80×15
<a href="https://agentmods.dev/rules/blockmatic/basilic/env-files"><img src="https://agentmods.dev/badge/rules/blockmatic/basilic/env-files.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 820 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00820
Opus 5.5 $0.00000 $0.00328
Sonnet 5.5 $0.00000 $0.00164
Haiku 4.5 $0.00000 $0.00082

Measured 1mo ago against content hash fb5c1722669f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

env-files 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 1mo 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.

.cursor/rules/base/env-files.mdc · 50 lines

How it starts

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

Source of truth

  • Runtime vars: each app’s createEnv in lib/env.ts or src/lib/env.ts (t3-oss + Zod). Adding/removing a var requires updating that schema and the committed template(s) for that app.
  • Do not document env vars only in README without a template line.

Secrets and commits

  • Never put real API keys, tokens, or production secrets in committed .env.<qualifier>.example templates, nor in .env.development, .env.staging, or .env.production. Use obvious placeholders (sk-ant-xxx, your_dynamic_environment_id).
  • .env, .env.local, and secret-bearing .env.test stay gitignored per app; ship .env.test.example where tests need a template.

Naming (templates) — pattern .env.<qualifier>.example

  • Canonical glob: **/.env.*.example (Cursor: @**/.env.*.example). Filenames must be .env. + one qualifier + .example (e.g. defaults, local, test). Do not add .env.sample, .env-example, or bare .env.example.
  • pnpm setup / pnpm setup:env copies each template to its dest when the dest is missing (never overwrites). Mapping: .env.defaults.example → .env; .env.<qualifier>.example → .env.<qualifier>.
  • Fastify API (apps/api): .env.defaults.example (copy to .env); .env.test.example → .env.test.
  • Next.js (apps/web, apps/mathler): .env.local.example (copy to .env.local); committed .env.development / .env.staging / .env.production only for non-sensitive defaults (NEXT_PUBLIC_*, etc.).
  • Expo (apps/mobile): .env.defaults.example with EXPO_PUBLIC_*.
  • Docu: committed .env.development; optional .env.defaults.example aligned with lib/env.ts.
  • Legacy: .env.schema may remain; update block-secret-files / gitleaks when renaming templates.

Next.js section order (web + mathler)

Use the same header order in .env.local.example and committed .env.*:

  1. Short header (what is committed vs local-only).
  2. Client / NEXT_PUBLIC_* (API URL, auth, logging, legal).
  3. Server-only / local secrets (JWT_SECRET, etc.) — template only where applicable.
  4. E2E / Playwright (PLAYWRIGHT_APP_URL, PLAYWRIGHT_API_URL on web; unify mathler on the same names; avoid duplicate BASE_URL / PLAYWRIGHT_TEST_BASE_URL without documented precedence).
  5. Optional integrations (Sentry, …).

Read the full file on GitHub · 50 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. 1mo ago Changed · +1 lines · -13 tokens per session fb5c1722669f
  2. 1mo ago First seen · 49 lines · 13 tokens per session scan A 1443846f2954

Subscribe to this mod's changes

env-files is a cursor rule published in the GitHub repository blockmatic/basilic (90 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 820 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.