agentsclimarketplace

Env doctor

Skill YuAICode/ai-skills/skills/env-doctor

35 个即用 Claude Code skill,每个都带离线测试 + skill-doctor 自校验 · 35 tested, self-linted Claude Code skills (中文优先)

Install
npx -y skills add YuAICode/ai-skills --skill env-doctor

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

项目跑前环境配置体检:检测缺失的 .env 文件、对比 .env.example 找出未配置的 key 和空值 key,提前报警别等运行时炸。当用户说「体检环境 / 检查 env / .env 缺了什么 / 跑前配置检查 / 环境变量有没有配好」时触发。

SKILL.md

2.4 KB, as published. Nobody here has run it

env-doctor — 环境配置体检

项目跑前先体检,缺啥提前报,别等运行时炸一脸。

何时触发

用户说以下任意一种:

  • "体检环境 / 检查 env / 看看 env 配好没"
  • ".env 缺了什么 / 环境变量有没有配好"
  • "跑前配置检查 / 帮我检查一下环境配置"
  • "为什么程序读不到环境变量"

用法

  1. 跑体检脚本(纯 bash,无外部依赖):

    bash <skill>/bin/check-env.sh [项目目录]
    # 项目目录缺省 = 当前目录
    # 例:bash env-doctor/bin/check-env.sh ~/my-project
    
  2. 脚本自动识别模板文件(.env.example / .env.sample / .env.template)并输出:

    • 有模板没有 .env → 警告,给出 cp 命令
    • 有模板有 .env → 列出缺失的 key值为空的 key
    • 无缺失 → 配置完整提示
  3. 根据输出给用户中文说明:

    • 缺失 key:在 .env.example 里有,但 .env 里没有该行
    • 空值 key:key 存在但等号右侧为空(如 DB_PASSWORD=)
    • 建议编辑 .env 补全后再次运行体检确认
  4. 常见坑提醒:

    有些项目(如 Go、Java、C)不会自动加载 .env 文件。 跑程序前需手动导入:

    set -a; source .env; set +a
    

    只在当前 shell 生效;新终端或子进程需重新导入。

退出码约定

退出码含义
0配置完整,或无模板可对比
0有模板但 .env 缺失(警告,不阻断)
2存在缺失 key 或空值 key,需用户补全
1脚本本身出错(目录不存在等)

硬规则

  • 只读不改:脚本只读取 .env 和模板文件,绝不修改任何文件(除非用户明确要求补全)。
  • 不臆造 key 含义:不猜测 key 该填什么值,只列出缺失和空值;若用户问某个 key 怎么填,结合项目上下文作答。
  • 不联网、不扫历史:纯本地体检。

边界

  • 只解析 KEY=VALUE 格式的行;不处理 export KEY=VAL(export 前缀)的 shell 脚本风格(可扩展)。
  • 不检测 .env 里多余的 key(只看 .env.example 里有的)。
  • 不验证值的格式/有效性(如 URL 格式、token 长度),只看是否为空。

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.