Write a script to automate a repetitive task
Bash, Python, or PowerShell scripts that automate a task safely, with instructions to run them.
The prompt
Write a script to automate this task.
Task: [WHAT I DO MANUALLY, step by step]
Environment: [Windows / macOS / Linux; language preference — Python, Bash, PowerShell]
Inputs and outputs: [files, folders, APIs, formats]
How often it runs: [once / daily / on demand]
Requirements:
- Safe by default: a dry-run mode, confirm before deleting or overwriting, and clear logging.
- Handle errors (missing files, bad input, network failures) with helpful messages.
- Config at the top (paths, options); no hard-coded secrets — use environment variables.
Return the script, how to install any dependencies, how to run it (with an example), and how to schedule it if it's recurring.
Highlighted [brackets] are blanks to replace with your own details.
Fill in the blanks and use this promptMore Software Development prompts
What to fill in
- WHAT I DO MANUALLY, step by step
- files, folders, APIs, formats
- once / daily / on demand
How this prompt is built
This prompt follows the Chain-of-Thought structure (Chain-of-thought prompting). A chain-of-thought prompt asks the model to work through a problem step by step before giving its answer, which tends to help on reasoning, planning and multi-part questions.
Related prompts
- Write documentation, a README, or API docsGenerates clear technical documentation from your code or notes.
- Find and fix a race condition or concurrency bugAnalyzes code for race conditions, deadlocks, and lost updates, explains the exact interleaving that fails, and proposes a safe fix.
- Find which change caused a regressionCreates a systematic plan to pinpoint the commit, deploy, or config change that broke something that used to work.
- Convert code to another language or frameworkIdiomatic translation of code between languages or frameworks, with notes on differences.