environment-first
Skill98 starsChanged 2 months agoMITView on GitHub
When something that should work doesn't, suspect the environment before rewriting the code — wrong directory, stale build, missing env var, version mismatch, dirty state. Use when a command fails unexpectedly, tests fail that "can't" fail, behavior contradicts the code you're reading, or the error is command-not-found, module-not-found, connection refused, permission denied, "works in CI", or "works on my machine".
In this repository38 other files it gives its agents.
- ambiguity-commitSkill
- api-surface-careSkill
- calibrated-recommendationSkill
- codebase-orientationSkill
- concurrency-reasoningSkill
- config-and-flagsSkill
- context-checkpointSkill
- cross-platform-careSkill
- data-loss-guardSkill
- data-migration-safetySkill
- dependency-changesSkill
- docs-as-contractSkill
- edge-case-sweepSkill
- error-message-qualitySkill
- escalate-vs-decideSkill
- estimation-and-scopingSkill
- explain-at-the-right-levelSkill
- generalize-the-correctionSkill
- git-hygieneSkill
- incident-diagnosisSkill
- leave-no-messSkill
- llm-app-codeSkill
- numerical-careSkill
- performance-investigationSkill
- perf-sanitySkill
- question-vs-taskSkill
- resource-lifecycleSkill
- reviewing-a-changeSkill
- root-cause-debuggingSkill
- security-reflexesSkill
- stop-thrashingSkill
- subagent-fanoutSkill
- surgical-refactoringSkill
- task-decompositionSkill
- test-designSkill
- untrusted-content-guardSkill
- verify-ui-visuallySkill
- workmanshipSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
Re-run the original failing command and paste the output: If the failure vanishes, say so plainly: nothing was wrong with the code, and no …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
environment-first
Weak debugging assumes the code is wrong and starts editing. Often the code is fine and the world is misconfigured — and code edits made while the environment lies are wrong edits that then need reverting.
Heuristic: if the failure message doesn't mention your code's names at all (import errors, command-not-found, connection refused, permission denied), it's environment until proven otherwise.
Before editing any code
- Prove you're running the source you're reading. When behavior contradicts the code, you probably aren't executing that code: stale build artifact, cached bytecode, an installed copy shadowing the checkout, the wrong virtualenv/node_modules, a server started before the change. Test it directly: add a deliberate marker (a distinctive log line or a throw) to the file, rerun, and confirm the marker appears. No marker → rebuild/restart/reinstall until it does. Only then reason about the logic.
- Run the boring five and paste the outputs (under a minute, in order):
pwdplus current branch — right repo, right checkout?git status— unexpected local modifications or untracked files? runtime version (node -v,python --version, etc.) vs what the manifest or.nvmrc/.tool-versionsexpects? env vars and config files the code reads — set, and set to the value you assume? dependency install current — lockfile newer than the last install? - Run the exact failing command, not your paraphrase of it. Same cwd, same shell, same flags, same script name as CI or the user used. A different invocation that passes proves nothing about the one that fails.
- "Works on the other machine / in CI" is an environment diff by definition. Diff versions, env vars, OS, and filesystem assumptions (case sensitivity, path separators, line endings) before diffing the code.
- Flaky ≠ mysterious. Intermittent failure usually means shared state, port collisions, timing, or leftover files from a previous run. Clean state (kill stray processes, delete temp output, fresh clone if cheap) and rerun before blaming the test's logic.
After the environment is fixed
- Re-run the original failing command and paste the output. If the failure vanishes, say so plainly: nothing was wrong with the code, and no code change ships. Revert any edits made while the environment was lying (see workmanship).
- Record the setup fix where the project keeps such things (README, setup script, project CLAUDE.md) so the next session doesn't rediscover it.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

