← ClaudeAtlas

env-detectivelisted

Diagnose "works on my machine" divergence — a test/build that passes locally but fails in CI (or on a teammate's machine, or in Docker, or in prod) with the SAME code. Use whenever the user says "passes locally but fails in CI", "works for me but not for them", "only fails in Docker/on the server", "green here, red there", or shows a CI failure they can't reproduce. The bug is in the DIFFERENCE between the two environments, and this skill finds it by diffing environments systematically instead of rereading the code for the fifth time.
0xmortuex/claude-code-skills · ★ 0 · DevOps & Infrastructure · score 72
Install: claude install-skill 0xmortuex/claude-code-skills
# env-detective When the same commit behaves differently in two places, the code is the one thing you can rule out. The bug lives in the delta between the environments — and staring harder at the code (the instinctive move) cannot find it. The method: **enumerate the delta, rank it by base rates, and binary-search it with experiments.** Never speculate when you can diff. ## Step 1: pin down the actual failure Get the *exact* failing output from the failing environment — the full CI log for the failing step, not the user's summary of it. Confirm both sides really run the same commit (`git rev-parse HEAD` vs the sha CI checked out — "it fails on CI" regularly turns out to be "CI runs main, I'm on my branch"). Note *what kind* of failure: different test result, compile error, missing file, hang, crash. Each points at a different slice of the delta. ## Step 2: enumerate the delta — collect facts, not vibes Gather the same facts from both sides (locally: run the commands; for CI: read the workflow file, the runner image docs, and add a debug step printing them if needed): - **Toolchain versions**: language runtime, package manager, compiler, relevant CLIs (`node -v`, `python -V`, `rustc -V`…). Minor versions count. - **Dependency state**: does the lockfile fully pin, and does the failing side actually install from it (`npm ci` vs `npm install`)? Any `latest` tags, floating ranges, or caches restoring stale deps? - **The tracked-files gap**: `git status --ignored` locally. CI