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 12 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.

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 83 lessons · Next lesson →

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