Commit febd811
feat: add critical do-block rule to OVSM system prompt
Add Rule #0 to system prompt addressing the most common parse error:
sequential expressions requiring explicit `do` wrapper.
Changes to src/prompts/ovsm_system_prompt_v3.md:
✨ NEW Rule #0: Sequential expressions need `do` wrapper
- Shows wrong: ( define x ... define y ... )
- Shows correct: (do (define x ...) (define y ...) )
- Emphasizes Allman/BSD style formatting
✨ Fixed pagination example
- Define batch variable at TOP (was inside loop - violated scoping)
- Adds comment: "Define ALL variables at TOP (never inside loops!)"
✨ Updated Plan Structure section
- Shows Main Branch starting with `(do`
- Adds reminder: "Main Branch MUST start with (do` when multiple statements"
✨ Updated Remember checklist
- Adds item 0: "Multiple statements need `do` wrapper!"
- Updates mnemonic: "Use `do` for multiple statements..."
Impact:
- AI now generates `(do ...)` wrapper correctly (verified in testing)
- Reduces "Expected `)`, found identifier" parse errors
- File size: 245 lines, 5,205 chars (~650 tokens, still 92% smaller)
Testing results:
✅ AI follows the rule (starts Main Branch with `do`)
✅ Proper scoping maintained (variables at top)
✅ Better code structure overall
1 parent f09e91c commit febd811
2 files changed
+38
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
968 | 968 | | |
969 | 969 | | |
970 | 970 | | |
| 971 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
5 | 30 | | |
6 | 31 | | |
7 | 32 | | |
| |||
106 | 131 | | |
107 | 132 | | |
108 | 133 | | |
| 134 | + | |
109 | 135 | | |
110 | 136 | | |
111 | 137 | | |
| 138 | + | |
112 | 139 | | |
113 | 140 | | |
114 | | - | |
| 141 | + | |
115 | 142 | | |
116 | 143 | | |
117 | 144 | | |
| |||
173 | 200 | | |
174 | 201 | | |
175 | 202 | | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
180 | 208 | | |
181 | 209 | | |
182 | 210 | | |
183 | 211 | | |
| 212 | + | |
| 213 | + | |
184 | 214 | | |
185 | 215 | | |
186 | 216 | | |
| |||
204 | 234 | | |
205 | 235 | | |
206 | 236 | | |
| 237 | + | |
207 | 238 | | |
208 | 239 | | |
209 | 240 | | |
210 | 241 | | |
211 | 242 | | |
212 | 243 | | |
213 | 244 | | |
214 | | - | |
| 245 | + | |
0 commit comments