@@ -22,7 +22,9 @@ By the end of this workshop, you’ll understand how to:
22
22
23
23
## 🛠️ What We're Building
24
24
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:
26
28
27
29
1 . ** Basic Chat** — talk to Claude
28
30
2 . ** File Reader** — read code files
@@ -31,7 +33,35 @@ You’ll build 6 versions of a coding assistant. Each version adds more features
31
33
5 . ** File Editor** — modify files
32
34
6 . ** Code Search** — search your codebase with patterns
33
35
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
+
35
65
36
66
---
37
67
@@ -48,17 +78,42 @@ Each agent works like this:
48
78
49
79
We call this the ** event loop** — it's like the agent's heartbeat.
50
80
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
56
115
```
57
116
58
- </details >
59
-
60
- ---
61
-
62
117
## 🚀 Getting Started
63
118
64
119
### ✅ Prerequisites
@@ -99,8 +154,8 @@ A simple chatbot that talks to Claude.
99
154
go run chat.go
100
155
```
101
156
102
- ➡️ Try: “Hello!”
103
- ➡️ Add ` --verbose ` to see detailed logs
157
+ * ➡️ Try: “Hello!”
158
+ * ➡️ Add ` --verbose ` to see detailed logs
104
159
105
160
---
106
161
@@ -114,7 +169,7 @@ Now Claude can read files from your computer.
114
169
go run read.go
115
170
```
116
171
117
- ➡️ Try: “Read fizzbuzz.js”
172
+ * ➡️ Try: “Read fizzbuzz.js”
118
173
119
174
---
120
175
@@ -126,8 +181,8 @@ Lets Claude look around your directory.
126
181
go run list_files.go
127
182
```
128
183
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?”
131
186
132
187
---
133
188
@@ -139,8 +194,8 @@ Allows Claude to run safe terminal commands.
139
194
go run bash_tool.go
140
195
```
141
196
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”
144
199
145
200
---
146
201
@@ -152,8 +207,8 @@ Claude can now **modify code**, create files, and make changes.
152
207
go run edit_tool.go
153
208
```
154
209
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”
157
212
158
213
---
159
214
@@ -165,16 +220,16 @@ Use pattern search (powered by [ripgrep](https://github.com/BurntSushi/ripgrep))
165
220
go run code_search_tool.go
166
221
```
167
222
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”
170
225
171
226
---
172
227
173
228
## 🧪 Sample Files (Already Included)
174
229
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
178
233
179
234
---
180
235
0 commit comments