下载地址
https://www.zhengdianxue.com/wp-content/uploads/skills/user_2a94830e--user-2a94830e-environment-contract-auditor.zip将提示词发送给你的 AI 安装该 skills
请根据 https://skillhub.cn/install/skillhub.md,安装 @user_2a94830e/user-2a94830e-environment-contract-auditor。Compare a .env.example-style contract with runtime environment files and environment-variable references in Python, JavaScript, TypeScript, Go, Rust, Ruby, and PHP source. Use before deployment, containerization, CI setup, repository handoff, secret rotation, or debugging configuration drift.
阅读全文 (展开查看完整说明)
概述
Treat environment variables as a versioned interface between code and deployment.
Workflow
- Choose the repository's authoritative example file as
--contract. - Mark optional entries with an inline
# optionalcomment; empty values are otherwise treated as required. - Provide a runtime env file only when local access is appropriate. The report never includes values.
- Scan source directories for environment-variable references.
- Resolve errors before deployment: undocumented code references, missing required runtime keys, duplicate definitions, or credential-looking literals in the contract.
- Review warnings for unused keys and unsafe defaults.
- Update the contract and deployment configuration together.
Commands
python scripts/audit_env.py --contract .env.example --scan src --runtime .env --output env-report.md
python scripts/audit_env.py --contract .env.example --scan app --scan workers --format json --output env-report.json
python scripts/audit_env.py --contract .env.example --scan src --fail-on errorRead [references/contract-conventions.md](references/contract-conventions.md) for supported syntax and limitations.
Output Contract
Return only variable names, locations, categories, and severities. Never echo environment values. Distinguish errors from review warnings and state whether runtime coverage was checked.