telo3-ai 5.0.7 → 6.2.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.
Files changed (47) hide show
  1. package/README.md +32 -791
  2. package/SKILL.md +36 -657
  3. package/bootstrap/TELO3.md +17 -0
  4. package/cli.js +223 -42
  5. package/hooks/inject-contract.mjs +23 -0
  6. package/hooks/session-start.example.json +15 -0
  7. package/index.js +48 -14
  8. package/package.json +32 -69
  9. package/references/accessibility-quality.md +92 -272
  10. package/references/ai-behavior.md +70 -332
  11. package/references/anti-slop.md +71 -0
  12. package/references/document-specification.md +110 -419
  13. package/references/legal-compliance.md +90 -395
  14. package/references/performance-quality.md +100 -351
  15. package/references/privacy-compliance.md +88 -464
  16. package/references/project-audit.md +79 -440
  17. package/references/security-quality.md +68 -220
  18. package/references/seo-quality.md +83 -339
  19. package/references/smart-skill-delegation.md +73 -419
  20. package/references/token-optimization.md +83 -450
  21. package/references/ui-quality.md +106 -481
  22. package/references/workflow.md +91 -447
  23. package/scripts/postinstall.mjs +27 -0
  24. package/src/activate.js +159 -0
  25. package/src/context.js +72 -0
  26. package/src/find-context.js +41 -0
  27. package/src/init.js +38 -0
  28. package/src/install.js +128 -0
  29. package/src/paths.js +20 -0
  30. package/src/status.js +30 -0
  31. package/src/tokens.js +10 -0
  32. package/src/validate.js +220 -0
  33. package/src/version.js +12 -0
  34. package/templates/architecture.md +17 -398
  35. package/templates/design.md +22 -631
  36. package/templates/memory.md +13 -351
  37. package/templates/prd.md +15 -295
  38. package/templates/rules.md +20 -600
  39. package/templates/tasks.md +10 -210
  40. package/AI-CONTEXT.md +0 -272
  41. package/ONBOARDING-SKILL.md +0 -738
  42. package/SKILL-METADATA.json +0 -237
  43. package/scripts/init-project-context.sh +0 -139
  44. package/scripts/validate-project-context.sh +0 -164
  45. package/skills/telo3/SKILL.md +0 -315
  46. package/skills/telo3-context/SKILL.md +0 -272
  47. package/skills/telo3-onboarding/SKILL.md +0 -738
@@ -1,351 +1,100 @@
1
- # Performance Quality Standards
2
-
3
- > Performance optimization framework focusing on Core Web Vitals and user experience.
4
-
5
- ---
6
-
7
- ## Core Web Vitals
8
-
9
- ### 1. LCP (Largest Contentful Paint)
10
- **Measures:** Loading performance
11
- **Target:** < 2.5 seconds
12
- **Good:** < 2.5s | **Needs Improvement:** 2.5-4s | **Poor:** > 4s
13
-
14
- **How to improve:**
15
- - Optimize images (WebP/AVIF, proper sizing)
16
- - Reduce server response time (TTFB)
17
- - Remove render-blocking resources
18
- - Use CDN
19
- - Implement caching
20
- - Preload critical resources
21
-
22
- ### 2. INP (Interaction to Next Paint)
23
- **Replaces:** FID (First Input Delay)
24
- **Measures:** Responsiveness
25
- **Target:** < 200ms
26
- **Good:** < 200ms | **Needs Improvement:** 200-500ms | **Poor:** > 500ms
27
-
28
- **How to improve:**
29
- - Minimize JavaScript execution
30
- - Break up long tasks
31
- - Optimize event handlers
32
- - Use web workers for heavy computation
33
- - Debounce/throttle frequent events
34
- - Code split large bundles
35
-
36
- ### 3. CLS (Cumulative Layout Shift)
37
- **Measures:** Visual stability
38
- **Target:** < 0.1
39
- **Good:** < 0.1 | **Needs Improvement:** 0.1-0.25 | **Poor:** > 0.25
40
-
41
- **How to improve:**
42
- - Set image dimensions (width/height)
43
- - Set dimensions for ads/embeds
44
- - Avoid inserting content above existing content
45
- - Use CSS transforms for animations
46
- - Preload fonts
47
- - Reserve space for dynamic content
48
-
49
- ---
50
-
51
- ## Performance Audit Checklist
52
-
53
- ### Images
54
- - [ ] Images optimized (compressed)
55
- - [ ] Modern formats (WebP, AVIF with fallbacks)
56
- - [ ] Appropriate sizing (no giant images scaled down)
57
- - [ ] Lazy loading for below-the-fold images
58
- - [ ] Responsive images (`srcset`, `sizes`)
59
- - [ ] Image dimensions set (prevent CLS)
60
- - [ ] Critical images preloaded
61
-
62
- ### JavaScript
63
- - [ ] Minimize JavaScript bundle size
64
- - [ ] Code splitting implemented
65
- - [ ] Tree shaking enabled
66
- - [ ] Unused code removed
67
- - [ ] Third-party scripts minimized
68
- - [ ] Scripts loaded async/defer where appropriate
69
- - [ ] No render-blocking JavaScript
70
-
71
- ### CSS
72
- - [ ] Critical CSS inlined
73
- - [ ] Unused CSS removed
74
- - [ ] CSS minified
75
- - [ ] No render-blocking stylesheets (or minimal)
76
-
77
- ### Fonts
78
- - [ ] Font files optimized (woff2)
79
- - [ ] Fonts preloaded
80
- - [ ] `font-display: swap` used
81
- - [ ] System fonts considered (fastest)
82
- - [ ] Subsetting used if applicable
83
-
84
- ### Caching
85
- - [ ] Static assets cached (long cache lifetime)
86
- - [ ] Cache-Control headers set
87
- - [ ] Service worker implemented (if applicable)
88
- - [ ] CDN used for static assets
89
-
90
- ### Server
91
- - [ ] Fast server response time (TTFB < 200ms)
92
- - [ ] HTTP/2 or HTTP/3 enabled
93
- - [ ] Compression enabled (gzip/brotli)
94
- - [ ] Database queries optimized
95
- - [ ] API responses cached where appropriate
96
-
97
- ### Rendering
98
- - [ ] Server-side rendering or static generation (for public content)
99
- - [ ] Avoid layout shifts
100
- - [ ] Minimize reflows/repaints
101
- - [ ] Use CSS transforms for animations (GPU-accelerated)
102
-
103
- ### Third-Party Resources
104
- - [ ] Minimize third-party scripts
105
- - [ ] Load third-party scripts async
106
- - [ ] Consider self-hosting third-party resources
107
- - [ ] Use facade technique for embeds (YouTube, etc.)
108
-
109
- ---
110
-
111
- ## Image Optimization
112
-
113
- ### Format Selection
114
- - **WebP:** Good balance (support: 95%+)
115
- - **AVIF:** Best compression (support: 85%+, use with fallback)
116
- - **JPEG:** Fallback for photos
117
- - **PNG:** Fallback for graphics with transparency
118
- - **SVG:** Vector graphics (icons, logos)
119
-
120
- ### Responsive Images
121
-
122
- ```html
123
- <img
124
- src="/image.jpg"
125
- srcset="
126
- /image-320w.jpg 320w,
127
- /image-640w.jpg 640w,
128
- /image-1280w.jpg 1280w
129
- "
130
- sizes="(max-width: 640px) 100vw, 640px"
131
- alt="Description"
132
- width="640"
133
- height="480"
134
- loading="lazy"
135
- />
136
- ```
137
-
138
- ### Next.js Image Optimization
139
-
140
- ```jsx
141
- import Image from 'next/image';
142
-
143
- <Image
144
- src="/image.jpg"
145
- alt="Description"
146
- width={640}
147
- height={480}
148
- loading="lazy" // or "eager" for above-fold
149
- placeholder="blur"
150
- blurDataURL="..."
151
- />
152
- ```
153
-
154
- ---
155
-
156
- ## Code Splitting
157
-
158
- ### Dynamic Imports
159
-
160
- ```javascript
161
- // Lazy load component
162
- const HeavyComponent = lazy(() => import('./HeavyComponent'));
163
-
164
- // Lazy load library
165
- button.addEventListener('click', async () => {
166
- const {default: library} = await import('heavy-library');
167
- library.doSomething();
168
- });
169
- ```
170
-
171
- ### Route-Based Splitting
172
- Next.js automatically code-splits by page.
173
-
174
- ---
175
-
176
- ## Font Loading Strategy
177
-
178
- ### Option 1: System Fonts (Fastest)
179
- ```css
180
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
181
- ```
182
-
183
- ### Option 2: Self-Hosted Fonts
184
- ```css
185
- @font-face {
186
- font-family: 'Inter';
187
- src: url('/fonts/inter.woff2') format('woff2');
188
- font-display: swap;
189
- font-weight: 400;
190
- }
191
- ```
192
-
193
- ### Option 3: next/font (Next.js)
194
- ```javascript
195
- import { Inter } from 'next/font/google';
196
-
197
- const inter = Inter({ subsets: ['latin'], display: 'swap' });
198
- ```
199
-
200
- ---
201
-
202
- ## Lazy Loading
203
-
204
- ### Images
205
- ```html
206
- <img src="image.jpg" alt="Description" loading="lazy">
207
- ```
208
-
209
- ### Components (React)
210
- ```javascript
211
- const LazyComponent = React.lazy(() => import('./Component'));
212
-
213
- <Suspense fallback={<LoadingSpinner />}>
214
- <LazyComponent />
215
- </Suspense>
216
- ```
217
-
218
- ### Intersection Observer (Custom)
219
- ```javascript
220
- const observer = new IntersectionObserver((entries) => {
221
- entries.forEach(entry => {
222
- if (entry.isIntersecting) {
223
- // Load resource
224
- }
225
- });
226
- });
227
-
228
- observer.observe(element);
229
- ```
230
-
231
- ---
232
-
233
- ## Measuring Performance
234
-
235
- ### Tools
236
- - **Lighthouse** (Chrome DevTools) — Comprehensive audit
237
- - **PageSpeed Insights** — Google's tool
238
- - **WebPageTest** — Detailed analysis
239
- - **Chrome DevTools Performance tab** — Profiling
240
- - **Real User Monitoring (RUM)** — Actual user data
241
-
242
- ### Metrics to Track
243
- - Largest Contentful Paint (LCP)
244
- - Interaction to Next Paint (INP)
245
- - Cumulative Layout Shift (CLS)
246
- - Time to First Byte (TTFB)
247
- - First Contentful Paint (FCP)
248
- - Total Blocking Time (TBT)
249
- - Bundle size
250
- - Page load time
251
-
252
- ---
253
-
254
- ## Performance Budget
255
-
256
- Set limits to prevent regression:
257
-
258
- ```json
259
- {
260
- "budgets": [
261
- {
262
- "resourceSizes": [
263
- {"resourceType": "script", "budget": 300},
264
- {"resourceType": "image", "budget": 500},
265
- {"resourceType": "total", "budget": 1000}
266
- ],
267
- "timings": [
268
- {"metric": "interactive", "budget": 3000},
269
- {"metric": "first-contentful-paint", "budget": 1500}
270
- ]
271
- }
272
- ]
273
- }
274
- ```
275
-
276
- ---
277
-
278
- ## Common Performance Mistakes
279
-
280
- ❌ Unoptimized images
281
- ❌ No lazy loading
282
- ❌ Large JavaScript bundles
283
- ❌ Render-blocking resources
284
- ❌ Missing image dimensions (CLS)
285
- ❌ Too many third-party scripts
286
- ❌ No caching strategy
287
- ❌ Unminified assets
288
- ❌ Synchronous loading of everything
289
- ❌ No code splitting
290
-
291
- ---
292
-
293
- ## Performance Documentation Template
294
-
295
- ```markdown
296
- ## Performance
297
-
298
- ### Core Web Vitals
299
- - **LCP:** [Current score]
300
- - **INP:** [Current score]
301
- - **CLS:** [Current score]
302
- - **Status:** [Good / Needs improvement]
303
-
304
- ### Optimization Status
305
- - **Images:** [Optimized (WebP/AVIF) / Needs work]
306
- - **Code splitting:** [Implemented / Not implemented]
307
- - **Lazy loading:** [Implemented / Partial]
308
- - **Caching:** [Configured / Needs configuration]
309
- - **Fonts:** [Optimized / Using system fonts]
310
-
311
- ### Bundle Size
312
- - **Total JavaScript:** [Size] KB
313
- - **Total CSS:** [Size] KB
314
- - **Budget:** [Target sizes]
315
-
316
- ### Performance Budget
317
- - **Defined:** [Yes/No]
318
- - **Enforced:** [Yes/No]
319
-
320
- ### Monitoring
321
- - **Tool:** [e.g., Lighthouse, Web Vitals, RUM]
322
- - **Frequency:** [e.g., On every deploy]
323
-
324
- ### Known Issues
325
- - [List performance issues or "None known"]
326
-
327
- ### Next Steps
328
- - [ ] [Performance task 1]
329
- - [ ] [Performance task 2]
330
- ```
331
-
332
- ---
333
-
334
- ## Quick Wins
335
-
336
- 1. Optimize images (WebP + lazy load)
337
- 2. Add image dimensions (prevent CLS)
338
- 3. Remove unused JavaScript/CSS
339
- 4. Enable compression (gzip/brotli)
340
- 5. Use CDN for static assets
341
- 6. Preload critical resources
342
- 7. Lazy load below-the-fold content
343
- 8. Minimize third-party scripts
344
- 9. Use `font-display: swap`
345
- 10. Set performance budget
346
-
347
- ---
348
-
349
- **Summary:** Performance is a feature, not an afterthought. Focus on Core Web Vitals. Optimize images, minimize JavaScript, prevent layout shifts, and measure continuously.
350
-
351
- **Remember:** Don't optimize prematurely—measure first, then optimize where it matters most to users.
1
+ # Performance Quality
2
+ **Load when:** any page/app speed work, Core Web Vitals issues, image/font/JS optimization, or performance review.
3
+
4
+ Measure first: profile before optimizing; never micro-optimize unmeasured code. Optimize where it matters most to users, then re-measure. Performance is a feature, not an afterthought.
5
+
6
+ ## Core Web Vitals targets
7
+ | Metric | Measures | Good | Needs improvement | Poor |
8
+ |---|---|---|---|---|
9
+ | LCP (Largest Contentful Paint) | Loading | < 2.5s | 2.5-4s | > 4s |
10
+ | INP (Interaction to Next Paint; replaces FID) | Responsiveness | < 200ms | 200-500ms | > 500ms |
11
+ | CLS (Cumulative Layout Shift) | Visual stability | < 0.1 | 0.1-0.25 | > 0.25 |
12
+
13
+ ### LCP fixes
14
+ - Optimize images (WebP/AVIF, proper sizing).
15
+ - Reduce server response time (TTFB).
16
+ - Remove render-blocking resources.
17
+ - Use CDN; implement caching.
18
+ - Preload critical resources.
19
+
20
+ ### INP fixes
21
+ - Minimize JavaScript execution; break up long tasks.
22
+ - Optimize event handlers; debounce/throttle frequent events.
23
+ - Web workers for heavy computation.
24
+ - Code-split large bundles.
25
+
26
+ ### CLS fixes
27
+ - Set image dimensions; set dimensions for ads/embeds.
28
+ - Never insert content above existing content.
29
+ - CSS transforms for animations; preload fonts.
30
+ - Reserve space for dynamic content.
31
+
32
+ ## Images
33
+ - Compress all images; correct sizing — no giant images scaled down.
34
+ - AVIF: best compression (~85%+ support; use with fallback).
35
+ - WebP: good balance (~95%+ support).
36
+ - JPEG fallback for photos; PNG fallback for transparency; SVG for icons/logos.
37
+ - Responsive images: `srcset` + `sizes` (e.g. 320w/640w/1280w variants).
38
+ - Set width/height attributes (prevents CLS).
39
+ - `loading="lazy"` below the fold; preload critical/above-fold images.
40
+ - Next.js: `next/image` with width/height, `loading="lazy"` (eager above fold), `placeholder="blur"` + blurDataURL.
41
+
42
+ ## JavaScript
43
+ - Minimize bundle size; remove unused code; tree shaking enabled.
44
+ - Code splitting: React.lazy + dynamic `import()` for components.
45
+ - Lazy-import heavy libraries on interaction (e.g. inside a click handler).
46
+ - Next.js code-splits per route automatically.
47
+ - Minimize third-party scripts; async/defer where appropriate; no render-blocking JS.
48
+ - Lazy components: React.lazy + Suspense fallback; IntersectionObserver for custom lazy loading.
49
+
50
+ ## CSS
51
+ - Inline critical CSS; remove unused CSS; minify.
52
+ - Eliminate or minimize render-blocking stylesheets.
53
+
54
+ ## Fonts
55
+ - System fonts fastest: `-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif`.
56
+ - Self-host optimized woff2 via `@font-face`; `font-display: swap`.
57
+ - Preload fonts; subset when applicable.
58
+ - Next.js: `next/font` (e.g. `Inter({ subsets: ['latin'], display: 'swap' })`).
59
+
60
+ ## Caching
61
+ - Long cache lifetimes for static assets; set Cache-Control headers.
62
+ - Service worker if applicable; CDN for static assets.
63
+
64
+ ## Server
65
+ - TTFB < 200ms; HTTP/2 or HTTP/3 enabled.
66
+ - gzip/brotli compression enabled.
67
+ - Optimize database queries; cache API responses where appropriate.
68
+
69
+ ## Rendering & Third Parties
70
+ - SSR or static generation for public content.
71
+ - Avoid layout shifts; minimize reflows/repaints.
72
+ - CSS transforms for animations (GPU-accelerated).
73
+ - Minimize third-party scripts; load async; consider self-hosting.
74
+ - Facade technique for embeds (YouTube, etc.): lightweight placeholder until interaction.
75
+
76
+ ## Performance Budget (example limits — set and enforce to prevent regression)
77
+ | Resource / metric | Budget |
78
+ |---|---|
79
+ | Script | 300 KB |
80
+ | Image | 500 KB |
81
+ | Total | 1000 KB |
82
+ | Time to interactive | 3000 ms |
83
+ | First contentful paint | 1500 ms |
84
+
85
+ ## Measure & Monitor
86
+ - Tools: Lighthouse (Chrome DevTools), PageSpeed Insights, WebPageTest.
87
+ - Chrome DevTools Performance tab for profiling; Real User Monitoring (RUM) for actual user data.
88
+ - Track: LCP, INP, CLS, TTFB, FCP, Total Blocking Time (TBT), bundle size, page load time.
89
+ - Re-measure on every deploy.
90
+
91
+ ## Common Mistakes
92
+ - Unoptimized images; no lazy loading; missing image dimensions (CLS).
93
+ - Large JavaScript bundles; no code splitting; render-blocking resources.
94
+ - Too many third-party scripts; synchronous loading of everything.
95
+ - No caching strategy; unminified assets.
96
+
97
+ ## Record in project docs
98
+ - Current LCP/INP/CLS scores and status; optimization status (images, splitting, lazy loading, caching, fonts).
99
+ - JS/CSS bundle sizes vs budget; budget defined/enforced.
100
+ - Monitoring tool and frequency; known issues; next steps.