@decocms/start 0.19.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 (185) hide show
  1. package/.cursor/skills/deco-api-call-dedup/SKILL.md +443 -0
  2. package/.cursor/skills/deco-apps-architecture/SKILL.md +255 -0
  3. package/.cursor/skills/deco-apps-architecture/app-pattern.md +288 -0
  4. package/.cursor/skills/deco-apps-architecture/commerce-types.md +239 -0
  5. package/.cursor/skills/deco-apps-architecture/new-app-guide.md +268 -0
  6. package/.cursor/skills/deco-apps-architecture/scripts-codegen.md +148 -0
  7. package/.cursor/skills/deco-apps-architecture/shared-utils.md +181 -0
  8. package/.cursor/skills/deco-apps-architecture/vtex-deep-structure.md +253 -0
  9. package/.cursor/skills/deco-apps-architecture/website-app.md +169 -0
  10. package/.cursor/skills/deco-apps-vtex-porting/SKILL.md +189 -0
  11. package/.cursor/skills/deco-apps-vtex-porting/adaptation-patterns.md +335 -0
  12. package/.cursor/skills/deco-apps-vtex-porting/commerce-porting.md +155 -0
  13. package/.cursor/skills/deco-apps-vtex-porting/cookie-auth-patterns.md +148 -0
  14. package/.cursor/skills/deco-apps-vtex-porting/structure-map.md +234 -0
  15. package/.cursor/skills/deco-apps-vtex-porting/transform-mapping.md +99 -0
  16. package/.cursor/skills/deco-apps-vtex-porting/website-porting.md +194 -0
  17. package/.cursor/skills/deco-apps-vtex-review/SKILL.md +234 -0
  18. package/.cursor/skills/deco-async-rendering-architecture/SKILL.md +270 -0
  19. package/.cursor/skills/deco-async-rendering-site-guide/SKILL.md +417 -0
  20. package/.cursor/skills/deco-cms-layout-caching/SKILL.md +293 -0
  21. package/.cursor/skills/deco-cms-route-config/SKILL.md +388 -0
  22. package/.cursor/skills/deco-core-architecture/SKILL.md +185 -0
  23. package/.cursor/skills/deco-core-architecture/blocks.md +196 -0
  24. package/.cursor/skills/deco-core-architecture/deco-vs-deco-start.md +191 -0
  25. package/.cursor/skills/deco-core-architecture/engine.md +220 -0
  26. package/.cursor/skills/deco-core-architecture/hooks-components.md +157 -0
  27. package/.cursor/skills/deco-core-architecture/plugins-clients.md +136 -0
  28. package/.cursor/skills/deco-core-architecture/runtime.md +116 -0
  29. package/.cursor/skills/deco-core-architecture/site-usage.md +165 -0
  30. package/.cursor/skills/deco-e2e-testing/SKILL.md +372 -0
  31. package/.cursor/skills/deco-e2e-testing/discovery.md +337 -0
  32. package/.cursor/skills/deco-e2e-testing/scripts/scaffold.sh +81 -0
  33. package/.cursor/skills/deco-e2e-testing/selectors.md +175 -0
  34. package/.cursor/skills/deco-e2e-testing/templates/package.json +18 -0
  35. package/.cursor/skills/deco-e2e-testing/templates/playwright.config.ts +65 -0
  36. package/.cursor/skills/deco-e2e-testing/templates/scripts/baseline.ts +279 -0
  37. package/.cursor/skills/deco-e2e-testing/templates/scripts/run-e2e.ts +194 -0
  38. package/.cursor/skills/deco-e2e-testing/templates/specs/ecommerce-flow.spec.ts +612 -0
  39. package/.cursor/skills/deco-e2e-testing/templates/tsconfig.json +12 -0
  40. package/.cursor/skills/deco-e2e-testing/templates/utils/metrics-collector.ts +918 -0
  41. package/.cursor/skills/deco-e2e-testing/troubleshooting.md +602 -0
  42. package/.cursor/skills/deco-edge-caching/SKILL.md +316 -0
  43. package/.cursor/skills/deco-full-analysis/SKILL.md +898 -0
  44. package/.cursor/skills/deco-full-analysis/checklists/asset-optimization.md +251 -0
  45. package/.cursor/skills/deco-full-analysis/checklists/bug-fix.md +189 -0
  46. package/.cursor/skills/deco-full-analysis/checklists/cache-strategy.md +144 -0
  47. package/.cursor/skills/deco-full-analysis/checklists/dependency-update.md +150 -0
  48. package/.cursor/skills/deco-full-analysis/checklists/hydration-fix.md +191 -0
  49. package/.cursor/skills/deco-full-analysis/checklists/image-optimization.md +180 -0
  50. package/.cursor/skills/deco-full-analysis/checklists/loader-optimization.md +165 -0
  51. package/.cursor/skills/deco-full-analysis/checklists/seo-fix.md +183 -0
  52. package/.cursor/skills/deco-full-analysis/checklists/site-cleanup.md +281 -0
  53. package/.cursor/skills/deco-full-analysis/discovery.md +548 -0
  54. package/.cursor/skills/deco-incident-debugging/SKILL.md +378 -0
  55. package/.cursor/skills/deco-incident-debugging/headless-mode.md +510 -0
  56. package/.cursor/skills/deco-incident-debugging/learnings-index.md +227 -0
  57. package/.cursor/skills/deco-incident-debugging/triage-workflow.md +312 -0
  58. package/.cursor/skills/deco-islands-migration/SKILL.md +251 -0
  59. package/.cursor/skills/deco-loader-n-plus-1-detector/SKILL.md +275 -0
  60. package/.cursor/skills/deco-performance-audit/SKILL.md +530 -0
  61. package/.cursor/skills/deco-performance-audit/tools-reference.md +428 -0
  62. package/.cursor/skills/deco-performance-audit/workflow.md +457 -0
  63. package/.cursor/skills/deco-server-functions-invoke/SKILL.md +92 -0
  64. package/.cursor/skills/deco-server-functions-invoke/architecture.md +166 -0
  65. package/.cursor/skills/deco-server-functions-invoke/generator.md +122 -0
  66. package/.cursor/skills/deco-server-functions-invoke/problem.md +98 -0
  67. package/.cursor/skills/deco-server-functions-invoke/troubleshooting.md +110 -0
  68. package/.cursor/skills/deco-site-deployment/SKILL.md +396 -0
  69. package/.cursor/skills/deco-site-memory-debugging/SKILL.md +121 -0
  70. package/.cursor/skills/deco-site-memory-debugging/cdp-connection.md +222 -0
  71. package/.cursor/skills/deco-site-memory-debugging/memory-analysis.md +362 -0
  72. package/.cursor/skills/deco-site-patterns/SKILL.md +124 -0
  73. package/.cursor/skills/deco-site-patterns/app-composition.md +337 -0
  74. package/.cursor/skills/deco-site-patterns/client-patterns.md +341 -0
  75. package/.cursor/skills/deco-site-patterns/cms-wiring.md +230 -0
  76. package/.cursor/skills/deco-site-patterns/section-patterns.md +340 -0
  77. package/.cursor/skills/deco-site-scaling-tuning/SKILL.md +240 -0
  78. package/.cursor/skills/deco-site-scaling-tuning/analysis-scripts.md +267 -0
  79. package/.cursor/skills/deco-start-architecture/SKILL.md +218 -0
  80. package/.cursor/skills/deco-start-architecture/admin-protocol.md +156 -0
  81. package/.cursor/skills/deco-start-architecture/cms-resolution.md +201 -0
  82. package/.cursor/skills/deco-start-architecture/code-quality.md +158 -0
  83. package/.cursor/skills/deco-start-architecture/gap-analysis.md +129 -0
  84. package/.cursor/skills/deco-start-architecture/sdk-utilities.md +197 -0
  85. package/.cursor/skills/deco-start-architecture/worker-entry-caching.md +154 -0
  86. package/.cursor/skills/deco-startup-analysis/SKILL.md +248 -0
  87. package/.cursor/skills/deco-storefront-test-checklist/SKILL.md +369 -0
  88. package/.cursor/skills/deco-tanstack-hydration-fixes/SKILL.md +468 -0
  89. package/.cursor/skills/deco-tanstack-navigation/SKILL.md +681 -0
  90. package/.cursor/skills/deco-tanstack-search/SKILL.md +411 -0
  91. package/.cursor/skills/deco-tanstack-storefront-patterns/SKILL.md +1013 -0
  92. package/.cursor/skills/deco-to-tanstack-migration/SKILL.md +518 -0
  93. package/.cursor/skills/deco-to-tanstack-migration/references/codemod-commands.md +174 -0
  94. package/.cursor/skills/deco-to-tanstack-migration/references/commerce/README.md +78 -0
  95. package/.cursor/skills/deco-to-tanstack-migration/references/deco-framework/README.md +128 -0
  96. package/.cursor/skills/deco-to-tanstack-migration/references/gotchas.md +719 -0
  97. package/.cursor/skills/deco-to-tanstack-migration/references/imports/README.md +70 -0
  98. package/.cursor/skills/deco-to-tanstack-migration/references/platform-hooks/README.md +154 -0
  99. package/.cursor/skills/deco-to-tanstack-migration/references/signals/README.md +220 -0
  100. package/.cursor/skills/deco-to-tanstack-migration/references/vite-config/README.md +78 -0
  101. package/.cursor/skills/deco-to-tanstack-migration/templates/package-json.md +55 -0
  102. package/.cursor/skills/deco-to-tanstack-migration/templates/root-route.md +110 -0
  103. package/.cursor/skills/deco-to-tanstack-migration/templates/router.md +96 -0
  104. package/.cursor/skills/deco-to-tanstack-migration/templates/setup-ts.md +167 -0
  105. package/.cursor/skills/deco-to-tanstack-migration/templates/vite-config.md +122 -0
  106. package/.cursor/skills/deco-to-tanstack-migration/templates/worker-entry.md +67 -0
  107. package/.cursor/skills/deco-typescript-fixes/SKILL.md +178 -0
  108. package/.cursor/skills/deco-typescript-fixes/common-fixes.md +330 -0
  109. package/.cursor/skills/deco-typescript-fixes/strategy.md +148 -0
  110. package/.cursor/skills/deco-variant-selection-perf/SKILL.md +272 -0
  111. package/.cursor/skills/deco-vtex-fetch-cache/SKILL.md +225 -0
  112. package/.cursor/skills/find-skills/SKILL.md +133 -0
  113. package/.cursor/skills/incident-report/SKILL.md +179 -0
  114. package/.cursor/skills/incident-report/references/5-whys.md +75 -0
  115. package/.cursor/skills/incident-report/templates/client-report.md +187 -0
  116. package/.cursor/skills/incident-report/templates/internal-report.md +206 -0
  117. package/.cursor/skills/template-skill/SKILL.md +38 -0
  118. package/.github/workflows/release.yml +32 -0
  119. package/.releaserc.json +25 -0
  120. package/CLAUDE.md +135 -0
  121. package/GAP_ANALYSIS.md +224 -0
  122. package/GAP_ANALYSIS_V2.md +1013 -0
  123. package/biome.json +39 -0
  124. package/knip.json +5 -0
  125. package/package.json +87 -0
  126. package/scripts/generate-blocks.ts +69 -0
  127. package/scripts/generate-invoke.ts +378 -0
  128. package/scripts/generate-schema.ts +657 -0
  129. package/src/admin/cors.ts +29 -0
  130. package/src/admin/decofile.ts +72 -0
  131. package/src/admin/index.ts +24 -0
  132. package/src/admin/invoke.ts +163 -0
  133. package/src/admin/liveControls.ts +29 -0
  134. package/src/admin/meta.ts +70 -0
  135. package/src/admin/render.ts +205 -0
  136. package/src/admin/schema.ts +686 -0
  137. package/src/admin/setup.ts +44 -0
  138. package/src/cms/index.ts +59 -0
  139. package/src/cms/loader.ts +180 -0
  140. package/src/cms/registry.ts +162 -0
  141. package/src/cms/resolve.ts +1005 -0
  142. package/src/cms/sectionLoaders.ts +294 -0
  143. package/src/hooks/DecoPageRenderer.tsx +444 -0
  144. package/src/hooks/LazySection.tsx +109 -0
  145. package/src/hooks/LiveControls.tsx +108 -0
  146. package/src/hooks/SectionErrorFallback.tsx +85 -0
  147. package/src/hooks/index.ts +8 -0
  148. package/src/index.ts +5 -0
  149. package/src/matchers/builtins.ts +184 -0
  150. package/src/matchers/posthog.ts +154 -0
  151. package/src/middleware/decoState.ts +55 -0
  152. package/src/middleware/healthMetrics.ts +131 -0
  153. package/src/middleware/index.ts +80 -0
  154. package/src/middleware/liveness.ts +21 -0
  155. package/src/middleware/observability.ts +205 -0
  156. package/src/routes/adminRoutes.ts +83 -0
  157. package/src/routes/cmsRoute.ts +302 -0
  158. package/src/routes/components.tsx +34 -0
  159. package/src/routes/index.ts +15 -0
  160. package/src/sdk/analytics.ts +72 -0
  161. package/src/sdk/cacheHeaders.ts +268 -0
  162. package/src/sdk/cachedLoader.ts +206 -0
  163. package/src/sdk/clx.ts +3 -0
  164. package/src/sdk/cookie.ts +39 -0
  165. package/src/sdk/createInvoke.ts +57 -0
  166. package/src/sdk/csp.ts +59 -0
  167. package/src/sdk/env.ts +27 -0
  168. package/src/sdk/index.ts +63 -0
  169. package/src/sdk/instrumentedFetch.ts +137 -0
  170. package/src/sdk/invoke.ts +133 -0
  171. package/src/sdk/mergeCacheControl.ts +150 -0
  172. package/src/sdk/redirects.ts +217 -0
  173. package/src/sdk/requestContext.ts +184 -0
  174. package/src/sdk/serverTimings.ts +68 -0
  175. package/src/sdk/signal.ts +41 -0
  176. package/src/sdk/sitemap.ts +143 -0
  177. package/src/sdk/urlUtils.ts +117 -0
  178. package/src/sdk/useDevice.ts +82 -0
  179. package/src/sdk/useId.ts +7 -0
  180. package/src/sdk/useScript.ts +101 -0
  181. package/src/sdk/workerEntry.ts +703 -0
  182. package/src/sdk/wrapCaughtErrors.ts +107 -0
  183. package/src/types/index.ts +39 -0
  184. package/src/types/widgets.ts +13 -0
  185. package/tsconfig.json +13 -0
@@ -0,0 +1,530 @@
1
+ ---
2
+ name: deco-performance-audit
3
+ description: Perform a deep dive analysis of CDN metrics, cache performance, error rates, and traffic patterns for a Deco site. Use this skill to identify performance bottlenecks, optimize cache hit rates, and reduce error rates.
4
+ ---
5
+
6
+ # Deco Performance Audit Skill
7
+
8
+ This skill performs a comprehensive performance analysis of a Deco site using CDN metrics and error logs. It generates actionable reports with specific recommendations.
9
+
10
+ ## When to Use This Skill
11
+
12
+ - Investigating slow page loads
13
+ - Analyzing cache effectiveness
14
+ - Debugging high error rates
15
+ - Understanding traffic patterns
16
+ - Before/after deployment comparisons
17
+ - Monthly performance reviews
18
+
19
+ ## What the Audit Produces
20
+
21
+ ### Performance Report
22
+ - Overall metrics summary (requests, bandwidth, cache rate)
23
+ - **Hot paths table** - Top 20 paths with requests AND bandwidth columns
24
+ - **Content type breakdown** - Grouped by type (API, HTML, JS, Images, etc.)
25
+ - **Bandwidth hotspots** - Which paths consume the most bandwidth
26
+ - Cache status breakdown with drill-down
27
+ - HTTP status code distribution
28
+ - **Time series analysis** - Peak hours, traffic patterns
29
+ - **Lazy section analysis** - `/deco/render` performance
30
+ - Error log analysis with grouping
31
+ - Geographic traffic distribution
32
+ - **Period comparison** - Week over week (if available)
33
+ - Actionable recommendations with priority
34
+
35
+ ## Tools Used
36
+
37
+ ### CDN Monitoring (MONITOR_* tools)
38
+
39
+ | Tool | Purpose |
40
+ |------|---------|
41
+ | `MONITOR_SUMMARY` | Overall metrics: requests, pageviews, bandwidth, cache ratio, latency |
42
+ | `MONITOR_TOP_PATHS` | Top URLs by requests or bandwidth |
43
+ | `MONITOR_CACHE_STATUS` | Cache hit/miss/expired breakdown |
44
+ | `MONITOR_STATUS_CODES` | HTTP status code distribution |
45
+ | `MONITOR_TOP_COUNTRIES` | Geographic traffic distribution |
46
+ | `MONITOR_USAGE_TIMELINE` | Time series usage data |
47
+
48
+ ### Error Logs (HyperDX)
49
+
50
+ | Tool | Purpose |
51
+ |------|---------|
52
+ | `SEARCH_LOGS` | Find error messages by query |
53
+ | `GET_LOG_DETAILS` | Get detailed log entries with grouping |
54
+ | `QUERY_CHART_DATA` | Time series error counts |
55
+
56
+ ### Tool Parameters
57
+
58
+ All MONITOR tools require:
59
+ ```json
60
+ {
61
+ "sitename": "mystore", // Deco site name
62
+ "hostname": "www.mystore.com", // Production hostname
63
+ "startDate": "2026-01-17", // YYYY-MM-DD
64
+ "endDate": "2026-01-18", // YYYY-MM-DD
65
+ "granularity": "daily" // "hourly" or "daily"
66
+ }
67
+ ```
68
+
69
+ Optional filters:
70
+ ```json
71
+ {
72
+ "filters": [
73
+ { "type": "path", "operator": "contains", "value": "/p" },
74
+ { "type": "cache_status", "operator": "equals", "value": "miss" },
75
+ { "type": "status_code", "operator": "equals", "value": "500" }
76
+ ]
77
+ }
78
+ ```
79
+
80
+ Filter types: `cache_status`, `status_code`, `path`, `country`
81
+ Operators: `equals`, `not_equals`, `contains`, `not_contains`
82
+
83
+ ## Workflow
84
+
85
+ ```
86
+ 1. Get MONITOR_SUMMARY → Overall health
87
+ 2. Get MONITOR_TOP_PATHS → Hot pages
88
+ 3. Get MONITOR_CACHE_STATUS → Cache effectiveness
89
+ 4. Get MONITOR_STATUS_CODES → Error rates
90
+ 5. SEARCH_LOGS → Find error patterns
91
+ 6. GET_LOG_DETAILS → Dig into specific errors
92
+ 7. Correlate with code → Find root causes
93
+ 8. Generate report → Actionable recommendations
94
+ ```
95
+
96
+ ## Metrics to Analyze
97
+
98
+ ### 1. Cache Performance
99
+
100
+ **Goal**: Cache hit ratio > 80%
101
+
102
+ ```
103
+ MONITOR_CACHE_STATUS response:
104
+ - hit: Served from cache (good)
105
+ - miss: Origin fetch required (optimize)
106
+ - expired: Cache expired, refetched
107
+ - revalidated: Cache validated with origin
108
+ - unknown: No cache header
109
+ ```
110
+
111
+ **Red Flags**:
112
+ - Cache hit ratio < 50%
113
+ - High "unknown" cache status (missing headers)
114
+ - High "miss" on static assets
115
+
116
+ **Recommendations**:
117
+ - Add cache-control headers to loaders
118
+ - Use stale-while-revalidate for dynamic content
119
+ - Cache static assets aggressively
120
+
121
+ ### 2. Error Rates
122
+
123
+ **Goal**: 5xx errors < 0.1%, 4xx < 5%
124
+
125
+ ```
126
+ MONITOR_STATUS_CODES response:
127
+ - 200: Success
128
+ - 301/302/307: Redirects (expected but minimize)
129
+ - 304: Not Modified (good - client cache)
130
+ - 400: Bad Request (client issue)
131
+ - 404: Not Found (check for broken links)
132
+ - 429: Too Many Requests (rate limiting)
133
+ - 500: Server Error (investigate immediately)
134
+ - 502/504: Gateway errors (origin issues)
135
+ ```
136
+
137
+ **Red Flags**:
138
+ - 5xx > 0.5%
139
+ - 429 > 5% (hitting rate limits)
140
+ - 404 > 10% (broken links/SEO issue)
141
+
142
+ ### 3. Hot Paths & Traffic Analysis
143
+
144
+ **Goal**: Understand traffic patterns with full visibility
145
+
146
+ #### MUST Include: Complete Hot Paths Table
147
+
148
+ Always generate a table showing the actual data:
149
+
150
+ ```markdown
151
+ ### Hot Paths by Requests
152
+
153
+ | Rank | Path | Requests | % | Bandwidth | Cache Hit |
154
+ |------|------|----------|---|-----------|-----------|
155
+ | 1 | `/live/invoke/vtex/loaders/...` | 835K | 4.0% | 46.9GB | 0.0002% |
156
+ | 2 | `/_frsh/js/chunk-abc123.js` | 524K | 2.5% | 15.2GB | 94.3% |
157
+ | 3 | `/sprites.svg` | 312K | 1.5% | 890MB | 99.1% |
158
+ | ... | ... | ... | ... | ... | ... |
159
+
160
+ ### Hot Paths by Bandwidth
161
+
162
+ | Rank | Path | Bandwidth | % | Requests | Notes |
163
+ |------|------|-----------|---|----------|-------|
164
+ | 1 | `/live/invoke/vtex/loaders/...` | 46.9GB | 35% | 835K | 🔴 Uncached |
165
+ | 2 | `/_frsh/js/chunk-abc123.js` | 15.2GB | 11% | 524K | ✅ Well cached |
166
+ | ... | ... | ... | ... | ... | ... |
167
+ ```
168
+
169
+ #### Content Type Grouping
170
+
171
+ Group paths by type for clearer analysis:
172
+
173
+ | Content Type | Pattern | Requests | Bandwidth | Cache Rate |
174
+ |--------------|---------|----------|-----------|------------|
175
+ | **API Calls** | `/live/invoke/*` | 2.1M | 89GB | 0.05% |
176
+ | **Lazy Sections** | `/deco/render` | 450K | 12GB | 15% |
177
+ | **JavaScript** | `/_frsh/js/*` | 1.8M | 45GB | 94% |
178
+ | **Static Images** | `/image/*`, `*.png/jpg` | 890K | 120GB | 88% |
179
+ | **HTML Pages** | `/`, `/s`, `/:slug/p` | 320K | 8GB | 5% |
180
+ | **Fonts** | `*.woff2` | 210K | 3.2GB | 99% |
181
+ | **Icons** | `/sprites.svg` | 180K | 540MB | 99% |
182
+
183
+ This grouping reveals:
184
+ - API calls often consume most bandwidth but have low cache
185
+ - Lazy sections (`/deco/render`) need cache optimization
186
+ - Static assets should have >90% cache rate
187
+
188
+ ### 4. Lazy Section Analysis
189
+
190
+ **Goal**: Understand `/deco/render` performance
191
+
192
+ ```
193
+ MONITOR_TOP_PATHS with filter:
194
+ filters: [{ type: "path", operator: "contains", value: "/deco/render" }]
195
+ ```
196
+
197
+ Analyze:
198
+ | Section (from query params) | Requests | Avg Latency | Cache Hit |
199
+ |-----------------------------|----------|-------------|-----------|
200
+ | ProductShelf | 120K | 180ms | 12% |
201
+ | Reviews | 85K | 220ms | 5% |
202
+ | SimilarProducts | 65K | 350ms | 0% |
203
+
204
+ **Red Flags**:
205
+ - Lazy sections with 0% cache = every scroll triggers origin fetch
206
+ - High latency on popular sections = poor UX
207
+
208
+ ### 5. Time Series Analysis
209
+
210
+ **Goal**: Identify traffic patterns and correlations
211
+
212
+ ```
213
+ MONITOR_USAGE_TIMELINE with granularity: "hourly"
214
+ ```
215
+
216
+ Generate:
217
+ | Hour | Requests | Errors | Cache Hit % | Notes |
218
+ |------|----------|--------|-------------|-------|
219
+ | 00:00 | 85K | 12 | 52% | Low traffic |
220
+ | 10:00 | 320K | 45 | 48% | Morning peak |
221
+ | 14:00 | 410K | 120 | 45% | Afternoon peak |
222
+ | 20:00 | 380K | 200 | 44% | Evening peak, **error spike** |
223
+
224
+ Look for:
225
+ - Peak hours (when to avoid deployments)
226
+ - Error spikes correlated with traffic spikes
227
+ - Cache hit rate degradation under load
228
+
229
+ ### 6. Bandwidth Hotspots
230
+
231
+ **Goal**: Find paths consuming disproportionate bandwidth
232
+
233
+ Sort by bandwidth descending and highlight:
234
+ - Uncached large payloads (JSON API responses)
235
+ - Large images not going through optimization
236
+ - JS bundles that could be smaller
237
+
238
+ ```markdown
239
+ 🔴 **Bandwidth Concerns**:
240
+ | Path | Bandwidth | Cache | Issue |
241
+ |------|-----------|-------|-------|
242
+ | `/live/invoke/vtex/loaders/productList` | 46GB | 0% | Uncached, high volume |
243
+ | `/deco/render?section=BigCarousel` | 8GB | 5% | Large payloads |
244
+ ```
245
+
246
+ ### 4. Error Log Analysis
247
+
248
+ **Common Error Patterns**:
249
+
250
+ | Error | Meaning | Action |
251
+ |-------|---------|--------|
252
+ | "Too Many Requests" | VTEX rate limiting | Reduce API calls, add caching |
253
+ | "TypeError: Cannot read" | JS runtime error | Fix the code |
254
+ | "Failed to fetch" | Network/API issue | Add retries, timeout handling |
255
+ | "Oops! dangling reference" | Missing block | Fix block config |
256
+
257
+ **Searching Logs**:
258
+ ```
259
+ SEARCH_LOGS({
260
+ query: "level:error site:mystore",
261
+ limit: 50
262
+ })
263
+ ```
264
+
265
+ **Getting Details**:
266
+ ```
267
+ GET_LOG_DETAILS({
268
+ query: "level:error site:mystore",
269
+ groupBy: ["body", "service", "site"]
270
+ })
271
+ ```
272
+
273
+ ## Report Template
274
+
275
+ ```markdown
276
+ # Performance Audit Report - [Site Name]
277
+
278
+ **Period**: 2026-01-17 to 2026-01-18
279
+ **Generated**: 2026-01-18T15:00:00Z
280
+
281
+ ---
282
+
283
+ ## Executive Summary
284
+
285
+ | Metric | Value | Status |
286
+ |--------|-------|--------|
287
+ | Total Requests | 20.4M | - |
288
+ | Total Bandwidth | 1.2 TB | - |
289
+ | Cache Hit Ratio | 42.8% | 🔴 Below 80% target |
290
+ | API Avg Latency | 245ms | 🟡 Review |
291
+ | 5xx Error Rate | 0.017% | 🟢 Below 0.1% |
292
+ | 429 Rate Limit | 6.8% | 🔴 High |
293
+
294
+ ### Key Findings
295
+ 1. **Finding 1** with impact and recommendation
296
+ 2. **Finding 2** with impact and recommendation
297
+ 3. **Finding 3** with impact and recommendation
298
+
299
+ ---
300
+
301
+ ## Traffic Analysis
302
+
303
+ ### Hot Paths by Requests (Top 15)
304
+
305
+ | # | Path | Requests | % | Bandwidth | Cache Hit |
306
+ |---|------|----------|---|-----------|-----------|
307
+ | 1 | `/live/invoke/vtex/loaders/...` | 835K | 4.0% | 46.9GB | 🔴 0.0% |
308
+ | 2 | `/_frsh/js/chunk-abc.js` | 524K | 2.5% | 15.2GB | 🟢 94.3% |
309
+ | 3 | `/sprites.svg` | 312K | 1.5% | 890MB | 🟢 99.1% |
310
+ | ... | ... | ... | ... | ... | ... |
311
+
312
+ ### Bandwidth Hotspots (Top 10 by GB)
313
+
314
+ | # | Path | Bandwidth | % of Total | Cache | Action |
315
+ |---|------|-----------|------------|-------|--------|
316
+ | 1 | `/live/invoke/vtex/loaders/productList` | 46.9GB | 15% | 🔴 0% | Add caching |
317
+ | 2 | `/_frsh/js/*` (combined) | 25GB | 8% | 🟢 94% | OK |
318
+ | 3 | `/deco/render?section=Carousel` | 12GB | 4% | 🟡 15% | Improve cache |
319
+
320
+ ### Content Type Summary
321
+
322
+ | Type | Requests | Bandwidth | Cache Rate | Notes |
323
+ |------|----------|-----------|------------|-------|
324
+ | API (`/live/invoke/*`) | 2.1M | 89GB | 0.05% | 🔴 Needs caching |
325
+ | Lazy Sections (`/deco/render`) | 450K | 12GB | 15% | 🟡 Improve |
326
+ | JavaScript (`/_frsh/*`) | 1.8M | 45GB | 94% | 🟢 Good |
327
+ | Images | 890K | 120GB | 88% | 🟢 Good |
328
+ | HTML Pages | 320K | 8GB | 5% | 🟡 Expected for dynamic |
329
+ | Fonts | 210K | 3.2GB | 99% | 🟢 Excellent |
330
+
331
+ ---
332
+
333
+ ## Lazy Section Performance
334
+
335
+ ### /deco/render Analysis
336
+
337
+ | Section | Requests | Bandwidth | Avg Latency | Cache | Priority |
338
+ |---------|----------|-----------|-------------|-------|----------|
339
+ | ProductShelf | 120K | 3.2GB | 180ms | 12% | 🔴 High |
340
+ | Reviews | 85K | 1.8GB | 220ms | 5% | 🔴 High |
341
+ | SimilarProducts | 65K | 2.1GB | 350ms | 0% | 🔴 Critical |
342
+ | FAQ | 45K | 890MB | 85ms | 45% | 🟢 OK |
343
+
344
+ **Issues**:
345
+ - SimilarProducts has 0% cache hit - every scroll fetches from origin
346
+ - High latency on Reviews section affects perceived performance
347
+
348
+ ---
349
+
350
+ ## Time Series (24h Pattern)
351
+
352
+ | Hour | Requests | 5xx | 429 | Cache Hit | Notes |
353
+ |------|----------|-----|-----|-----------|-------|
354
+ | 00-06 | 85K/hr | <10 | 120 | 52% | Low traffic |
355
+ | 06-10 | 180K/hr | 25 | 450 | 48% | Morning ramp |
356
+ | 10-14 | 320K/hr | 45 | 1.2K | 45% | Peak hours |
357
+ | 14-18 | 280K/hr | 40 | 980 | 46% | Steady |
358
+ | 18-22 | 380K/hr | 120 | 1.8K | 44% | Evening peak, **429 spike** |
359
+ | 22-00 | 150K/hr | 20 | 320 | 50% | Wind down |
360
+
361
+ **Pattern Analysis**:
362
+ - Peak: 10:00-14:00 and 18:00-22:00
363
+ - 429 errors correlate with evening peak
364
+ - Cache hit degrades under high load
365
+
366
+ ---
367
+
368
+ ## Cache Analysis
369
+
370
+ ### Status Breakdown
371
+
372
+ | Status | Requests | % | Bandwidth | Issue |
373
+ |--------|----------|---|-----------|-------|
374
+ | HIT | 8.7M | 42.8% | 480GB | ✅ |
375
+ | MISS | 6.6M | 32.4% | 520GB | 🟡 Review |
376
+ | UNKNOWN | 4.7M | 23.0% | 180GB | 🔴 Missing headers |
377
+ | expired | 280K | 1.4% | 15GB | - |
378
+ | revalidated | 80K | 0.4% | 5GB | - |
379
+
380
+ ### Uncached Hot Paths (Cache MISS filter)
381
+
382
+ | Path | Requests | Bandwidth | Should Cache? |
383
+ |------|----------|-----------|---------------|
384
+ | `/live/invoke/vtex/loaders/productList` | 450K | 32GB | ✅ Yes, with SWR |
385
+ | `/live/invoke/site/loaders/search` | 280K | 18GB | ✅ Yes, short TTL |
386
+ | `/deco/render?section=Reviews` | 85K | 1.8GB | ✅ Yes |
387
+
388
+ ---
389
+
390
+ ## Error Analysis
391
+
392
+ ### HTTP Status Distribution
393
+
394
+ | Status | Count | % | Trend | Action |
395
+ |--------|-------|---|-------|--------|
396
+ | 200 | 18.2M | 89.2% | - | ✅ |
397
+ | 304 | 680K | 3.3% | - | ✅ Good client cache |
398
+ | **429** | **1.38M** | **6.8%** | ↑ | 🔴 **Rate limiting** |
399
+ | 404 | 536K | 2.6% | → | 🟡 Audit links |
400
+ | 500 | 3.1K | 0.015% | → | ✅ Low |
401
+
402
+ ### 500 Error Breakdown
403
+
404
+ | Path | Count | % of 500s | Root Cause |
405
+ |------|-------|-----------|------------|
406
+ | `/live/invoke/vtex/actions/cart/simulation` | 1.4K | 45% | VTEX timeout |
407
+ | `/live/invoke/site/loaders/search` | 380 | 12% | Search API |
408
+
409
+ ### Error Log Patterns
410
+
411
+ | Error Message | Count | Service | Action |
412
+ |---------------|-------|---------|--------|
413
+ | "Too Many Requests" | 1.2K | vtex | Add request dedup |
414
+ | "The operation was canceled" | 450 | catalog | Increase timeout |
415
+ | "TypeError: Cannot read..." | 85 | site | Fix code |
416
+
417
+ ---
418
+
419
+ ## Geographic Distribution
420
+
421
+ | Country | Requests | % | Expected? |
422
+ |---------|----------|---|-----------|
423
+ | Brazil | 18.5M | 90.7% | ✅ Primary market |
424
+ | USA | 500K | 2.4% | 🟡 Could be CDN/bots |
425
+ | Unknown | 380K | 1.9% | 🟡 Review |
426
+ | ... | ... | ... | ... |
427
+
428
+ ---
429
+
430
+ ## Recommendations
431
+
432
+ ### 🔴 High Priority
433
+
434
+ | # | Issue | Impact | Fix |
435
+ |---|-------|--------|-----|
436
+ | 1 | 23% requests have unknown cache | Wasted bandwidth | Add `export const cache` to loaders |
437
+ | 2 | 6.8% hitting rate limits | User errors | Implement request deduplication |
438
+ | 3 | SimilarProducts 0% cache | High latency | Add SWR cache |
439
+
440
+ ### 🟡 Medium Priority
441
+
442
+ | # | Issue | Impact | Fix |
443
+ |---|-------|--------|-----|
444
+ | 4 | 2.6% 404 errors | SEO impact | Audit broken links |
445
+ | 5 | Cart simulation errors | Checkout drops | Add retry logic |
446
+
447
+ ### 🟢 Low Priority
448
+
449
+ | # | Issue | Impact | Fix |
450
+ |---|-------|--------|-----|
451
+ | 6 | Non-BR traffic | Possible bots | Monitor, consider geo-blocking |
452
+
453
+ ---
454
+
455
+ ## Targets
456
+
457
+ | Metric | Current | Target | Gap | Priority |
458
+ |--------|---------|--------|-----|----------|
459
+ | Cache Hit Ratio | 42.8% | 80% | -37.2% | 🔴 |
460
+ | 429 Error Rate | 6.8% | <0.5% | -6.3% | 🔴 |
461
+ | Unknown Cache | 23% | <5% | -18% | 🔴 |
462
+ | 404 Error Rate | 2.6% | <2% | -0.6% | 🟡 |
463
+ ```
464
+
465
+ ## Example Queries
466
+
467
+ ### Find pages with high miss rate
468
+ ```
469
+ MONITOR_TOP_PATHS with filter:
470
+ filters: [{ type: "cache_status", operator: "equals", value: "miss" }]
471
+ ```
472
+
473
+ ### Find 5xx errors by path
474
+ ```
475
+ MONITOR_TOP_PATHS with filter:
476
+ filters: [{ type: "status_code", operator: "contains", value: "5" }]
477
+ ```
478
+
479
+ ### Error trend over time
480
+ ```
481
+ QUERY_CHART_DATA({
482
+ series: [{
483
+ dataSource: "events",
484
+ aggFn: "count",
485
+ where: "level:error site:mystore",
486
+ groupBy: ["service"]
487
+ }],
488
+ granularity: "1 hour"
489
+ })
490
+ ```
491
+
492
+ ## Integration with deco-full-analysis
493
+
494
+ Use this skill after running `deco-full-analysis` to:
495
+
496
+ 1. **Correlate** performance issues with specific loaders/sections
497
+ 2. **Identify** which custom code paths are problematic
498
+ 3. **Validate** that lazy loading is working correctly
499
+ 4. **Verify** cache headers on custom loaders
500
+
501
+ ## Best Practices
502
+
503
+ ### Cache Headers for Loaders
504
+
505
+ ```typescript
506
+ // loaders/myLoader.ts
507
+ export const cache = "stale-while-revalidate";
508
+ export const cacheKey = (props: Props) => `${props.id}`;
509
+ ```
510
+
511
+ ### Reducing API Calls
512
+
513
+ ```typescript
514
+ // Use loader deduplication
515
+ // Same loader called multiple times = single fetch
516
+ export const cache = "stale-while-revalidate";
517
+ ```
518
+
519
+ ### Error Handling
520
+
521
+ ```typescript
522
+ // Graceful degradation
523
+ try {
524
+ const data = await fetch(url);
525
+ return data;
526
+ } catch (e) {
527
+ console.error("Fetch failed:", e);
528
+ return fallbackData;
529
+ }
530
+ ```