Every team has one script that nobody planned to write and everybody now depends on. This is about the ones worth writing, and the four that paid for themselves within a month.
1. The "what changed" script
A twelve-line script that prints the diff of your config between two environments. Not a full diff, just the keys and values that differ.
diff <(jq -S . config/staging.json) <(jq -S . config/prod.json)
You will run it before every deploy. It has caught a missing environment variable more times than any test I have written.
2. The fixture refresher
One command that pulls three real records from the API and rewrites the test fixtures. Half an hour to write, and it ends the slow drift where fixtures stop resembling production and the tests pass while the product breaks.
3. The "is it me?" check
A script that hits the health endpoint, the auth endpoint and one read endpoint, and prints status codes with timings. When something feels broken, you run it before you open a dashboard. Nine times out of ten it tells you whether the problem is you, the network, or the service, in about two seconds.
4. The cleanup script that asks first
Anything destructive gets a dry-run mode by default and requires --yes to act. This is not about safety theatre. It is that the difference between a script you will run and a script you are afraid of is a flag and ten lines of printing.
What these have in common
They are all small, they all remove a decision, and none of them needed a design discussion. The scripts that get used are the ones that replace a thing you do repeatedly and slightly differently each time, because inconsistency is what makes the repeated thing expensive.
The test for whether to write one: have you done this manually three times? Then write the script. Not before, because you do not yet know the shape, and not after the fifth time, because by then you have built a habit of doing it by hand and the script will feel like overhead.
Three times is the signal. Write it small, keep it in scripts/, and add one line to the README saying what it does.
Top comments (0)