@@ -22,7 +22,9 @@ By the end of this workshop, you’ll understand how to:
2222
2323## 🛠️ What We're Building
2424
25- You’ll build 6 versions of a coding assistant. Each version adds more features:
25+ You’ll build 6 versions of a coding assistant.
26+
27+ Each version adds more features:
2628
27291 . ** Basic Chat** — talk to Claude
28302 . ** File Reader** — read code files
@@ -31,7 +33,35 @@ You’ll build 6 versions of a coding assistant. Each version adds more features
31335 . ** File Editor** — modify files
32346 . ** Code Search** — search your codebase with patterns
3335
34- You’ll end up with a powerful local developer assistant!
36+ ``` mermaid
37+ graph LR
38+ subgraph "Application Progression"
39+ A[chat.go<br/>Basic Chat] --> B[read.go<br/>+ File Reading]
40+ B --> C[list_files.go<br/>+ Directory Listing]
41+ C --> D[bash_tool.go<br/>+ Shell Commands]
42+ D --> E[edit_tool.go<br/>+ File Editing]
43+ E --> F[code_search_tool.go<br/>+ Code Search]
44+ end
45+
46+ subgraph "Tool Capabilities"
47+ G[No Tools] --> H[read_file]
48+ H --> I[read_file<br/>list_files]
49+ I --> J[read_file<br/>list_files<br/>bash]
50+ J --> K[read_file<br/>list_files<br/>bash<br/>edit_file]
51+ K --> L[read_file<br/>list_files<br/>bash<br/>code_search]
52+ end
53+
54+ A -.-> G
55+ B -.-> H
56+ C -.-> I
57+ D -.-> J
58+ E -.-> K
59+ F -.-> L
60+ ```
61+
62+ At the end, you’ll end up with a powerful local developer assistant!
63+
64+
3565
3666---
3767
@@ -48,17 +78,42 @@ Each agent works like this:
4878
4979We call this the ** event loop** — it's like the agent's heartbeat.
5080
51- <details >
52- <summary >📈 Click to view a simplified diagram</summary >
53-
54- ```
55- User → Agent → Claude → Tools → Claude → Agent → You
81+ ``` mermaid
82+ graph TB
83+ subgraph "Agent Architecture"
84+ A[Agent] --> B[Anthropic Client]
85+ A --> C[Tool Registry]
86+ A --> D[getUserMessage Function]
87+ A --> E[Verbose Logging]
88+ end
89+
90+ subgraph "Shared Event Loop"
91+ F[Start Chat Session] --> G[Get User Input]
92+ G --> H{Empty Input?}
93+ H -->|Yes| G
94+ H -->|No| I[Add to Conversation]
95+ I --> J[runInference]
96+ J --> K[Claude Response]
97+ K --> L{Tool Use?}
98+ L -->|No| M[Display Text]
99+ L -->|Yes| N[Execute Tools]
100+ N --> O[Collect Results]
101+ O --> P[Send Results to Claude]
102+ P --> J
103+ M --> G
104+ end
105+
106+ subgraph "Tool Execution Loop"
107+ N --> Q[Find Tool by Name]
108+ Q --> R[Execute Tool Function]
109+ R --> S[Capture Result/Error]
110+ S --> T[Add to Tool Results]
111+ T --> U{More Tools?}
112+ U -->|Yes| Q
113+ U -->|No| O
114+ end
56115```
57116
58- </details >
59-
60- ---
61-
62117## 🚀 Getting Started
63118
64119### ✅ Prerequisites
@@ -99,8 +154,8 @@ A simple chatbot that talks to Claude.
99154go run chat.go
100155```
101156
102- ➡️ Try: “Hello!”
103- ➡️ Add ` --verbose ` to see detailed logs
157+ * ➡️ Try: “Hello!”
158+ * ➡️ Add ` --verbose ` to see detailed logs
104159
105160---
106161
@@ -114,7 +169,7 @@ Now Claude can read files from your computer.
114169go run read.go
115170```
116171
117- ➡️ Try: “Read fizzbuzz.js”
172+ * ➡️ Try: “Read fizzbuzz.js”
118173
119174---
120175
@@ -126,8 +181,8 @@ Lets Claude look around your directory.
126181go run list_files.go
127182```
128183
129- ➡️ Try: “List all files in this folder”
130- ➡️ Try: “What’s in fizzbuzz.js?”
184+ * ➡️ Try: “List all files in this folder”
185+ * ➡️ Try: “What’s in fizzbuzz.js?”
131186
132187---
133188
@@ -139,8 +194,8 @@ Allows Claude to run safe terminal commands.
139194go run bash_tool.go
140195```
141196
142- ➡️ Try: “Run git status”
143- ➡️ Try: “List all .go files using bash”
197+ * ➡️ Try: “Run git status”
198+ * ➡️ Try: “List all .go files using bash”
144199
145200---
146201
@@ -152,8 +207,8 @@ Claude can now **modify code**, create files, and make changes.
152207go run edit_tool.go
153208```
154209
155- ➡️ Try: “Create a Python hello world script”
156- ➡️ Try: “Add a comment to the top of fizzbuzz.js”
210+ * ➡️ Try: “Create a Python hello world script”
211+ * ➡️ Try: “Add a comment to the top of fizzbuzz.js”
157212
158213---
159214
@@ -165,16 +220,16 @@ Use pattern search (powered by [ripgrep](https://github.com/BurntSushi/ripgrep))
165220go run code_search_tool.go
166221```
167222
168- ➡️ Try: “Find all function definitions in Go files”
169- ➡️ Try: “Search for TODO comments”
223+ * ➡️ Try: “Find all function definitions in Go files”
224+ * ➡️ Try: “Search for TODO comments”
170225
171226---
172227
173228## 🧪 Sample Files (Already Included)
174229
175- * ` fizzbuzz.js ` : for file reading and editing
176- * ` riddle.txt ` : a fun text file to explore
177- * ` AGENT.md ` : info about the project environment
230+ 1 . ` fizzbuzz.js ` : for file reading and editing
231+ 1 . ` riddle.txt ` : a fun text file to explore
232+ 1 . ` AGENT.md ` : info about the project environment
178233
179234---
180235
0 commit comments