You’ve got a notebook, a text file, maybe a few voice memos—all half-formed ideas, half-remembered meeting notes, and frantic TODOs scribbled during a panic sprint. You want to turn that into something usable: a runbook, a blog post, a GitHub issue, even a script. But cleaning it up feels like extra work you don’t have time for.
Here’s how I do it—no magic, no prompting rituals, just practical pipeline work. I treat AI like a junior engineer who’s read your entire knowledge base but hasn’t learned judgment yet. You’re still in charge. You just hand it the right raw material.
—
Start with a Consistent Input Format (Even If It’s Ugly)
The biggest mistake I see people make is feeding AI raw, unstructured chaos. “Here’s my scribbled notebook scan.” Nope. AI isn’t psychic. It needs structure you define—even if it’s minimal.
I force everything into a simple template before it ever touches an LLM:
# [PROJECT/TOPIC]
- Context: [1–2 sentences on where this came from]
- Raw Notes:
• [Fragment 1]
• [Fragment 2]
- Goal: [What you want out the other side]
- Constraints: [Time? Tools? Security?]
Example from last week:
# Postgres Backup Rotation Script
- Context: After the weekend incident where old WALs filled /var
- Raw Notes:
• pg_dumpall → /backup/daily
• Keep last 7 days
• But don’t overwrite if running (lockfile?)
• Use zstd for compression
• Log to /var/log/pg_backup.log
- Goal: Bash script with cron entry
- Constraints: Must work on Ubuntu 22.04+; no external deps beyond stdlib
That’s it. You spend 5 minutes structuring. The AI saves you 45 minutes of writing, debugging, and testing. The format makes your intent obvious—even to you the next day.
—
Use the Right Prompt Pattern for the Job
I don’t ask “Write me a script.” I ask for specific, constrained outputs. Here’s my go-to prompt pattern:
> “Given the above, generate [OUTPUT TYPE] that: > – Follows [TOOL/STYLE] conventions > – Includes [REQUIRED ELEMENTS] > – Avoids [COMMON PITS] > – Includes [SAFETY FEATURES] > – Returns plain text (no markdown unless asked).”
For the backup script example, my prompt was:
> “Given the above, generate a bash script that: > – Uses lockfile to prevent overlap > – Compresses dump with zstd > – Rotates by age: delete files older than 7 days > – Logs to /var/log/pg_backup.log > – Includes a dry-run mode (--dry-run) > – Uses only POSIX tools + zstd (no Python, no jq)”
Output was 38 lines. I ran shellcheck, added a test for pg_dumpall exit code, and deployed. Took 15 minutes total. No hallucinated flags, no “best practice” fluff.
Pro tip: Tell it not to explain itself unless you ask. “Just the code” keeps outputs lean and avoids AI bloviation.
—
Build the Feedback Loop In—Not After
AI isn’t a one-shot tool. It’s a co-pilot. You feed it, it gives you something, you fix it, it learns context. But you have to make the loop tight.
I do three things:
- Version the prompts. Keep a
prompts/directory next to your project. 01-initial.txt,02-fix-stdout.txt,03-add-logging.txt- You can replay the sequence if things break.
- Run the AI output through your normal validation.
- Scripts?
shellcheck,pylint,flake8. - Configs?
jsonlint,yamllint,terraform validate. - Docs?
vale,proselint, or justgrep -i "should"for vague claims.
- Keep a change log. Even just a bullet list in the notes:
- Added lockfile check (lsof-based)
- Fixed log rotation to use find -mtime +7
- Removed debug echo (left over from test run)
I once had an AI generate a Terraform module that looked fine—until I ran terraform plan. It had hardcoded region IDs in the aws_instance resource. Not a syntax error. Just a silent, expensive mistake. Running the plan caught it before apply. The AI’s output was syntactically correct but operationally broken. That’s why your CI pipeline (yes, you have one) is part of the AI workflow now.
—
Maintenance Reality: What Breaks, and How I Fix It
Let’s be real: AI-generated work isn’t maintenance-free. It’s different maintenance.
Here’s what I’ve seen break:
- Version drift. AI gives you a script using
curl -sSLto fetch a binary. Nowcurlis deprecated in favor ofwgetorhttpxon some distros.
→ Fix: Pin to specific binaries in the prompt: “Use only apt, curl, and tar from base Ubuntu 22.04.”
- Assumed context. AI generates a
systemdservice that assumesuser=backup. But your env usesroot.
→ Fix: Add a “Context” section that names users, groups, paths, and service accounts.
- Overfitting to examples. You paste a working script, ask for a variant, and AI copies all the quirks—including the
sedthat’s actually a band-aid for a legacy kernel bug.
→ Fix: Strip comments from the source before feeding it in. AI latches onto comments like they’re docs.
- Security debt. AI will happily include
eval,rm -rf, or base64-encoded secrets if you don’t forbid it.
→ Fix: Add “Constraints” like:
- No
eval,exec, orsh -c - No hardcoded credentials
- Log only non-sensitive keys (e.g.,
DB_HOST, notDB_PASSWORD)
I keep a AI-REVIEW-CHECKLIST.md in every project. One line per risk:
- [ ] No hardcoded secrets (grep for 'PASSWORD', 'SECRET', 'API_KEY')
- [ ] No `eval`/`exec`/`system()` calls
- [ ] `set -euo pipefail` in bash
- [ ] `--dry-run` works and is tested
- [ ] Logs to a single, configurable path
Checklist takes 90 seconds. Prevents one 2 a.m. page.
—
Content Work: Turning Ramblings into Articles
I write a lot of drafts in Obsidian. Half the time, it’s just bullet points. Here’s how I turn that into publishable work:
- Export to a simple markdown file
- Headings only (H2, H3)
- Bullets where notes exist
- Delete all “draft” or “TODO” tags
- Prompt the AI with constraints:
> “Given the above draft, rewrite it as a technical post for sysadmins. > – Keep the original structure (H2s, H3s) > – Add one concrete example per section > – Replace vague claims with measurable outcomes (e.g., ‘saves time’ → ‘cuts runbook creation from 2 hours to 20 minutes’) > – No buzzwords (‘leverage’, ‘synergy’, ‘future-proof’). > – Return only the revised markdown.”
- Run it through your own voice filter.
I read it aloud. If it sounds like a corporate blog, I delete the sentence. If it sounds like me—a bit grumpy, practical, with a concrete war story—I keep it.
Last month, I turned 47 lines of messy notes into a post about logging in containers. The AI added a working jq example I’d forgotten, but it also suggested “use structured logging for all things.” I deleted that. I hate that advice—it’s not practical for 90% of the scripts I maintain. AI missed the context: I was writing for people who run legacy apps. They don’t control the app’s logging. So I added a line: “If you can’t change the app, wrap it in a script that adds JSON around stdout.”
That’s the loop. AI does the heavy lifting. You do the judgment.
—
What I Would Do First
You don’t need new tools. You need a workflow tweak.
- Grab one messy note today.
Pick anything—a meeting note, a bug ticket, a script idea. Refactor it into the 6-line template: # TOPIC, Context, Raw Notes, Goal, Constraints.
- Prompt once, with constraints.
Use the “given the above, generate…” pattern. No “please,” no “can you,” no “in a DevOps-y way.”
- Run it through your standard checks.
Shellcheck for scripts. vale for docs. terraform validate for configs. If it passes, deploy. If not, fix one thing, and feed that back into the next prompt.
- Keep a log of what broke—and why.
You’ll start seeing patterns. (Spoiler: It’s always the assumptions.)
You’re not automating your brain. You’re automating the grunt part. The thinking? That stays yours.
That’s how I ship. Not because AI is magic. Because it’s a really good typist who’s read all the docs—and still needs you to watch the door.