env-configuration

Adding or reading env vars, updating .env.example, or validating config at startup with parseEnv / parseEnvOptional.

3,940 stars

Best use case

env-configuration is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Adding or reading env vars, updating .env.example, or validating config at startup with parseEnv / parseEnvOptional.

Teams using env-configuration should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/env-configuration/SKILL.md --create-dirs "https://raw.githubusercontent.com/latitude-dev/latitude-llm/main/.agents/skills/env-configuration/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/env-configuration/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How env-configuration Compares

Feature / Agentenv-configurationStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Adding or reading env vars, updating .env.example, or validating config at startup with parseEnv / parseEnvOptional.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Environment configuration

**When to use:** Adding or reading env vars, updating `.env.example`, or validating config at startup with `parseEnv` / `parseEnvOptional`.

## `LAT_` prefix convention

All application environment variables **must** be prefixed with `LAT_` so they do not collide with third-party services, Docker, or common names.

**Use `LAT_` for:**

- Database URLs and pool settings (`LAT_DATABASE_URL`, `LAT_PG_POOL_MAX`, …)
- Service endpoints the app reads (`CLICKHOUSE_URL`, `LAT_REDIS_HOST`, …)
- App ports (`LAT_API_PORT`, `LAT_WEB_PORT`, `LAT_INGEST_PORT`)
- Auth, email, OAuth, billing, CORS (`LAT_BETTER_AUTH_SECRET`, `LAT_MAILPIT_HOST`, …)
- Any new variable consumed by Latitude application code

**Do not use `LAT_` for:**

- `NODE_ENV`
- Docker-only init variables (`POSTGRES_USER`, `CLICKHOUSE_USER`, …)
- Config read only by container images (Weaviate, Redis in compose, etc.)
- Browser-exposed Vite vars: use **`VITE_LAT_*`** (Vite requires the `VITE_` prefix)

**Reference:** `.env.example` lists Docker “Services” vs “Latitude Application” (`LAT_*`) variables.

## `.env.example` maintenance

Every new variable **must** appear in `.env.example`:

- **Required:** uncommented with a sensible local default (e.g. `LAT_API_PORT=3001`)
- **Optional:** commented with a placeholder (e.g. `# LAT_STRIPE_SECRET_KEY=sk_test_xxx`)

## Parsing in code

**Always** use `parseEnv` or `parseEnvOptional` from `@platform/env` — never `process.env.FOO` ad hoc or unprefixed names for app config.

```typescript
// ❌ Bad - unprefixed or direct access
const port = Number(process.env.PORT)

// ✅ Good - pass the variable name string (parseEnv reads process.env internally)
import { parseEnv, parseEnvOptional } from "@platform/env"
import { Effect } from "effect"

const port = Effect.runSync(parseEnv("LAT_API_PORT", "number", 3001))
const dbUrl = Effect.runSync(parseEnv("LAT_DATABASE_URL", "string"))
```

For where configuration is wired in apps (clients, routes), see [architecture-boundaries](../architecture-boundaries/SKILL.md).

Related Skills

Environment configuration

3940
from latitude-dev/latitude-llm

**When to use:** Adding or reading env vars, updating `.env.example`, or validating config at startup with `parseEnv` / `parseEnvOptional`.

web-frontend

3940
from latitude-dev/latitude-llm

apps/web UI — routes, @repo/ui, TanStack Start server functions and collections, forms, Tailwind layout rules, design-system updates, and useEffect / useMountEffect policy.

toolchain-commands

3940
from latitude-dev/latitude-llm

Installing dependencies, running dev/build/test/lint, filtering packages, single-test runs, git hooks, preparing a clone (.env.development / .env.test), or Docker-backed local services and dev servers.

testing

3940
from latitude-dev/latitude-llm

Writing or debugging tests, choosing unit vs integration style, Postgres/ClickHouse tests, regenerating ClickHouse test schema, or exporting test helpers from packages without pulling test code into production bundles.

gh-issue

3940
from latitude-dev/latitude-llm

Create clear, actionable GitHub issues for bugs, features, and improvements. Issues are primarily consumed by LLMs, so optimize for agent readability and actionability.

effect-and-errors

3940
from latitude-dev/latitude-llm

Composing Effect programs, domain errors, HttpError, repository error types, or error propagation at HTTP boundaries.

database-postgres

3940
from latitude-dev/latitude-llm

Drizzle schema, repositories, RLS, SqlClient wiring, Postgres migrations, psql / reset, or platform mappers (toDomain* / toInsertRow).

database-clickhouse-weaviate

3940
from latitude-dev/latitude-llm

ClickHouse queries, Goose migrations, chdb test schema, Weaviate collections/migrations, or telemetry storage paths.

code-style

3940
from latitude-dev/latitude-llm

Biome formatting, import style, strict TypeScript, naming (including React file names), or generated files.

authentication

3940
from latitude-dev/latitude-llm

Sessions, sign-in/sign-up flows, OAuth, magic links, or organization context on the session.

Web app frontend (`apps/web`)

3940
from latitude-dev/latitude-llm

**When to use:** `apps/web` UI — routes, `@repo/ui`, TanStack Start server functions and collections, forms, Tailwind layout rules, design-system updates, and **`useEffect` / `useMountEffect` policy**.

Toolchain, commands, and CI

3940
from latitude-dev/latitude-llm

**When to use:** Installing dependencies, running dev/build/test/lint, filtering packages, single-test runs, git hooks, preparing a clone (`.env.development` / `.env.test`), or **Docker-backed local services and dev servers**.