Token导航 LogoToken导航TokenDH.com
开发敏感数据github未标认证来源可访问许可证需确认审计通过

infra-config-setup-env基础设施配置设置环境

Agent Skill

infra-config-setup-env 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

291

周安装

12

GitHub Stars

5

下载量

95
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:infra-config-setup-env(基础设施配置设置环境)
来源仓库:https://github.com/agents-inc/skills
仓库路径:skills/infra-config-setup-env
安装命令:
npx skills add https://github.com/agents-inc/skills --skill infra-config-setup-env
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/agents-inc/skills --skill infra-config-setup-env

简介

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在环境初始化阶段整理配置项。

  • 可将变量、依赖与部署参数结构化输出,辅助本地或云端环境搭建。
  • 通过 npx skills add 命令从指定仓库安装,需确认文件读写与变量注入边界。
  • 建议核对维护状态,避免在生产环境中直接应用未经验证的配置模板。
  • infra-config-setup-env 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Environment Management

Quick Guide: Per-app.env files. Framework-specific prefixes (NEXT_PUBLIC_* for Next.js, VITE_* for Vite). Zod validation at startup. Maintain.env.example templates. Never commit secrets (.gitignore). Environment-based feature flags.

<critical_requirements>

CRITICAL: Before Using This Skill

All code must follow project conventions in CLAUDE.md (kebab-case, named exports, import ordering, import type, named constants)

(You MUST validate ALL environment variables with Zod at application startup)

**(You MUST use framework-specific prefixes for client-side variables - NEXT_PUBLIC_* for Next.js, VITE_* for Vite)**

(You MUST maintain.env.example templates with ALL required variables documented)

(You MUST never commit secrets to version control - use.env.local and CI secrets)

(You MUST use per-app.env files - NOT root-level.env files)

</critical_requirements>


Auto-detection: Environment variables,.env files, Zod validation, t3-env, @t3-oss/env, secrets management, NEXT_PUBLIC_ prefix, VITE_ prefix, feature flags, z.stringbool

When to use:

  • Setting up Zod validation for type-safe environment variables at startup
  • Managing per-app.env files with framework-specific prefixes
  • Securing secrets (never commit, use.env.local and CI secrets)
  • Implementing environment-based feature flags

When NOT to use:

  • Runtime configuration changes (use an external feature flag service)
  • User-specific settings (use database or user preferences)
  • Frequently changing values (use configuration API or database)
  • Complex A/B testing with gradual rollouts (use a dedicated feature flag service)

Key patterns covered:

  • Per-app.env files (not root-level, prevents conflicts)
  • Zod validation at startup for type safety and early failure
  • T3 Env pattern for Next.js/Vite projects (recommended)
  • Framework-specific prefixes (NEXT_PUBLIC_* for client, VITE_* for Vite client)
  • .env.example templates for documentation and onboarding

Detailed Resources:

- examples/core.md - Essential patterns (per-app.env, Zod validation) - examples/t3-env.md - T3 Env pattern for Next.js/Vite (recommended) - examples/naming-and-templates.md - Framework prefixes,.env.example - examples/security-and-secrets.md - Secret management - examples/feature-flags-and-config.md - Feature flags, centralized config


Philosophy

Environment management follows the principle that configuration is code -- it should be validated, typed, and versioned. The system uses per-app.env files with framework-specific prefixes, Zod validation at startup, and strict security practices to prevent secret exposure.


Core Patterns

Pattern 1: Per-App Environment Files

Each app/package has its own .env file to prevent conflicts and clarify ownership.

File Structure

apps/
├── client-next/
│   ├── .env                    # Local development (NEXT_PUBLIC_API_URL)
│   └── .env.production         # Production overrides
├── client-react/
│   ├── .env                    # Local development
│   └── .env.production         # Production overrides
└── server/
    ├── .env                    # Local server config
    ├── .env.example            # Template for new developers
    └── .env.local.example      # Local overrides template

packages/
├── api/
│   └── .env                    # API package config
└── api-mocks/
    └── .env                    # Mock server config

File Types and Purpose

  1. .env - Default development values (committed for apps, gitignored for sensitive packages)
  2. .env.example - Documentation template (committed, shows all required variables)
  3. .env.local - Local developer overrides (gitignored, takes precedence over .env)
  4. .env.production - Production configuration (committed or in CI secrets)
  5. .env.local.example - Local override template (committed)

Loading Order and Precedence

Next.js loading order (highest to lowest priority):

  1. process.env (already set in environment)
  2. .env.$(NODE_ENV).local (e.g., .env.production.local)
  3. .env.local (not loaded when NODE_ENV=test)
  4. .env.$(NODE_ENV) (e.g., .env.production)
  5. .env

Vite loading order:

  1. .env.[mode].local (e.g., .env.production.local)
  2. .env.[mode] (e.g., .env.production)
  3. .env.local
  4. .env

Exception: Shared variables can go in your build tool's env configuration for cache invalidation

See examples/core.md for complete code examples.


Pattern 2: Type-Safe Environment Variables with Zod

Validate environment variables at application startup using Zod schemas. Define a schema, parse at startup, export a typed env object.

// lib/env.ts
const envSchema = z.object({
  VITE_API_URL: z.string().url(),
  VITE_API_TIMEOUT: z.coerce.number().default(DEFAULT_API_TIMEOUT_MS),
  VITE_ENABLE_ANALYTICS: z.stringbool().default(false), // Zod 4+ (NOT z.coerce.boolean())
});
export const env = envSchema.parse(import.meta.env);

Key gotchas:

  • z.coerce.boolean() converts "false" to true (string is truthy) - always use z.stringbool() instead
  • Use error.issues (not error.errors) for Zod 4 error handling
Note: For Next.js/Vite projects, consider T3 Env (@t3-oss/env-nextjs or @t3-oss/env-core) for client/server variable separation and build-time validation. See examples/t3-env.md.

See examples/core.md for complete good/bad comparisons.


Pattern 3: Framework-Specific Naming Conventions

Use framework-specific prefixes for client-side variables and SCREAMING_SNAKE_CASE for all environment variables.

Mandatory Conventions

  1. SCREAMING_SNAKE_CASE - All environment variables use uppercase with underscores
  2. Descriptive names - Variable names clearly indicate purpose
  3. Framework prefixes - Use NEXT_PUBLIC_* (Next.js) or VITE_* (Vite) for client-side variables

Framework Prefixes

Next.js:

  • NEXT_PUBLIC_* - Client-side accessible (embedded in bundle) - use for API URLs, public keys, feature flags
  • No prefix - Server-side only (database URLs, secret keys, API tokens)

Vite:

  • VITE_* - Client-side accessible (embedded in bundle) - use for API URLs, public configuration
  • No prefix - Build-time only (not exposed to client)

Node.js/Server:

  • NODE_ENV - Standard environment (development, production, test)
  • PORT - Server port number
  • No prefix - All variables available server-side

See examples/naming-and-templates.md for complete code examples with good/bad comparisons.


Integration Guide

Core dependencies:

  • Zod (v4+): Runtime validation and type inference for environment variables
  • T3 Env (@t3-oss/env-nextjs, @t3-oss/env-core): Recommended wrapper for client/server separation

Framework support:

  • Next.js: Automatic.env file loading with NEXT_PUBLIC_* prefix for client-side
  • Vite: Automatic.env file loading with VITE_* prefix for client-side

Monorepo considerations:

  • Declare shared env vars in your build tool's env configuration for cache invalidation
  • Use per-app.env files even in monorepos to prevent conflicts

Replaces / Conflicts with:

  • Hardcoded configuration values (use env vars instead)
  • Runtime feature flag services for simple boolean flags (use env vars first, upgrade when needing gradual rollouts)

<decision_framework>

Decision Framework

See reference.md for complete decision frameworks including environment configuration and feature flag decisions.

</decision_framework>


<red_flags>

RED FLAGS

High Priority Issues:

  • Committing secrets to version control (.env files with real credentials)
  • Using environment variables directly without Zod validation (causes runtime errors)
  • Using NEXT_PUBLIC_* or VITE_* prefix for secrets (embeds in client bundle)

Medium Priority Issues:

  • Missing.env.example documentation (poor onboarding experience)
  • Using production secrets in development (security risk)
  • Root-level.env in monorepo (causes conflicts)

Gotchas:

  • Next.js/Vite embed prefixed variables at build time, not runtime - requires rebuild to change
  • Environment variables are strings - use z.coerce.number() for numbers, use z.stringbool() for booleans (Zod 4+)
  • CRITICAL: z.coerce.boolean() converts "false" to true (string is truthy) - use z.stringbool() (Zod 4+) instead
  • Empty string env vars are NOT undefined - use T3 Env's emptyStringAsUndefined: true option
  • Monorepo build tool caches may NOT be invalidated by env changes unless declared in the tool's env configuration

See reference.md for complete RED FLAGS, anti-patterns, and checklists.

</red_flags>


<critical_reminders>

CRITICAL REMINDERS

All code must follow project conventions in CLAUDE.md

(You MUST validate ALL environment variables with Zod at application startup)

**(You MUST use framework-specific prefixes for client-side variables - NEXT_PUBLIC_* for Next.js, VITE_* for Vite)**

(You MUST maintain.env.example templates with ALL required variables documented)

(You MUST never commit secrets to version control - use.env.local and CI secrets)

(You MUST use per-app.env files - NOT root-level.env files)

Failure to follow these rules will cause runtime errors, security vulnerabilities, and configuration confusion.

</critical_reminders>

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.34%
按下载量换算34

Claude

29.62%
按下载量换算28

Cursor

20.22%
按下载量换算19

Gemini CLI

10.48%
按下载量换算10

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills