skills/better-env/SKILL.md
Better environment variable management for agents and humans with full type safety, CLI-based remote environment synchronization, and environment validation. Use when setting up typed config schemas, validating env variables, or managing remote env vars across Vercel, Netlify, Railway, Cloudflare, and Fly.io with better-env.
npx skillsauth add neondatabase/better-env better-envInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Follow this best practice to manage environment variables in TypeScript applications with full type safety and clear server/public boundaries.
better-env exports configSchema to define typed env modules and recommends placing them in feature-level config.ts files (for example src/lib/auth/config.ts and src/lib/database/config.ts).
Learn more:
references/config-schema.mdRun env validation early so missing or invalid values fail fast before dev, build, or deploy steps.
better-env validate --environment <name> loads .env* files with Next.js semantics, discovers src/lib/*/config.ts modules, and checks every declared variable from your configSchema modules.
If your dotenv files intentionally include keys that are not referenced by config modules, add per-env suppressions in better-env.ts:
environments.<env>.ignoreUnused: string[]
These suppress only the selected local environment during validate.
Adapter defaults are merged in automatically; for Vercel,
VERCEL_OIDC_TOKEN is ignored by default in development, preview, and production.
Learn more:
references/env-validation.mdUse runtime configuration to keep local dotenv targets aligned with provider environments while preserving safe defaults.
Create better-env.ts with defineBetterEnv(...) and an adapter (vercelAdapter, netlifyAdapter, railwayAdapter, or cloudflareAdapter).
For a standard Vercel setup, prefer the minimal config:
export default defineBetterEnv({ adapter: vercelAdapter() });
Do not add an environments block when it only duplicates adapter defaults.
Add environments only when you intentionally need custom mappings, custom env files, or per-environment ignoreUnused behavior.
Learn more:
references/config.mdreferences/runtime.mdThe CLI gives a consistent workflow for initialization, sync, validation, and remote variable management, which is great for local development and CI automation.
Choose the command runner to match the repo:
npx in npm/pnpm-based repos (for example lockfiles like package-lock.json or pnpm-lock.yaml and scripts run via npm/pnpm).bunx in Bun-based repos (for example bun.lock and scripts run via bun).Recommended flow in a repo:
better-env init once to verify adapter prerequisites.better-env pull --environment <name> to sync local env files.better-env validate --environment <name> before app startup/build.add, upsert, update, delete, and load for remote env changes.Choose command behavior intentionally:
upsert for idempotent automation and scriptsadd when duplicate keys should failupdate when missing keys should faildelete to remove remote keysload for batch updates from dotenv filesLearn more:
references/cli.mdreferences/vercel-adapter.mdtools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
A CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.