“Write me a bash script to back up my home directory.”
- No OS / shell pinned (bash 3 on macOS ≠ bash 5 on Linux ≠ zsh)
- No source + destination + retention policy
- No error handling, dry-run flag or logging
- No test plan or sample output
Drop a one-line idea into this free unlimited bash prompt generator. HotPrompt rewrites it into a senior-engineer-grade brief — language, flags, edge cases, error handling, a runnable sample — that ChatGPT, Claude, Cursor or Copilot can compile on the first try. No card, no signup wall, no daily script cap on the optimizer itself.
You'll need an account to optimize. .
Before vs After
Most bash prompts fail because the user leaves out the OS, the failure mode and the test plan. Our bash prompt generator fills those in so ChatGPT, Claude or Cursor return a script that runs the first time.
“Write me a bash script to back up my home directory.”
# Role You are a senior site-reliability engineer who writes idempotent, dry-run-safe POSIX-bash scripts. # Task Write `backup-home.sh`: a daily backup of `$HOME` (excluding caches) to a destination directory, with 7-day retention. # Contract Flags: --source DIR default: $HOME --dest DIR required --keep N default: 7 --dry-run print what would happen, no writes --verbose tee a logfile under ~/.local/state/backup-home.log Behavior: - Use rsync -a --delete --exclude-from=<list>. - Exclude: ~/.cache, ~/.npm, ~/Library/Caches, node_modules, .venv. - On any non-zero rsync exit, log to stderr + exit 2. - Prune snapshots older than --keep days using find -mtime. - Idempotent: re-running same day overwrites today's snapshot, no duplicates. # Tests (bats-core) 1. --dry-run prints the rsync command and exits 0 without writing. 2. Missing --dest exits 64 with a usage hint. 3. Two consecutive runs leave exactly one snapshot for today. 4. Snapshots older than --keep days are pruned; newer ones are kept. # Output format 1. The script (bash, set -euo pipefail). 2. A short usage block at the top (heredoc comment). 3. The four bats tests above, runnable as-is. 4. A README snippet showing how to drop it into cron or a launchd plist.
How it works
Four steps from 'I need a shell script that…' to a brief any AI coding assistant can compile.
POSIX bash on Linux behaves differently from bash 3 on macOS. The bash prompt generator asks once and picks the right idioms.
Missing flags, network drops, full disks, racing locks. Listed up front so the LLM can't 'forget' them.
Every script gets a --dry-run flag and at least two bats-core tests. Verifiable beats vibes.
Output is plain text. Paste into ChatGPT, Claude or Cursor; the script that comes back actually runs.
Every output is a senior-engineer-grade brief: shell pinned, flags spec'd, edge cases on the contract, tests asked for, sample run included.
POSIX-bash with `set -euo pipefail` so silent failures don't slip through.
Flag parser sketched (long flags, --help, exit 64 on usage error).
Idempotency rules — re-runs do the right thing, not the duplicate thing.
A `--dry-run` mode the LLM is forced to write because the bash prompt generator asks for it.
bats-core test cases listed up front (happy path + failure mode).
A cron / launchd / systemd-timer snippet so the script reaches production.
Bash is fast to write and faster to break. Use the bash prompt generator when correctness or repeatability matters.
The bash prompt generator pins rsync flags, retention and dry-run so your nightly cron isn't quietly losing files for a month.
Find + xargs scripts go wrong in surprising ways. This bash prompt generator forces a test that pruning never deletes files newer than the threshold.
A reliable deploy script is a long bash file with strict error handling. The bash prompt generator brief asks the LLM for exactly that shape.
The 'just write a bash script' task that becomes a multi-day debug. The bash prompt generator front-loads edge cases so the script is right the first time.
macOS bash 3 vs GNU bash 5 vs BusyBox ash. The bash prompt generator names the target so the LLM doesn't reach for tools that aren't there.
curl-pipe-to-bash installers need to be paranoid. The bash prompt generator enforces TLS pinning, checksum verification and refusal to overwrite.
Same bash prompt generator output, different paste target. Each assistant has its preferred prompt shape — the generator picks the right defaults.
Long-context reasoning fits long bash scripts; the bash prompt generator emits explicit acceptance criteria for o1 / o3 to verify against.
XML-style headers and dry-run tolerance — Claude reads the bash prompt generator's structured brief cleanly.
Cursor reads the bash prompt generator output as a multi-file spec; reference imports, paths and repo conventions for free.
Tighter prompts that fit Copilot's slim window — the bash prompt generator emits a leaner brief when Copilot is the target.
Agents run the bash script and fix on red. The bash prompt generator includes tests so the agent has a verifiable goal.
DeepSeek's speed/quality balance shines on bounded shell tasks — the bash prompt generator keeps the brief focused.
Questions
Yes. Every new account gets 10 free credits per day — enough for a couple of bash prompt generator runs daily, forever, no card required. Paid plans add monthly buckets if you need more, but the bash prompt generator itself never paywalls the result.
No — macOS bash 3, Linux bash 5, BusyBox ash on Alpine and zsh on Apple silicon are all first-class. Mention the OS in the idea and the bash prompt generator picks the right idioms.
Yes. The bash prompt generator emits standalone briefs; you can paste them as-is or alongside @-mentioned files in Cursor without fabrication.
Same generator, just say so. The bash prompt generator switches idioms — array syntax, completion files, $ZSH_VERSION guards — depending on the target shell.
Because the missing pieces — OS, flags, dry-run, tests, retention — are the difference between a script that ships and one that 'works on my machine'. The bash prompt generator front-loads them so the first LLM round-trip lands.
More tools
Five birthday card concepts — AI-image prompt + matching greeting message, tailored to your recipient.
Upload any image — get the prompt that would have generated it. Photographer-grade analysis.
Build a custom zsh PROMPT string with live preview — no LLM, no credits, instant.