infra-env

Automates secure Next.js environment variable management with validation and .env.example generation.

9|2|Updated Jan 31, 2026
One-click install
npx skills add https://github.com/aussiegingersnap/cursor-skills --skill infra-env
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: infra-env
Source: https://github.com/aussiegingersnap/cursor-skills/tree/main/skills/infra-env
Command: npx skills add https://github.com/aussiegingersnap/cursor-skills --skill infra-env

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Environment variable management and security patterns tailored for Next.js projects, helping teams avoid secrets leakage and misconfigurations.

Core Features & Use Cases

  • Standardized variable naming with NEXT_PUBLIC_ prefixes and server-only variables
  • Template-driven .env.example creation and clear load-order guidance
  • Runtime validation and type-safe access to environment variables
  • Per-environment configuration for development, staging, and production workflows

Quick Start

Create a new Next.js project and implement the environment pattern using the guidelines in this skill.

Frequently Asked Questions about infra-env

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I securely manage environment variables in Next.js to prevent secrets leakage?

Secure environment variables in Next.js by standardizing variable naming with NEXT_PUBLIC_ prefixes, enforcing server-only variables, and applying runtime validation. This prevents secret leakage and misconfigurations across development, staging, and production environments.

What's the best way to validate Next.js environment variables with type safety?

Validate Next.js environment variables with type safety by applying runtime validation and type-safe access patterns. This ensures variables are correctly typed and loaded, preventing runtime errors caused by missing or malformed environment configurations.

How do I set up per-environment configuration for Next.js development, staging, and production?

Set up per-environment configuration by applying environment-specific variable loading patterns during project setup and ongoing configuration. This standardizes variable handling across development, staging, and production workflows to avoid misconfigurations.

When do I need to use NEXT_PUBLIC_ prefixes for Next.js environment variables?

Use NEXT_PUBLIC_ prefixes for Next.js environment variables when you need to expose public variables to the browser. Server-only variables omit this prefix, ensuring secrets remain isolated on the server and preventing accidental leakage.

Can I automate .env.example template creation for Next.js projects?

Automate .env.example template creation using template-driven generation patterns. This provides clear load-order guidance and documentation for required variables, ensuring teams understand configuration requirements without exposing actual secrets.