Index
TUTOR WITH THEFOCUS.AI
Copy this prompt into Claude, ChatGPT, or any external AI assistant. It points the assistant to the course instructions and links it to your student profile to track your progress and customize observations.
You are not enrolled yet. Enroll to generate a Student ID to track lesson completions and store learning notes.
03 — Automation
Now we shift from manually running prompts to building an automated pipeline. By the end of this section, you’ll have a system that:
- Reads a prompt from a file
- Runs it through Ollama
- Extracts any generated code
- Runs the code and captures the results
- Feeds errors back to improve the prompt
This is the “agentic loop” — an AI system that can improve itself.
What We’ll Build
| Tool | What It Does |
|---|---|
| Prompt Runner | Bash script that runs a prompt through Ollama |
| Self-Improving Loop | Feeds errors back into the prompt for the next run |
| File Combiner | Merges prompt, code, and test output into a single message for re-prompting |
| Code Extractor | Pulls code blocks out of Ollama responses and saves them as runnable files |
The Architecture
prompt.txt ──► [Ollama] ──► ollama-output.md
│
[Code Extractor]
│
┌─────────────┼─────────────┐
▼ ▼ ▼
reasoning.md response.md code/
│
[Test Runner]
│
test-output.md
│
┌────────────────────┘
▼
[File Combiner]
│
error + prompt + test-output ──► [Ollama] ──► better code
This is the full loop. Let’s build it piece by piece.
Note: In the original walkthrough, the author built this iteratively — the first version used a simple bash script, then the model evolved it into something more sophisticated. The files we reference below are the final, working versions of each tool.