Centralized config with env override
Skill kjuhwa/skills-hub/skills/cli/centralized-config-with-env-override
Centralized config thresholds with environment variable override pattern for timeouts and limitsFrom its SKILL.md
npx -y skills add kjuhwa/skills-hub --skill centralized-config-with-env-overrideAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 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.
SKILL.md
1.5 KB, 270 tokens by cl100k_base, as published. Nobody here has run it
Centralized config with env-override helpers
Define all runtime thresholds (timeouts, retry counts, size limits, score thresholds) in a single config module. Expose tiny typed helpers — envInt(name, default), envFloat(name, default), envStr(name, default) — that safely parse env vars and fall back.
Why
Prevents "magic numbers" from spreading across modules and gives ops a single, grep-friendly surface for tuning. Helpers guard against NaN from malformed env input.
Mechanism
const envInt = (n, d) => {
const v = parseInt(process.env[n], 10);
return Number.isFinite(v) ? v : d;
};
module.exports = {
VALIDATION_TIMEOUT_MS: envInt('VALIDATION_TIMEOUT_MS', 180_000),
HEARTBEAT_MS: envInt('HEARTBEAT_MS', 360_000),
SOLIDIFY_RETRIES: envInt('SOLIDIFY_RETRIES', 2),
BROADCAST_SCORE_MIN: envFloat('BROADCAST_SCORE_MIN', 0.7),
// ...
};
When to reuse
Any daemon or long-running CLI with dozens of tunable knobs. Prefer this over dotenv spread through the codebase.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.