Token导航 LogoToken导航

Agent Skill · 开发

env-config(环境配置)

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

env-config 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证为 MIT,第三方扫描有未通过项,按安装量在开发类的 21,746 个 Skill 里排第 20,337。

总安装 225周安装 9GitHub Stars 9下载 73核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/autumnsgrove/claudeskills --skill env-config

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

env-config 管理 Python 项目环境变量与 secrets,基于 UV 工具链实现安全多环境配置。适用于分离配置与代码、加密敏感信息与团队协作场景。支持 .env 文件加载、环境隔离与密钥轮换机制。使用前需初始化 UV 项目并避免提交含密钥的文件到版本库。

env-config 属于开发类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/env-config

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/autumnsgrove/claudeskills --skill env-config;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

env-config 怎么安装?

在终端执行 npx skills add https://github.com/autumnsgrove/claudeskills --skill env-config。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

env-config 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

env-config 需要什么权限?

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

env-config 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

env-config 用的人多吗?

公开数据是累计安装 225 次,近一周安装 9 次,下载 73 次,GitHub 9 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

env-config 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
env-config

环境配置 · 本页

2259接触敏感数据MIT未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Environment Configuration Skill

Overview

This skill provides comprehensive guidance for managing environment configurations, secrets, and environment variables in Python projects using UV (the modern Python package and project manager). It covers secure configuration patterns, multi-environment setups,.env file management, and secrets handling with encryption support.

Environment configuration is critical for separating configuration from code (12-factor app principles), managing secrets securely across environments, preventing credential leaks, and supporting team collaboration.

When to Use This Skill

Use this skill when you need to:

  • Set up environment configuration for a new Python project
  • Implement secure secrets management
  • Configure multi-environment setups (dev/staging/prod)
  • Migrate from hardcoded configs to environment variables
  • Audit existing configuration for security issues
  • Standardize configuration across team projects
  • Set up UV-based Python project with proper config management

Core Principles

1. Never Hardcode Secrets

  • All API keys, passwords, tokens go in environment variables or encrypted secrets
  • Configuration files with secrets must be in.gitignore
  • Use templates for sharing structure, not actual secrets

2. Separate by Environment

  • Different configurations for development, staging, production
  • Environment-specific.env files (.env.development,.env.production)
  • Clear naming conventions for environment variables

3. Fail Securely

  • Validate required environment variables on startup
  • Provide clear error messages for missing configuration
  • Use sensible defaults only for non-sensitive values

4. Use UV for Dependency Management

  • UV provides fast, reliable Python package management
  • Replaces pip, pip-tools, virtualenv, and more
  • Ensures reproducible environments across machines

5. Document Everything

  • Template files show structure without exposing secrets
  • README explains required variables and how to set them
  • Comments describe purpose and format of variables

UV Setup

Installing UV

# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# Or with pip
pip install uv

# Verify installation
uv --version

Initialize UV Project

# Create new project
uv init my-project
cd my-project

# Create virtual environment
uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Add dependencies
uv add python-dotenv cryptography pydantic

# Add dev dependencies
uv add --dev pytest pytest-env black ruff

Environment Configuration Workflow

Phase 1: Project Setup

1. Create Project Structure

# Initialize UV project
uv init your-project-name
cd your-project-name
uv venv
source .venv/bin/activate

2. Install Configuration Dependencies

uv add python-dotenv      # For .env file loading
uv add cryptography       # For secrets encryption (optional)
uv add pydantic          # For config validation (optional)
uv add --dev pytest pytest-env

3. Create Configuration Files

Essential files to create:

  • .env.template - Template showing required variables (commit this)
  • .env - Actual secrets (add to.gitignore)
  • .env.development - Development-specific config
  • .env.production - Production-specific config
  • config.py - Configuration loading module

4. Update.gitignore

# Add to .gitignore
cat >> .gitignore << 'EOF'
# Environment files
.env
.env.local
.env.*.local
secrets.json

# UV
.venv/
__pycache__/
*.pyc
.pytest_cache/
.ruff_cache/
EOF

Phase 2: Create Configuration Templates

1. Create.env.template

# .env.template - Commit this file
# Copy to .env and fill in actual values

# Application Settings
APP_NAME=MyApp
APP_ENV=development
DEBUG=true
LOG_LEVEL=INFO

# Database Configuration
DATABASE_URL=postgresql://user:password@localhost:5432/dbname
DATABASE_POOL_SIZE=5

# API Keys (Replace with actual keys)
ANTHROPIC_API_KEY=sk-ant-api03-xxx
OPENAI_API_KEY=sk-xxx
OPENROUTER_API_KEY=sk-or-v1-xxx

# Security
SECRET_KEY=generate-random-secret-key-here
JWT_SECRET=another-random-secret

# Feature Flags
ENABLE_ANALYTICS=false
ENABLE_CACHING=true

2. Create Config Loading Module

Create config.py - see references/api-reference.md for complete implementation:

import os
from pathlib import Path
from dotenv import load_dotenv

class ConfigError(Exception):
    """Raised when required configuration is missing."""
    pass

class Config:
    """Application configuration from environment variables."""

    def __init__(self, env: str = None):
        self.env = env or os.getenv('APP_ENV', 'development')
        self._load_env_file()
        self._validate_required()

    def _load_env_file(self):
        """Load appropriate .env file based on environment."""
        env_file = Path(f'.env.{self.env}')
        if env_file.exists():
            load_dotenv(env_file, override=True)
        if Path('.env').exists():
            load_dotenv('.env', override=False)

    @property
    def app_name(self) -> str:
        return os.getenv('APP_NAME', 'MyApp')

    @property
    def debug(self) -> bool:
        return os.getenv('DEBUG', 'false').lower() in ('true', '1', 'yes')

    # Add more properties as needed...

# Global config instance
config = Config()

For complete Config class with all properties and validation, see references/api-reference.md.

3. Use Config in Application

from config import config

def main():
    print(f"Starting {config.app_name} in {config.app_env} mode")

    if config.anthropic_api_key:
        # Use API key
        print("✓ API key loaded")

Phase 3: Multi-Environment Setup

1. Create Environment-Specific Files

.env.development:

APP_ENV=development
DEBUG=true
LOG_LEVEL=DEBUG
DATABASE_URL=postgresql://localhost:5432/myapp_dev

.env.production:

APP_ENV=production
DEBUG=false
LOG_LEVEL=WARNING
DATABASE_URL=postgresql://prod-host:5432/myapp_prod
SECRET_KEY=super-secure-random-key

2. Switch Between Environments

# Development (default)
uv run python main.py

# Production
export APP_ENV=production
uv run python main.py

Phase 4: Secrets Management

1. Using JSON Secrets (Alternative Pattern)

Create secrets_template.json:

{
  "anthropic_api_key": "sk-ant-api03-xxx",
  "openai_api_key": "sk-xxx",
  "database_password": "your-password-here",
  "comment": "Copy to secrets.json and fill in real values"
}

2. Load JSON Secrets

See references/api-reference.md for complete implementation:

import json
from pathlib import Path

def load_secrets(secrets_file: str = 'secrets.json') -> dict:
    """Load secrets from JSON with fallback to env vars."""
    if Path(secrets_file).exists():
        return json.load(open(secrets_file))
    # Fallback to environment variables
    return {
        'anthropic_api_key': os.getenv('ANTHROPIC_API_KEY', '')
    }

3. Encrypted Secrets

For encryption utilities and advanced secrets management, see:

  • references/advanced-topics.md - Encryption, rotation, auditing
  • scripts/env_helper.py - Encryption/decryption utilities

Configuration Validation

Using Pydantic for Type-Safe Config

from pydantic import BaseSettings, Field, validator

class Settings(BaseSettings):
    app_name: str = Field(default='MyApp', env='APP_NAME')
    app_env: str = Field(default='development', env='APP_ENV')
    database_url: str = Field(..., env='DATABASE_URL')  # Required

    @validator('app_env')
    def validate_env(cls, v):
        allowed = ['development', 'staging', 'production']
        if v not in allowed:
            raise ValueError(f'app_env must be one of {allowed}')
        return v

    class Config:
        env_file = '.env'

settings = Settings()

For complete Pydantic configuration examples, see references/api-reference.md.

Security Best Practices

1..gitignore Configuration

Always add to .gitignore:

.env
.env.local
.env.*.local
secrets.json
.env.production
.venv/

2. Secret Rotation

Implement regular API key rotation:

def rotate_api_key(old_key: str, new_key: str):
    """Rotate API key gracefully with backup."""
    # Implementation in references/advanced-topics.md

3. Environment Auditing

Regular security audits:

def audit_environment():
    """Check for security issues in environment variables."""
    # Implementation in references/advanced-topics.md

For complete security implementations, see references/advanced-topics.md.

Testing Configuration

Basic Test Setup

# conftest.py
import pytest
import os

@pytest.fixture
def test_env():
    """Set up test environment variables."""
    original = os.environ.copy()
    os.environ['APP_ENV'] = 'testing'
    os.environ['DEBUG'] = 'true'
    yield
    os.environ.clear()
    os.environ.update(original)

@pytest.fixture
def config(test_env):
    from config import Config
    return Config(env='testing')

Example Tests

def test_config_loading(config):
    assert config.app_env == 'testing'
    assert config.debug is True

def test_missing_required_var():
    from config import ConfigError
    with pytest.raises(ConfigError):
        Config()  # Missing required vars

For comprehensive testing guide, see references/testing-guide.md.

UV Commands Reference

# Dependency management
uv sync                    # Install all dependencies
uv add requests           # Add dependency
uv add --dev pytest       # Add dev dependency
uv remove requests        # Remove dependency

# Environment management
uv venv                   # Create virtual environment
uv lock --upgrade         # Update dependencies

# Running scripts
uv run python main.py     # Run with UV environment
uv run pytest            # Run tests

# Compatibility
uv pip compile pyproject.toml -o requirements.txt

Helper Scripts

This skill provides utility scripts in scripts/:

  • env_helper.py - Core utilities for env management

- Parse and validate.env files - Check for missing variables - Encrypt/decrypt secrets files - Compare environments - Generate.env templates

Usage:

# Validate .env file
python scripts/env_helper.py validate .env

# Encrypt secrets
python scripts/env_helper.py encrypt secrets.json secrets.encrypted

# Compare environments
python scripts/env_helper.py compare .env.development .env.production

Quick Reference

Setup Checklist

  • Install UV: curl -LsSf https://astral.sh/uv/install.sh | sh
  • Create project: uv init project-name
  • Create virtual env: uv venv
  • Add dependencies: uv add python-dotenv
  • Create .env.template from examples
  • Copy to .env and fill in secrets
  • Add .env to .gitignore
  • Create config.py module
  • Test configuration loading
  • Set up environment-specific configs
  • Implement validation
  • Add tests for configuration

Environment Variable Naming

Use consistent naming:

  • APP_* - Application settings
  • DATABASE_* - Database configuration
  • *_API_KEY - API keys and tokens
  • *_SECRET - Secret keys
  • ENABLE_* - Feature flags
  • *_URL - Service endpoints

Security Checklist

  • No secrets in version control
  • .env in .gitignore
  • Production secrets separate from dev
  • Required variables validated on startup
  • Secrets encrypted at rest (if needed)
  • Regular secret rotation
  • Team training on secure practices

Additional Resources

Documentation in This Skill

  • references/api-reference.md - Complete Config class implementation, Pydantic validation, JSON secrets loading
  • references/advanced-topics.md - Encryption, secret rotation, auditing, multi-tenant config, cloud integration
  • references/testing-guide.md - pytest setup, mocking, validation testing, CI/CD examples
  • references/troubleshooting.md - Common issues, environment-specific problems, debugging techniques

Examples Directory

  • .env.example - Comprehensive.env template
  • pyproject.toml - UV project configuration
  • secrets_template.json - JSON secrets template

External Resources

Troubleshooting

For common issues and solutions, see references/troubleshooting.md:

  • Environment variables not loading
  • Wrong environment loaded
  • UV sync failures
  • Import errors
  • Secrets decryption issues
  • Performance optimization
  • Security issues and remediation
  • Docker integration problems

Quick debug:

from dotenv import load_dotenv
load_dotenv(verbose=True)  # Shows loading process

适合场景

01

调用多模型

02

代码和文本生成

03

Agent 推理流程

04

OpenRouter 模型接入

能力概览

能力 1

统一调用多种 LLM

能力 2

支持 Claude、Gemini、Kimi 等模型

能力 3

适合聊天、代码和推理任务

能力 4

可作为 Agent 模型调用入口

平台分布

windsurf

28.75%
按下载量换算21

OpenCode

20.45%
按下载量换算15

Codex

15.71%
按下载量换算11

Claude Code

13.17%
按下载量换算10

Antigravity

8.24%
按下载量换算6

Gemini CLI

3.5%
按下载量换算3

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。

继续浏览同类 Skills