61. Building a Prompt: Real Workflow Example

See a complete real-world example from initial need to final prompt.

By Jacques Botte, founder of Toptronic®. Last updated 19 September 2026.

The lesson

Scenario: Ryan needs help creating a Python script to organize his homework files by subject.

Initial vague request: 'Write a Python script to organize files' - this is too vague and would produce generic code that might not work.

Improved TPEE prompt structure:

Persona: Python Developer (not generic 'AI Assistant')

Instructions: Create a Python script that scans a directory, identifies file types by extension, and moves them into subject folders (Math, Science, English, History). Include error handling for duplicate filenames.

Context: Running on Windows 11, files are in Downloads/Homework folder, subjects are identified by keywords in filenames

Technical Specs: Python 3.10+, use pathlib instead of os.path, include comments explaining each function

Format: Complete Python script with example usage comments at the top

The result: A script that actually works because the AI understood the specific task, constraints, and environment.

A first-year laboratory technician turns a vague request for a data-tidying script into a full TPEE prompt, naming the language, the file location and the output format.

A junior warehouse clerk writes a prompt for a script that renames stocktake files by date, giving the folder, the naming rule and a worked example.

A trainee farm hand builds a TPEE prompt for a script that sorts sensor log files by field, adding the machine limits and an example of the wanted result.

A graduate library assistant describes a small script that renames scanned document files by borrower reference, giving the exact source folder and the error handling needed.

An apprentice mechanic drafts a prompt for a script that gathers job-card photos into folders by vehicle, naming the folder path and the target layout.

A new media assistant works from a rough need to a finished prompt for sorting interview audio files by speaker, adding the library and version details.

A junior insurance clerk builds a prompt for a script that splits a claim export into per-assessor files, listing the columns and the naming pattern.

A first-year planning assistant turns a messy request into a structured prompt for a script that groups permit documents by type, naming the source and output folders.

A trainee dental assistant writes a prompt for a small script that renames treatment-photo files by patient reference, including the exact date pattern needed.

A new inventory assistant goes from a vague idea to a complete TPEE prompt for a script that separates supplier lists by category, adding an example of the wanted output.

Check yourself

Question 1: In the Python file organizer example, why was the initial request too vague?
  1. It was too long
  2. It did not specify the environment, constraints, or requirements — correct
  3. It used too many technical terms
  4. It was written in French

Answer: It did not specify the environment, constraints, or requirements

'Write a Python script to organize files' lacks critical details: operating system, folder structure, file types, and error handling needs.

Question 2: What made the improved prompt work better?
  1. It was shorter
  2. It included specific details: Windows 11, pathlib, keywords in filenames, error handling — correct
  3. It used all caps
  4. It was written at midnight

Answer: It included specific details: Windows 11, pathlib, keywords in filenames, error handling

Specific context (Windows 11, pathlib), technical constraints (use pathlib not os.path), and format requirements made the prompt actionable.

Question 3: Why include 'Technical Specs' in a coding prompt?
  1. To make it longer
  2. To specify Python version, libraries, and implementation details — correct
  3. To confuse the AI
  4. To waste time

Answer: To specify Python version, libraries, and implementation details

Technical Specs tell the AI exactly what environment and constraints to target, producing code that actually works in your setup.

← Previous lesson · All 91 lessons · Next lesson →

The full course — 91 lessons and 273 quiz questions — ships inside the app. Get TPEE to study it offline.