Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Generate environment variable to CLI argument mapping with prefix support, type conversion, and fallback chains for configuration.
.claude/skills/a5c-ai-env-var-mapper/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -5% | 0% |
| case-06 | ✗→✓ | ▲ Improved | -5% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 103% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 149% | 0% |
| case-19 | ✗→✓ | ▲ Improved | 0% | 0% |
Generate environment variable to CLI argument mapping for flexible configuration.
Invoke this skill when you need to:
| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | language | string | Yes | Target language (typescript, python, go) | | prefix | string | No | Env var prefix (e.g., MYAPP_) | | mappings | array | Yes | Environment variable mappings | | dotenvSupport | boolean | No | Enable .env file support (default: true) |
json{ "mappings": [ { "envVar": "PORT", "argument": "port", "type": "number", "default": 3000, "description": "Server port" }, { "envVar": "DATABASE_URL", "argument": "database-url", "type": "string", "required": true, "sensitive": true }, { "envVar": "DEBUG", "argument": "debug", "type": "boolean", "default": false } ] }
typescriptimport { config } from 'dotenv'; import { z } from 'zod'; // Load .env file config(); const ENV_PREFIX = 'MYAPP_'; // Environment schema const envSchema = z.object({ PORT: z.coerce.number().default(3000), DATABASE_URL: z.string().min(1), DEBUG: z.coerce.boolean().default(false), LOG_LEVEL: z.enum(['debug', 'info', 'warn', 'error']).default('info'), }); // Get prefixed env var function getEnv(name: string): string | undefined { return process.env[`${ENV_PREFIX}${name}`] ?? process.env[name]; } // Build env object with prefix support function buildEnvObject(): Record<string, string | undefined> { return { PORT: getEnv('PORT'), DATABASE_URL: getEnv('DATABASE_URL'), DEBUG: getEnv('DEBUG'), LOG_LEVEL: getEnv('LOG_LEVEL'), }; } // Parse and validate environment export function loadEnvironment() { const env = buildEnvObject(); return envSchema.parse(env); } // Map env vars to CLI arguments export function envToArgs(): string[] { const env = loadEnvironment(); const args: string[] = []; if (env.PORT !== 3000) { args.push('--port', String(env.PORT)); } if (env.DATABASE_URL) { args.push('--database-url', env.DATABASE_URL); } if (env.DEBUG) { args.push('--debug'); } if (env.LOG_LEVEL !== 'info') { args.push('--log-level', env.LOG_LEVEL); } return args; } // Generate documentation export const ENV_DOCS = ` Environment Variables: ${ENV_PREFIX}PORT Server port (default: 3000) ${ENV_PREFIX}DATABASE_URL Database connection URL (required) ${ENV_PREFIX}DEBUG Enable debug mode (default: false) ${ENV_PREFIX}LOG_LEVEL Log level: debug|info|warn|error (default: info) `;
pythonimport os from dataclasses import dataclass from typing import Optional from dotenv import load_dotenv # Load .env file load_dotenv() ENV_PREFIX = 'MYAPP_' @dataclass class Environment: port: int = 3000 database_url: str = '' debug: bool = False log_level: str = 'info' def get_env(name: str) -> Optional[str]: """Get env var with prefix fallback.""" return os.getenv(f'{ENV_PREFIX}{name}') or os.getenv(name) def parse_bool(value: Optional[str]) -> bool: """Parse boolean from environment variable.""" if value is None: return False return value.lower() in ('true', '1', 'yes', 'on') def load_environment() -> Environment: """Load and validate environment variables.""" env = Environment() if port := get_env('PORT'): env.port = int(port) if database_url := get_env('DATABASE_URL'): env.database_url = database_url else: raise ValueError('DATABASE_URL is required') env.debug = parse_bool(get_env('DEBUG')) if log_level := get_env('LOG_LEVEL'): if log_level not in ('debug', 'info', 'warn', 'error'): raise ValueError(f'Invalid LOG_LEVEL: {log_level}') env.log_level = log_level return env def env_to_args() -> list[str]: """Convert environment to CLI arguments.""" env = load_environment() args = [] if env.port != 3000: args.extend(['--port', str(env.port)]) if env.database_url: args.extend(['--database-url', env.database_url]) if env.debug: args.append('--debug') if env.log_level != 'info': args.extend(['--log-level', env.log_level]) return args ENV_DOCS = f''' Environment Variables: {ENV_PREFIX}PORT Server port (default: 3000) {ENV_PREFIX}DATABASE_URL Database connection URL (required) {ENV_PREFIX}DEBUG Enable debug mode (default: false) {ENV_PREFIX}LOG_LEVEL Log level: debug|info|warn|error (default: info) '''
gopackage config import ( "fmt" "os" "strconv" "strings" "github.com/joho/godotenv" ) const EnvPrefix = "MYAPP_" type Environment struct { Port int DatabaseURL string Debug bool LogLevel string } func init() { // Load .env file if present godotenv.Load() } func getEnv(name string) string { if val := os.Getenv(EnvPrefix + name); val != "" { return val } return os.Getenv(name) } func parseBool(value string) bool { lower := strings.ToLower(value) return lower == "true" || lower == "1" || lower == "yes" || lower == "on" } func LoadEnvironment() (*Environment, error) { env := &Environment{ Port: 3000, Debug: false, LogLevel: "info", } if port := getEnv("PORT"); port != "" { p, err := strconv.Atoi(port) if err != nil { return nil, fmt.Errorf("invalid PORT: %s", port) } env.Port = p } env.DatabaseURL = getEnv("DATABASE_URL") if env.DatabaseURL == "" { return nil, fmt.Errorf("DATABASE_URL is required") } env.Debug = parseBool(getEnv("DEBUG")) if logLevel := getEnv("LOG_LEVEL"); logLevel != "" { valid := []string{"debug", "info", "warn", "error"} found := false for _, v := range valid { if v == logLevel { found = true break } } if !found { return nil, fmt.Errorf("invalid LOG_LEVEL: %s", logLevel) } env.LogLevel = logLevel } return env, nil }
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 23,816 | 13,417 | -44% | 1 | 1 | 0% | 5,325 | 5,050 | -5% | 0 | 0 | — |
case-02 | fail→fail | 25,872 | 15,805 | -39% | 1 | 1 | 0% | 4,626 | 5,757 | +24% | 0 | 0 | — |
case-03 | fail→fail | 14,164 | 10,136 | -28% | 1 | 1 | 0% | 2,828 | 3,962 | +40% | 0 | 0 | — |
case-04 | fail→fail | 6,900 | 10,017 | +45% | 1 | 1 | 0% | 1,552 | 4,338 | +180% | 0 | 0 | — |
case-05 | fail→fail | 13,001 | 12,129 | -7% | 1 | 1 | 0% | 2,489 | 4,466 | +79% | 0 | 0 | — |
case-06 | fail→pass | 22,663 | 12,629 | -44% | 1 | 1 | 0% | 5,359 | 5,086 | -5% | 0 | 0 | — |
case-07 | fail→pass | 7,707 | 4,415 | -43% | 1 | 1 | 0% | 1,523 | 3,085 | +103% | 0 | 0 | — |
case-08 | fail→fail | 3,577 | 3,202 | -10% | 1 | 1 | 0% | 743 | 2,766 | +272% | 0 | 0 | — |
case-09 | fail→fail | 13,277 | 8,204 | -38% | 1 | 1 | 0% | 2,569 | 3,739 | +46% | 0 | 0 | — |
case-10 | fail→fail | 10,949 | 8,345 | -24% | 1 | 1 | 0% | 2,117 | 3,684 | +74% | 0 | 0 | — |
case-11 | fail→fail | 10,848 | 5,052 | -53% | 1 | 1 | 0% | 1,796 | 3,070 | +71% | 0 | 0 | — |
case-12 | fail→fail | 14,248 | 7,569 | -47% | 1 | 1 | 0% | 2,564 | 3,601 | +40% | 0 | 0 | — |
case-13 | fail→fail | 7,651 | 7,154 | -6% | 1 | 1 | 0% | 1,576 | 3,481 | +121% | 0 | 0 | — |
case-14 | fail→fail | 2,496 | 2,363 | -5% | 1 | 1 | 0% | 517 | 2,554 | +394% | 0 | 0 | — |
case-15 | fail→pass | 5,761 | 2,987 | -48% | 1 | 1 | 0% | 1,079 | 2,692 | +149% | 0 | 0 | — |
case-16 | fail→fail | 3,070 | 10,206 | +232% | 1 | 1 | 0% | 635 | 4,475 | +605% | 0 | 0 | — |
case-17 | fail→fail | 5,233 | 4,235 | -19% | 1 | 1 | 0% | 1,076 | 2,941 | +173% | 0 | 0 | — |
case-18 | fail→fail | 12,302 | 8,455 | -31% | 1 | 1 | 0% | 2,340 | 3,625 | +55% | 0 | 0 | — |
case-19 | fail→pass | 17,006 | 7,285 | -57% | 1 | 1 | 0% | 3,538 | 3,543 | +0% | 0 | 0 | — |
case-20 | fail→fail | 11,363 | 6,610 | -42% | 1 | 1 | 0% | 2,302 | 3,411 | +48% | 0 | 0 | — |
case-21 | fail→fail | 11,023 | 6,948 | -37% | 1 | 1 | 0% | 2,144 | 3,508 | +64% | 0 | 0 | — |
case-22 | fail→fail | 7,871 | 4,422 | -44% | 1 | 1 | 0% | 1,374 | 2,876 | +109% | 0 | 0 | — |
case-23 | fail→fail | 3,805 | 2,595 | -32% | 1 | 1 | 0% | 734 | 2,554 | +248% | 0 | 0 | — |
case-24 | fail→pass | 11,707 | 4,221 | -64% | 1 | 1 | 0% | 2,426 | 2,905 | +20% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 24 cases were attempted. The headline lift of +25 percentage points is the difference between those two pass rates over the 24 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.