thinkhard.SI

Prompt repository Engineering & code

Brief a coding agent to automate a spreadsheet chore with a script you can rerun

You do the same spreadsheet steps by hand every week or month and want a coding agent to turn them into a tested script that never touches the originals.

Registry no.
ENG-053
Collection
Engineering & code
Laid out for
Coding agent
Score
10 out of 10
Blanks to fill
7

Engineering & codeCode agent

The prompt

Score 10 of 10, Excellent

Use it when You do the same spreadsheet steps by hand every week or month and want a coding agent to turn them into a tested script that never touches the originals.

  • {{frequency}}
  • {{time_it_takes}}
  • {{manual_steps}}
  • {{input_files}}
  • {{samples_folder}}
  • {{language_and_libraries}}
  • {{where_it_runs}}
Full prompt and why it works
Prompt
Goal: Write a script that does a spreadsheet chore I now do by hand every {{frequency}}, so that it takes one command instead of {{time_it_takes}} and gives the same result every time.

How I do it today, step by step:
"""
{{manual_steps}}
"""

Context:
- Input files, with their names, sources, formats and columns: {{input_files}}
- Sample inputs, and the output I made by hand from them, are in {{samples_folder}}. They contain made-up or anonymized data only.
- Language and libraries I can use: {{language_and_libraries}}
- Where it will run: {{where_it_runs}}

Step 1, before writing code: restate my manual steps as a numbered list of exact rules, such as which rows to drop, how to match records between files, how to round and how to sort the result. List every place where I use judgment by hand (for example, what to do when a row has no region) and ask me how to handle each one. Wait for my answers.

Step 2, build it:
- Put the script in a scripts folder, for example scripts/weekly_report.py, taking input and output paths as arguments rather than hard-coding them.
- Check that every expected column exists before doing anything, and stop with a message naming the missing column and the file.
- Never modify or overwrite an input file. Write the output to a new file, and refuse to run if the output file already exists unless a --force flag is given.
- End with a printed summary: rows read from each file, rows written, rows skipped, and the reason for each skip.
- Add no network access and no dependencies beyond the ones I listed.

Step 3, test it: add an automated test that runs the script on the sample inputs and compares the result with my hand-made output, cell by cell. Add a short README.md section on how to run it.

Done when:
- The test passes, and running the script twice on the same input gives identical output.
- The script refuses to touch the input files.

Report, in under 250 words: the agreed rules, the files you added, the test output, and anything you would improve later. Verify by running the tests yourself. Do not print rows of data in your report beyond the column headers. If my hand-made output and the rules disagree, tell me which rows differ and why rather than changing the rules to match.

Variables

{{frequency}}
How often you do it, for example "Monday" or "month end".
{{time_it_takes}}
How long it takes by hand, for example "about 90 minutes".
{{manual_steps}}
Every step you take, in order, as if teaching a new colleague, including the clicks and the judgment calls.
{{input_files}}
Each input file: its name, source, format and columns, for example "orders export from the shop, CSV, columns order_id, date, region, total".
{{samples_folder}}
Where the sample files and your hand-made result are, for example "samples/ in this project".
{{language_and_libraries}}
What the script may use, for example "Python with pandas and openpyxl".
{{where_it_runs}}
Where you will run it, for example "my Windows laptop" or "a shared Mac".

Why it works

  • If unsure. Judgment calls you make by hand are listed and asked about before any code is written, since those are the steps a script gets wrong without telling you.
  • What good looks like. Done means the output matches your own hand-made result cell by cell, the only check that proves the script does the chore you do.
  • What to avoid. Input files are never modified and the script refuses to overwrite an output, so a bad run cannot damage the originals.

How to use it

  1. Press Fill in blanks and type your details into each blank. What you type stays in this browser.
  2. Copy the filled prompt into the AI tool you already use, such as ChatGPT, Claude or Gemini, or open it in the Grader or the Prompt Tester here.
  3. Before you rely on it, try it on three or four real examples. The Prompt Tester runs them all at once and shows which ones go wrong.
Use it from code

Get this prompt as JSON from the free REST API, with your own text in the blanks, or let an AI assistant fetch it through the MCP server. No key.

curl -s https://thinkhard.si/api/v1/prompts/coding-agent-spreadsheet-chore-script

With the MCP server added to Claude, ChatGPT, Cursor or VS Code, call get_prompt with {"prompt": "coding-agent-spreadsheet-chore-script"}, or just ask for it by name.