Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add cass-2003/local-workflow-skill --skill environment-configgit clone --depth 1 https://github.com/cass-2003/local-workflow-skillWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/cass-2003/local-workflow-skill/environment-config)<a href="https://agentmods.dev/skills/cass-2003/local-workflow-skill/environment-config"><img src="https://agentmods.dev/badge/skills/cass-2003/local-workflow-skill/environment-config/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/cass-2003/local-workflow-skill/environment-config"><img src="https://agentmods.dev/badge/skills/cass-2003/local-workflow-skill/environment-config.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00155 | $0.03149 |
| Opus 5.5 | $0.00062 | $0.01260 |
| Sonnet 5.5 | $0.00031 | $0.00630 |
| Haiku 4.5 | $0.00015 | $0.00315 |
Grade A, and why
environment-config scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 379 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Environment Config Skill — 配置管理
何时使用
- 启动 / 部署多环境项目(dev / staging / prod)
- 排查"为什么 prod 用了错的 DB"
- 防 secrets 进 git
- 设计配置注入到 Docker / K8s / Vercel / Lambda
- 区分 build-time vs runtime config
一、12-Factor #3:Config
"Config that varies between deploys is stored in environment variables."
关键:
- ✅ env vars 严格区分 code 与 deploy
- ✅ 不在 git 里
- ✅ 每个 deploy 自己一套
- ✅ 不同环境差异只在 env vars,code 完全相同
二、Config 层级(合并优先级)
[lowest → highest 优先级]
1. 代码默认值 (硬编码,最后兜底)
2. 配置文件默认 (config/default.yaml)
3. 环境特定文件 (config/production.yaml)
4. 本地覆盖文件 (config/local.yaml — gitignored)
5. 环境变量 (NODE_ENV / PORT / DATABASE_URL)
6. CLI flags (--port=8080)
后面的覆盖前面的。运行时 config = merge(defaults, files, env, flags)。
三、Secret vs Config
| 维度 | Config | Secret |
|---|---|---|
| 例子 | PORT, LOG_LEVEL, FEATURE_X_ENABLED |
DB 密码, API key, JWT secret |
| 谁能看 | 任何工程师 | 仅运维 / 管理员 |
| 存哪 | env vars / ConfigMap / yaml | Vault / Secrets Manager / K8s Secret + KMS |
| 轮换 | 罕见 | 定期轮换 |
| 日志 | 可打印 | 永远不打印 |
永远分开存。混在一起 → 给某人 read config 就给了 read secret。
四、.env 文件模式
# .env.example ← 加入 git,列所有需要的 key
DATABASE_URL=postgres://user:pass@localhost/mydb
REDIS_URL=redis://localhost:6379
JWT_SECRET=replace-me-in-prod
# .env ← gitignored,本机实际值
DATABASE_URL=postgres://localhost/mydb_dev
REDIS_URL=redis://localhost:6379
JWT_SECRET=dev-only-secret-12345
.gitignore 必须含:
.env
.env.local
.env.*.local
!.env.example
Node.js (Vite/Next 内置):
.env # 所有环境
.env.local # 本机覆盖(gitignored)
.env.development # dev 时
.env.production # prod 时
注意:.env.production 通常不进 git(实际 prod 值由 CI 注入),只有 .env.example 入仓。
五、加载与校验(启动即崩)
// src/config.ts
import { z } from 'zod'
import 'dotenv/config' // 仅 dev,prod 由部署平台注入
const Env = z.object({
NODE_ENV: z.enum(['development', 'staging', 'production', 'test']),
PORT: z.coerce.number().int().positive().default(8080),
DATABASE_URL: z.string().url(),
REDIS_URL: z.string().url().optional(),
JWT_SECRET: z.string().min(32, 'JWT_SECRET must be 32+ chars'),
LOG_LEVEL: z.enum(['debug','info','warn','error']).default('info'),
})
const result = Env.safeParse(process.env)
if (!result.success) {
console.error('Invalid env config:')
for (const issue of result.error.issues) {
console.error(` ${issue.path.join('.')}: ${issue.message}`)
}
process.exit(1)
}
export const env = result.data
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3mo ago First seen · 379 lines · 155 tokens per session scan A 45682971f59d
environment-config is a skill published in the GitHub repository cass-2003/local-workflow-skill (12 stars, last pushed 4mo ago), licensed MIT. It adds 155 tokens to every session and 3,149 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
environment-config compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| environment-configcass-2003/local-workflow-skill | Skill | 12 | 4mo ago | MIT | A | 155 | Claude Code, Codex |
| openshell-cliNVIDIA/OpenShell | Skill | 22k | 5d ago | Apache-2.0 | A | 134 | Claude Code, Codex |
| azd-deploymentsickn33/agentic-awesome-skills | Skill | 51k | today | MIT | A | 37 | Claude Code |
| kubernetes-architectsickn33/agentic-awesome-skills | Skill | 51k | today | MIT | A | 31 | Claude Code |
| tao-run-on-slurmNVIDIA/skills | Skill | 4.3k | today | Apache-2.0 | A | 94 | Claude Code |
| cdf-orchestration-setupNVIDIA/skills | Skill | 4.3k | today | Apache-2.0 | A | 105 | Codex |
| langbot-deploylangbot-app/LangBot | Skill | 19k | today | Apache-2.0 | B | 104 | Claude Code, Codex |