telo3-ai 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,481 @@
1
+ # Token Optimization & Efficiency
2
+
3
+ > Smart AI behavior for minimal token usage and maximum effectiveness.
4
+
5
+ ---
6
+
7
+ ## Core Principle
8
+
9
+ **Do what's needed. Skip what's not. Communicate concisely.**
10
+
11
+ ---
12
+
13
+ ## Token-Saving Rules
14
+
15
+ ### 1. Read Selectively
16
+
17
+ ❌ **DON'T:**
18
+ - Read entire codebase
19
+ - Read all context documents every time
20
+ - Re-read files already in conversation
21
+
22
+ ✅ **DO:**
23
+ - Read only affected files
24
+ - Check memory.md first (recent context)
25
+ - Use grep to find relevant code
26
+ - Read specific line ranges
27
+
28
+ **Example:**
29
+ ```
30
+ Task: Fix login button styling
31
+
32
+ ❌ Read: prd.md, architecture.md, rules.md, design.md, all component files
33
+ ✅ Read: design.md (button styles), LoginButton.tsx only
34
+ ```
35
+
36
+ ### 2. Skip Unnecessary Verification
37
+
38
+ ❌ **DON'T:**
39
+ - Run tests if not requested
40
+ - Inspect unrelated code
41
+ - Verify unchanged functionality
42
+ - Read documentation for known patterns
43
+
44
+ ✅ **DO:**
45
+ - Trust existing working code
46
+ - Only verify what you changed
47
+ - Test when explicitly asked or high-risk
48
+ - Skip inspection if pattern is clear
49
+
50
+ ### 3. Communicate Concisely
51
+
52
+ ❌ **VERBOSE:**
53
+ ```
54
+ I understand that you would like me to update the button color.
55
+ After carefully reading the design system documentation and
56
+ examining the current implementation, I have determined that
57
+ the most appropriate course of action...
58
+ ```
59
+
60
+ ✅ **CONCISE:**
61
+ ```
62
+ Updating button color to primary blue (design.md).
63
+
64
+ Changed: Button.tsx line 12
65
+ ```
66
+
67
+ ### 4. Caveman Mode (Ultra-Concise)
68
+
69
+ **When enabled: Maximum brevity, no fluff.**
70
+
71
+ **Format:**
72
+ - Short sentences
73
+ - No filler words
74
+ - Direct action statements
75
+ - Facts only
76
+
77
+ **Examples:**
78
+
79
+ ❌ **Normal:** "I'll now proceed to create the user profile component following the design system"
80
+
81
+ ✅ **Caveman:** "Create UserProfile component. Follow design.md."
82
+
83
+ ❌ **Normal:** "After reviewing the code, I've identified that we need to validate the email input"
84
+
85
+ ✅ **Caveman:** "Add email validation. Use Zod schema."
86
+
87
+ ❌ **Normal:** "The implementation has been completed successfully and I've verified that it works"
88
+
89
+ ✅ **Caveman:** "Done. Tested. Works."
90
+
91
+ ---
92
+
93
+ ## Efficiency Decision Tree
94
+
95
+ ```
96
+ New Task Received
97
+ ↓
98
+ Is change tiny? (1 file, obvious)
99
+ YES → Read that file → Code → Update memory.md → DONE
100
+ NO ↓
101
+
102
+ Is change medium? (2-3 files, clear pattern)
103
+ YES → Read memory.md + affected files → Code → Update docs → DONE
104
+ NO ↓
105
+
106
+ Is change large/complex?
107
+ YES → Read relevant context → Plan → Confirm with user → Code → Update docs → DONE
108
+ ```
109
+
110
+ ---
111
+
112
+ ## When to Read Project Context
113
+
114
+ ### Always Read (30 seconds max):
115
+ - **memory.md** — Recent context, current state
116
+
117
+ ### Read If Relevant:
118
+ - **prd.md** — If changing requirements or scope
119
+ - **architecture.md** — If adding features, changing structure
120
+ - **rules.md** — If unsure about coding standards
121
+ - **design.md** — If building UI
122
+ - **tasks.md** — If planning work
123
+
124
+ ### Skip:
125
+ - Documents unrelated to current task
126
+ - Files you've already read this session
127
+ - Unchanged documentation
128
+
129
+ ---
130
+
131
+ ## When to Inspect Code
132
+
133
+ ### Must Inspect:
134
+ - Files you're about to modify
135
+ - Related files (imports, dependencies)
136
+
137
+ ### Can Skip:
138
+ - Unrelated features
139
+ - Test files (unless testing)
140
+ - Config files (unless changing config)
141
+ - Documentation (unless updating docs)
142
+
143
+ ### Quick Inspection Methods:
144
+ ```bash
145
+ # Find pattern quickly
146
+ grep -r "functionName" src/
147
+
148
+ # Find files containing text
149
+ rg "import.*Component" --files-with-matches
150
+
151
+ # See function without reading whole file
152
+ # Use code reading tool with selector
153
+ ```
154
+
155
+ ---
156
+
157
+ ## When to Run Tests
158
+
159
+ ### Run Tests When:
160
+ - Explicitly requested by user
161
+ - Changing critical code (auth, payments, security)
162
+ - Fixing bugs (verify fix)
163
+ - Test failure mentioned
164
+
165
+ ### Skip Tests When:
166
+ - Trivial changes (typos, comments, styling)
167
+ - Non-functional changes (refactoring with same behavior)
168
+ - User didn't ask for testing
169
+ - Tests don't exist yet
170
+
171
+ ---
172
+
173
+ ## Smart Context Loading
174
+
175
+ ### Minimal Context (Fast Tasks)
176
+ ```
177
+ Read: memory.md (30 sec)
178
+ Code: Direct implementation
179
+ Update: memory.md only
180
+ ```
181
+
182
+ ### Medium Context (Standard Tasks)
183
+ ```
184
+ Read: memory.md + design.md or rules.md (1 min)
185
+ Code: Follow patterns
186
+ Update: memory.md + tasks.md
187
+ ```
188
+
189
+ ### Full Context (Complex Tasks)
190
+ ```
191
+ Read: Relevant subset of all docs (2-3 min)
192
+ Plan: Discuss approach with user
193
+ Code: Systematic implementation
194
+ Update: All affected docs
195
+ ```
196
+
197
+ ---
198
+
199
+ ## Response Format (Caveman Mode)
200
+
201
+ ### Before Coding
202
+ ```
203
+ Task: Add user search
204
+
205
+ Read: architecture.md (API patterns)
206
+ Plan:
207
+ - Add /api/users/search endpoint
208
+ - Use existing auth middleware
209
+ - Return filtered user list
210
+
211
+ Proceed? [Just start coding if obvious]
212
+ ```
213
+
214
+ ### After Coding
215
+ ```
216
+ Done.
217
+
218
+ Changed:
219
+ - /api/users/search.ts (new)
220
+ - components/UserSearch.tsx (new)
221
+
222
+ Updated:
223
+ - tasks.md (marked complete)
224
+ - memory.md (added search feature)
225
+
226
+ Tested: Manual check. Works.
227
+ ```
228
+
229
+ ### Bug Fix
230
+ ```
231
+ Fixed login redirect.
232
+
233
+ Issue: Missing return statement
234
+ Changed: auth.ts line 45
235
+ Verified: Redirect works now
236
+ ```
237
+
238
+ ---
239
+
240
+ ## Intelligent Tool Selection
241
+
242
+ ### File Reading
243
+ ```
244
+ Tiny change → Read exact file
245
+ Pattern search → Use grep
246
+ Find similar code → Use grep with pattern
247
+ Unknown location → Use file search
248
+ ```
249
+
250
+ ### Code Modification
251
+ ```
252
+ Single change → Direct string replace
253
+ Multiple related changes → Multiple edits
254
+ Full rewrite → Write entire file
255
+ ```
256
+
257
+ ### Verification
258
+ ```
259
+ User asked to test → Run tests
260
+ Critical change → Quick manual verify
261
+ Trivial change → Skip verification
262
+ ```
263
+
264
+ ---
265
+
266
+ ## Communication Patterns
267
+
268
+ ### Update Format (Concise)
269
+
270
+ **Bad (Verbose):**
271
+ ```
272
+ I have successfully completed the implementation of the user
273
+ authentication feature. The code has been written following
274
+ best practices and includes proper error handling. I have
275
+ also updated the relevant documentation files.
276
+ ```
277
+
278
+ **Good (Concise):**
279
+ ```
280
+ Auth feature complete.
281
+ - Added login/signup
282
+ - Error handling included
283
+ - Docs updated
284
+ ```
285
+
286
+ **Best (Caveman):**
287
+ ```
288
+ Auth done.
289
+ - Login/signup works
290
+ - Errors handled
291
+ - Docs current
292
+ ```
293
+
294
+ ---
295
+
296
+ ## Avoid Token Waste
297
+
298
+ ### ❌ Don't Waste Tokens On:
299
+ - Long explanations of obvious things
300
+ - Repeating user's request back to them
301
+ - Excessive code comments in responses
302
+ - Reading entire files when you need 1 function
303
+ - Running full test suites for typo fixes
304
+ - Verifying unchanged code still works
305
+ - Apologizing excessively
306
+ - Flowery language
307
+ - Explaining the process (just do it)
308
+
309
+ ### ✅ Spend Tokens On:
310
+ - Reading relevant code
311
+ - Clear, concise updates
312
+ - Important decisions/tradeoffs
313
+ - Error explanations
314
+ - Security/privacy considerations
315
+ - Asking for clarification when truly unclear
316
+
317
+ ---
318
+
319
+ ## Smart Pattern Recognition
320
+
321
+ **If you see pattern X, apply solution Y automatically:**
322
+
323
+ | Pattern | Action |
324
+ |---------|--------|
325
+ | "Fix typo in..." | Read file → Fix → Done (no testing) |
326
+ | "Update button color..." | Read design.md → Update → Done |
327
+ | "Add field to form..." | Read form → Add with validation → Done |
328
+ | "Fix bug in..." | Read file → Fix → Verify → Update memory.md |
329
+ | "Refactor..." | Read code → Plan → Ask user → Refactor |
330
+
331
+ ---
332
+
333
+ ## Adaptive Behavior Based on Task Size
334
+
335
+ ### Tiny (< 5 min)
336
+ - **Read:** 1 file
337
+ - **Plan:** No (obvious)
338
+ - **Code:** Direct
339
+ - **Test:** No
340
+ - **Update:** memory.md only
341
+ - **Response:** 2-3 sentences
342
+
343
+ ### Small (5-15 min)
344
+ - **Read:** 2-3 files + memory.md
345
+ - **Plan:** Mental (no discussion)
346
+ - **Code:** Straightforward
347
+ - **Test:** If requested
348
+ - **Update:** memory.md + tasks.md
349
+ - **Response:** Brief summary
350
+
351
+ ### Medium (15-30 min)
352
+ - **Read:** Relevant context + affected code
353
+ - **Plan:** Brief outline
354
+ - **Code:** Systematic
355
+ - **Test:** Critical paths
356
+ - **Update:** All relevant docs
357
+ - **Response:** Structured summary
358
+
359
+ ### Large (30+ min)
360
+ - **Read:** Full context review
361
+ - **Plan:** Detailed, confirm with user
362
+ - **Code:** Phased implementation
363
+ - **Test:** Comprehensive
364
+ - **Update:** All docs + audit if needed
365
+ - **Response:** Complete summary
366
+
367
+ ---
368
+
369
+ ## Efficiency Metrics (Self-Check)
370
+
371
+ After each task, mentally verify:
372
+
373
+ - [ ] Read only necessary files? (not everything)
374
+ - [ ] Skipped obvious verifications?
375
+ - [ ] Response under 10 sentences? (unless complex)
376
+ - [ ] Updated only changed docs?
377
+ - [ ] No redundant explanations?
378
+ - [ ] Communicated core info only?
379
+
380
+ **Goal: 80% fewer tokens for same quality output**
381
+
382
+ ---
383
+
384
+ ## Examples: Before & After
385
+
386
+ ### Example 1: Color Change
387
+
388
+ **Before (Wasteful):**
389
+ ```
390
+ I'll start by reading the design system documentation to understand
391
+ the color palette, then inspect the current button implementation
392
+ to see how colors are applied, verify that the change won't affect
393
+ other components, update the button component, test it visually,
394
+ and update the documentation.
395
+
396
+ [Reads 5 files]
397
+ [Makes change]
398
+ [Runs tests]
399
+ [Long explanation of what was changed]
400
+ ```
401
+ **Tokens:** ~2000
402
+
403
+ **After (Efficient):**
404
+ ```
405
+ Checking design.md... Primary blue is #2563eb.
406
+
407
+ Changed Button.tsx:
408
+ - bg-gray-500 → bg-blue-600
409
+
410
+ Done.
411
+ ```
412
+ **Tokens:** ~100
413
+
414
+ ### Example 2: Bug Fix
415
+
416
+ **Before (Wasteful):**
417
+ ```
418
+ I understand you're experiencing an issue with the login form.
419
+ Let me investigate by reading through the authentication flow,
420
+ checking the form validation logic, inspecting the API route,
421
+ and examining the error handling. After thorough analysis...
422
+
423
+ [Reads 10 files]
424
+ [Explains entire auth system]
425
+ [Fixes bug]
426
+ [Re-explains what was wrong]
427
+ ```
428
+ **Tokens:** ~3000
429
+
430
+ **After (Efficient):**
431
+ ```
432
+ Found issue: Missing null check in auth.ts line 67.
433
+
434
+ Fixed:
435
+ if (user) { redirect('/dashboard') }
436
+ →
437
+ if (user?.id) { redirect('/dashboard') }
438
+
439
+ Tested: Login works now.
440
+ ```
441
+ **Tokens:** ~150
442
+
443
+ ---
444
+
445
+ ## Summary: The Efficiency Mindset
446
+
447
+ **Think:**
448
+ - What's the MINIMUM I need to read?
449
+ - What's the MINIMUM I need to verify?
450
+ - What's the MINIMUM I need to say?
451
+
452
+ **Default Mode:**
453
+ 1. Read memory.md (quick context)
454
+ 2. Read affected files only
455
+ 3. Make change
456
+ 4. Update memory.md
457
+ 5. Brief confirmation
458
+
459
+ **Caveman Mode Mantra:**
460
+ - Short words
461
+ - No fluff
462
+ - Just facts
463
+ - Action → Result → Done
464
+
465
+ **Goal:** 5x faster task completion, 80% fewer tokens, same quality.
466
+
467
+ ---
468
+
469
+ ## Enable Caveman Mode
470
+
471
+ **User says:** "Use caveman mode" or "Be concise" or "Token optimize"
472
+
473
+ **You respond:**
474
+ ```
475
+ Caveman mode ON.
476
+ Short responses.
477
+ No fluff.
478
+ Ready.
479
+ ```
480
+
481
+ **All subsequent responses:** Ultra-brief, action-focused, fact-only.