The highest-frequency, highest-win AI task in backend work: the glue you write ten times a week — a jq pipeline over an API dump, a regex for log lines, a data-fix SQL, a shell one-liner over 400 CSVs. AI writes these in seconds.
Tier: Foundation · Workflow area: Feature development
AI also confidently writes ones that are subtly wrong, and "subtly wrong data-fix SQL" is a career event. The playbook is one habit: generate, then verify on a sample, then run — never generate-and-run.
git filetree archaeology).Skip AI for one-liners you already know cold — typing beats prompting at that size.
--dry-run, output to a new file).Show real input, state exact output. The number-one quality lever is a genuine sample:
Write a jq filter. Input (one of ~5,000 similar objects):
{"id":"ord_91","status":"failed","attempts":[{"ts":"2026-07-20T10:11:02Z",
"error":"card_declined"},{"ts":"2026-07-21T09:02:44Z","error":"timeout"}]}
Output: CSV lines `id,last_error,last_attempt_ts` — the error and ts of
the LATEST attempt only, ordered by ts. Objects with empty attempts
should output `id,,`. Watch out: attempts are not guaranteed sorted.
Ask for the trap list. One extra sentence catches most edge-case bugs: "List the input variations that would break this filter." For regex: "Show three strings that match and three near-misses that don't." You are making the model generate its own test cases.
Run on the sample first. Paste the sample through the actual command locally. Check the edge case (empty attempts) by hand. For regex, test the near-misses. Ten seconds of sample-run catches the classic failures: unsorted arrays, greedy quantifiers, locale-dependent sort, null vs missing key.
For destructive operations, demand the dry-run form first. Data-fix SQL example:
Postgres. Fix: orders stuck in status='processing' older than 7 days whose
payment succeeded should become 'paid'. Tables: orders(id, status,
updated_at), payments(order_id, state).
Give me: (1) a SELECT that returns exactly the rows the UPDATE would touch,
with a count; (2) the UPDATE wrapped in an explicit transaction with the
same WHERE; (3) what could make (1) and (2) diverge between runs.
Run the SELECT, eyeball the count against your expectation ("should be ~40, not 40,000"), then run the UPDATE inside BEGIN/verify/COMMIT.
Sanity-check the totals. After the real run: row counts in vs out, wc -l, a spot-check of two known records. If the number surprises you, the script is wrong until proven otherwise.
The model is your fastest-ever draft writer for glue code — but you are the only one in the room who knows what "about 40 rows" should mean.
rm, git push --force, DROP suggestions. Anything irreversible gets typed by you, deliberately, never pasted from a chat.The scripts are rarely sensitive; the data is. Paste structure, not payloads: replace real values in your sample with fakes of the same shape ("email":"user1@example.com", realistic-length IDs) — the model only needs shape and types. Production data with personal information (names, phones, addresses) must not enter hosted tools; under India's DPDP Act treat customer fields in dumps as regulated data. Local models handle this playbook well — jq/regex/SQL generation is comfortably within an 8B-coder's range, so a fully offline Ollama workflow is a real option for client-side work.