Back to Cookbook
Environment Drift Check
Catch silent tool/version drift before it breaks CI or prod
Prevent subtle mismatches between laptops, CI runners, and staging by detecting drift in runtime versions, build flags, and dependency resolution.
CommunitySubmitted by CommunityWork15 min
INGREDIENTS
🐙GitHub
PROMPT
Create a skill called "Environment Drift Check". Given: - A repo and its CI definition - The expected runtime/tool versions (or infer them) Produce: - An environment contract checklist - A concrete env check script plan (commands + output format) - A CI step that fails with actionable remediation steps
How It Works
This recipe inventories the expected environment and continuously checks for drift using
lightweight probes (versions, checksums, critical env vars).
Triggers
- "It worked yesterday, today it doesn't" with no obvious code change
- CI starts failing after runner image updates or dependency resolver changes
- Multiple repos/services share a toolchain but don't pin versions
Steps
- Define the "golden" environment contract (runtime versions, package manager, OS assumptions).
- Add an `env:check` command that prints:
- versions (runtime, package manager, compiler),
- critical env vars presence (not secrets),
- checksums of lockfiles.
- Run `env:check` in CI and on dev machines (pre-push or pre-commit optional).
- Alert when drift is detected and link to a fix path (upgrade/downgrade instruction).
- Store drift events in a small log (so recurring culprits become visible).
Expected Outcome
- Fewer "mystery failures" caused by differing environments.
- Faster triage: drift is confirmed or eliminated in minutes.
Example Inputs
- "Show differences between my machine and CI runner."
- "Detect when Node/Java/Go versions diverge across devs."
- "Warn when lockfile changes aren't committed."
Tips
- Detect drift early; drift is cheaper to fix than a broken release branch.
Tags:#environment-setup#ci-cd#build-failures#developer-productivity