@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,227 @@
1
+ # Learnings Index - Quick Reference
2
+
3
+ This index provides fast access to all documented learnings from past incidents. Use this during incidents to quickly find relevant solutions.
4
+
5
+ **Location**: `learnings/` folder in workspace root
6
+
7
+ ## By Category
8
+
9
+ ### Cache Strategy
10
+
11
+ | Learning | Key Symptoms | Quick Fix |
12
+ |----------|--------------|-----------|
13
+ | [cache-strategy-standardization-loaders.md](../../learnings/cache-strategy-standardization-loaders.md) | High API calls, cache misses, rate limits | Add `export const cache = "stale-while-revalidate"` |
14
+ | [vtex-cookies-prevent-edge-caching.md](../../learnings/vtex-cookies-prevent-edge-caching.md) | `/deco/render` uncached, high origin load | Middleware to strip Set-Cookie on lazy renders |
15
+
16
+ ### Loader Optimization
17
+
18
+ | Learning | Key Symptoms | Quick Fix |
19
+ |----------|--------------|-----------|
20
+ | [loader-overfetching-n-plus-problem.md](../../learnings/loader-overfetching-n-plus-problem.md) | 429 errors, high API volume, slow pages | Reduce pagination, fetch only needed data |
21
+ | [lazy-sections-external-css-loading.md](../../learnings/lazy-sections-external-css-loading.md) | Lazy sections missing styles | Preload CSS or inline critical styles |
22
+
23
+ ### Block Configuration
24
+
25
+ | Learning | Key Symptoms | Quick Fix |
26
+ |----------|--------------|-----------|
27
+ | [dangling-block-references.md](../../learnings/dangling-block-references.md) | "dangling reference" error, missing sections | Remove or update broken block references |
28
+ | [duplicate-sections-masked-by-broken-loaders.md](../../learnings/duplicate-sections-masked-by-broken-loaders.md) | Duplicate content, hidden loader errors | Fix loader errors, remove duplicates |
29
+
30
+ ### Content Issues
31
+
32
+ | Learning | Key Symptoms | Quick Fix |
33
+ |----------|--------------|-----------|
34
+ | [hardcoded-domain-urls-in-rich-text.md](../../learnings/hardcoded-domain-urls-in-rich-text.md) | Broken links in rich text, wrong domains | Use relative URLs or dynamic domain |
35
+
36
+ ### UI / Visual Bugs
37
+
38
+ | Learning | Key Symptoms | Quick Fix |
39
+ |----------|--------------|-----------|
40
+ | [invisible-clickable-areas-from-empty-links.md](../../learnings/invisible-clickable-areas-from-empty-links.md) | Elements not clickable, invisible overlays | Remove empty anchor tags |
41
+ | [responsive-breakpoint-consistency.md](../../learnings/responsive-breakpoint-consistency.md) | Mobile/desktop layout differences | Align breakpoint definitions |
42
+ | [safari-image-flash-fix.md](../../learnings/safari-image-flash-fix.md) | Image flashing in Safari on navigation | Use CSS contain property |
43
+
44
+ ### VTEX Integration
45
+
46
+ | Learning | Key Symptoms | Quick Fix |
47
+ |----------|--------------|-----------|
48
+ | [vtex-domain-routing-myvtex-vs-vtexcommercestable.md](../../learnings/vtex-domain-routing-myvtex-vs-vtexcommercestable.md) | VTEX API errors, wrong store data | Use correct domain (vtexcommercestable) |
49
+
50
+ ### Retry Logic
51
+
52
+ | Learning | Key Symptoms | Quick Fix |
53
+ |----------|--------------|-----------|
54
+ | [retry-strategy-max-attempts-off-by-one.md](../../learnings/retry-strategy-max-attempts-off-by-one.md) | Fewer retries than expected, early failures | Fix off-by-one in retry loop |
55
+
56
+ ### Migration
57
+
58
+ | Learning | Key Symptoms | Quick Fix |
59
+ |----------|--------------|-----------|
60
+ | [migrate-deno1-to-deno2.md](../../learnings/migrate-deno1-to-deno2.md) | Deno 2 compatibility issues | Follow migration checklist |
61
+ | [deco-subpath-imports-version-mismatch.md](../../learnings/deco-subpath-imports-version-mismatch.md) | Import errors after updates | Align subpath import versions |
62
+
63
+ ---
64
+
65
+ ## By Symptom
66
+
67
+ ### Rate Limiting / 429 Errors
68
+
69
+ 1. **loader-overfetching-n-plus-problem.md** - Fetching too much data
70
+ 2. **cache-strategy-standardization-loaders.md** - Missing cache causing repeated calls
71
+
72
+ ### Slow Performance / High Latency
73
+
74
+ 1. **cache-strategy-standardization-loaders.md** - Missing or inconsistent caching
75
+ 2. **vtex-cookies-prevent-edge-caching.md** - Edge cache blocked by cookies
76
+ 3. **lazy-sections-external-css-loading.md** - CSS loading delays
77
+ 4. **loader-overfetching-n-plus-problem.md** - Too many API calls
78
+
79
+ ### Missing Content / Blank Sections
80
+
81
+ 1. **dangling-block-references.md** - Block points to deleted component
82
+ 2. **duplicate-sections-masked-by-broken-loaders.md** - Loader errors hidden
83
+
84
+ ### Visual / Layout Issues
85
+
86
+ 1. **invisible-clickable-areas-from-empty-links.md** - Empty links blocking clicks
87
+ 2. **responsive-breakpoint-consistency.md** - Breakpoint misalignment
88
+ 3. **safari-image-flash-fix.md** - Safari image flashing
89
+ 4. **lazy-sections-external-css-loading.md** - Missing styles on lazy sections
90
+
91
+ ### VTEX Errors
92
+
93
+ 1. **vtex-domain-routing-myvtex-vs-vtexcommercestable.md** - Wrong VTEX domain
94
+ 2. **vtex-cookies-prevent-edge-caching.md** - Cookie issues
95
+
96
+ ### Build / Type Errors
97
+
98
+ 1. **migrate-deno1-to-deno2.md** - Deno 2 migration issues
99
+ 2. **deco-subpath-imports-version-mismatch.md** - Import version conflicts
100
+
101
+ ---
102
+
103
+ ## Quick Search Commands
104
+
105
+ ### Find learning by keyword
106
+
107
+ ```bash
108
+ # Rate limiting issues
109
+ grep -ri "429\|rate limit\|too many" learnings/
110
+
111
+ # Cache issues
112
+ grep -ri "cache\|stale\|swr" learnings/
113
+
114
+ # Performance issues
115
+ grep -ri "slow\|performance\|ttfb\|latency" learnings/
116
+
117
+ # VTEX issues
118
+ grep -ri "vtex\|myvtex\|vtexcommerce" learnings/
119
+
120
+ # Visual/UI issues
121
+ grep -ri "css\|style\|invisible\|layout\|safari" learnings/
122
+
123
+ # Block/config issues
124
+ grep -ri "dangling\|reference\|block\|missing" learnings/
125
+
126
+ # Migration issues
127
+ grep -ri "deno\|migrate\|version\|import" learnings/
128
+ ```
129
+
130
+ ### List all learnings with categories
131
+
132
+ ```bash
133
+ # Show category of each learning
134
+ for f in learnings/*.md; do echo "=== $f ==="; grep -A 1 "## Category" "$f"; done
135
+ ```
136
+
137
+ ### Find learning by error message
138
+
139
+ ```bash
140
+ # Exact error text search
141
+ grep -ri "EXACT_ERROR_TEXT" learnings/
142
+
143
+ # Partial match
144
+ grep -ri "partial error" learnings/
145
+ ```
146
+
147
+ ---
148
+
149
+ ## Learning File Structure
150
+
151
+ Each learning follows this structure:
152
+
153
+ ```
154
+ # Title
155
+
156
+ ## Category
157
+ [category-name]
158
+
159
+ ## Problem
160
+ [Description]
161
+
162
+ ## Symptoms
163
+ - Observable indicators
164
+
165
+ ## Root Cause
166
+ [Explanation with code]
167
+
168
+ ## Solution
169
+ [Fix with code examples]
170
+
171
+ ## How to Debug
172
+ [Commands]
173
+
174
+ ## Files Affected
175
+ [File patterns]
176
+
177
+ ## Pattern Name
178
+ [Short name]
179
+
180
+ ## Checklist Item
181
+ [One-line check]
182
+
183
+ ## Impact
184
+ [Severity]
185
+ ```
186
+
187
+ ---
188
+
189
+ ## Adding New Learnings
190
+
191
+ When documenting a new incident:
192
+
193
+ 1. **Choose a descriptive filename**: `[keyword]-[brief-description].md`
194
+ - Example: `cors-headers-missing-api-routes.md`
195
+
196
+ 2. **Pick the right category**:
197
+ - `cache-strategy` - Caching issues
198
+ - `loader-optimization` - Data fetching issues
199
+ - `block-config` - Deco block configuration
200
+ - `ui-bug` - Visual/layout issues
201
+ - `vtex-integration` - VTEX-specific issues
202
+ - `migration` - Version/migration issues
203
+ - `retry-logic` - Error handling patterns
204
+ - Or create a new category if needed
205
+
206
+ 3. **Include code examples**: Both problem and solution code
207
+
208
+ 4. **Document debug commands**: Make it reproducible
209
+
210
+ 5. **Update this index**: Add entry to appropriate sections
211
+
212
+ ---
213
+
214
+ ## Statistics
215
+
216
+ | Metric | Count |
217
+ |--------|-------|
218
+ | Total Learnings | 14 |
219
+ | Categories | 9 |
220
+ | Cache-related | 2 |
221
+ | Loader-related | 2 |
222
+ | VTEX-related | 2 |
223
+ | UI/Visual | 4 |
224
+ | Migration | 2 |
225
+ | Other | 2 |
226
+
227
+ **Last Updated**: Check git log for learnings/ folder
@@ -0,0 +1,312 @@
1
+ # Triage Workflow - Fast Incident Response
2
+
3
+ This workflow is optimized for **SPEED**. Follow these steps in order. Stop as soon as you identify the issue.
4
+
5
+ ## Step 0: Get Context (30 seconds)
6
+
7
+ **Gather from the engineer:**
8
+
9
+ ```
10
+ INCIDENT BRIEF:
11
+ - Site: [site name]
12
+ - Error/Behavior: [exact message or description]
13
+ - Started: [when - sudden or gradual]
14
+ - Scope: [all users? specific pages? specific browsers?]
15
+ - Recent changes: [deployments, config, third-party]
16
+ ```
17
+
18
+ ## Step 1: Symptom Keyword Search (60 seconds)
19
+
20
+ **Extract keywords from the error/behavior and search learnings:**
21
+
22
+ | Symptom Type | Keywords to Search | Command |
23
+ |--------------|-------------------|---------|
24
+ | Rate limits | 429, rate limit, too many requests | `grep -ri "429\|rate limit" learnings/` |
25
+ | Slow pages | slow, cache, ttfb, performance | `grep -ri "slow\|cache\|ttfb" learnings/` |
26
+ | Missing content | blank, missing, not found, null | `grep -ri "missing\|not found\|blank" learnings/` |
27
+ | Errors | error, exception, failed | `grep -ri "error\|failed\|exception" learnings/` |
28
+ | VTEX | vtex, cart, checkout, product | `grep -ri "vtex" learnings/` |
29
+ | Visual | css, style, invisible, layout | `grep -ri "css\|style\|invisible" learnings/` |
30
+ | Safari | safari, webkit, ios | `grep -ri "safari\|webkit" learnings/` |
31
+ | Images | image, flash, loading, lcp | `grep -ri "image\|flash\|lcp" learnings/` |
32
+ | Lazy | lazy, defer, render | `grep -ri "lazy\|defer\|render" learnings/` |
33
+
34
+ **If match found**: Read the learning file and jump to Step 4.
35
+
36
+ ## Step 2: Category-Based Search (60 seconds)
37
+
38
+ **If keyword search didn't find exact match, search by category:**
39
+
40
+ ```bash
41
+ # List all learnings
42
+ ls learnings/
43
+
44
+ # Read category headers
45
+ head -20 learnings/*.md | grep -A 2 "## Category"
46
+ ```
47
+
48
+ | Category | When to Check |
49
+ |----------|---------------|
50
+ | `cache-strategy` | Slow pages, high API calls, rate limits |
51
+ | `loader-optimization` | Performance, N+1 queries, overfetching |
52
+ | `block-config` | Missing sections, "not found" errors |
53
+ | `rich-text` | Content display issues, broken links |
54
+ | `ui-bug` | Visual problems, click issues |
55
+ | `responsive` | Mobile/desktop differences |
56
+ | `safari-bug` | Safari-only issues |
57
+ | `vtex-routing` | VTEX API errors, wrong responses |
58
+ | `migration` | Post-migration issues |
59
+
60
+ ## Step 3: Quick Diagnostics (2 minutes)
61
+
62
+ **If no learning match, run quick diagnostics:**
63
+
64
+ ### 3a. Error-Based Issues
65
+
66
+ ```bash
67
+ # Check error logs (last 1 hour)
68
+ SEARCH_LOGS({
69
+ query: "level:error site:SITENAME",
70
+ limit: 50,
71
+ startTime: "-1h",
72
+ endTime: "now"
73
+ })
74
+
75
+ # Group by error type
76
+ GET_LOG_DETAILS({
77
+ query: "level:error site:SITENAME",
78
+ groupBy: ["body"]
79
+ })
80
+ ```
81
+
82
+ **Look for**:
83
+ - Error message patterns
84
+ - Stack traces pointing to specific files
85
+ - Frequency of errors
86
+
87
+ ### 3b. Performance Issues
88
+
89
+ ```bash
90
+ # CDN metrics
91
+ MONITOR_SUMMARY({
92
+ sitename: "SITE",
93
+ hostname: "HOST",
94
+ startDate: "TODAY",
95
+ endDate: "TODAY",
96
+ granularity: "hourly"
97
+ })
98
+
99
+ # Top error paths
100
+ MONITOR_TOP_PATHS({
101
+ ...baseParams,
102
+ filters: [{ type: "status_code", operator: "contains", value: "5" }]
103
+ })
104
+
105
+ # Cache effectiveness
106
+ MONITOR_CACHE_STATUS({ ...baseParams })
107
+ ```
108
+
109
+ **Look for**:
110
+ - Cache hit rate < 50% (should be >80%)
111
+ - 5xx error spike
112
+ - 429 rate limiting
113
+ - Specific paths with high errors
114
+
115
+ ### 3c. Code Issues
116
+
117
+ ```bash
118
+ # Type errors (fast check)
119
+ deno check --unstable-tsgo --allow-import main.ts 2>&1 | head -50
120
+
121
+ # Block validation
122
+ deno run -A https://deco.cx/validate 2>&1 | grep -E "❌|⚠️|error"
123
+
124
+ # Recent changes
125
+ git log --oneline -10
126
+ ```
127
+
128
+ **Look for**:
129
+ - New TypeScript errors after deployment
130
+ - Invalid block configurations
131
+ - Recent commits touching affected areas
132
+
133
+ ## Step 4: Apply Known Fix (if learning matched)
134
+
135
+ **Read the full learning file:**
136
+
137
+ ```bash
138
+ cat learnings/[MATCHED_FILE].md
139
+ ```
140
+
141
+ **Verify match:**
142
+ - [ ] Symptoms in learning match current symptoms
143
+ - [ ] Root cause explanation makes sense for this case
144
+ - [ ] Solution is applicable to this site
145
+
146
+ **Apply solution:**
147
+ 1. Follow the code examples in the learning
148
+ 2. Test the fix locally if possible
149
+ 3. Deploy with confidence
150
+
151
+ ## Step 5: Unknown Issue - Deep Dive
152
+
153
+ **If no learning matches, gather comprehensive data:**
154
+
155
+ ### 5a. Full Error Context
156
+
157
+ ```bash
158
+ # Extended error search
159
+ SEARCH_LOGS({
160
+ query: "level:error site:SITENAME path:AFFECTED_PATH",
161
+ limit: 100
162
+ })
163
+
164
+ # Error timeline
165
+ QUERY_CHART_DATA({
166
+ series: [{
167
+ dataSource: "events",
168
+ aggFn: "count",
169
+ where: "level:error site:SITENAME",
170
+ groupBy: ["body"]
171
+ }],
172
+ granularity: "5 minute",
173
+ startTime: "-6h"
174
+ })
175
+ ```
176
+
177
+ ### 5b. Code Investigation
178
+
179
+ ```bash
180
+ # Find the affected file
181
+ grep -r "ERROR_KEYWORD" sections/ loaders/ actions/
182
+
183
+ # Read the file
184
+ cat [AFFECTED_FILE]
185
+
186
+ # Check git blame
187
+ git blame [AFFECTED_FILE] | head -50
188
+
189
+ # Check recent changes to file
190
+ git log -5 --oneline -- [AFFECTED_FILE]
191
+ ```
192
+
193
+ ### 5c. Runtime Investigation
194
+
195
+ ```bash
196
+ # Check server timing
197
+ curl -sI "https://SITE.com/affected-page?__d" | grep server-timing
198
+
199
+ # Check response headers
200
+ curl -sI "https://SITE.com/affected-page" | grep -i "cache\|set-cookie\|x-"
201
+
202
+ # Check for specific loader
203
+ curl -s "https://SITE.com/live/invoke/site/loaders/[LOADER]" | jq '.'
204
+ ```
205
+
206
+ ## Step 6: Document Novel Issue
207
+
208
+ **If this is a new pattern, create a learning:**
209
+
210
+ ```bash
211
+ # Create new learning file
212
+ touch learnings/[descriptive-name].md
213
+ ```
214
+
215
+ **Template:**
216
+
217
+ ```markdown
218
+ # [Title - Descriptive Problem Name]
219
+
220
+ ## Category
221
+ [category-name]
222
+
223
+ ## Problem
224
+ [Clear description of what went wrong]
225
+
226
+ ## Symptoms
227
+ - [Observable indicator 1]
228
+ - [Observable indicator 2]
229
+ - [Error message if applicable]
230
+
231
+ ## Root Cause
232
+ [Explanation with code examples showing the problem]
233
+
234
+ \`\`\`typescript
235
+ // PROBLEM CODE
236
+ \`\`\`
237
+
238
+ ## Solution
239
+ [How to fix with code examples]
240
+
241
+ \`\`\`typescript
242
+ // FIXED CODE
243
+ \`\`\`
244
+
245
+ ## How to Debug
246
+ \`\`\`bash
247
+ # Commands to diagnose this issue
248
+ \`\`\`
249
+
250
+ ## Files Affected
251
+ - [File pattern 1]
252
+ - [File pattern 2]
253
+
254
+ ## Pattern Name
255
+ [Short memorable name]
256
+
257
+ ## Checklist Item
258
+ [One-line check for future audits]
259
+
260
+ ## Impact
261
+ [What happens if unfixed - severity and scope]
262
+ ```
263
+
264
+ ## Decision Tree
265
+
266
+ ```
267
+ START: What is the primary symptom?
268
+
269
+ ├─► Rate Limit / 429
270
+ │ └─► Check: loader-overfetching, cache-strategy learnings
271
+ │ ├─► Match? Apply fix
272
+ │ └─► No match? Check for missing cache exports, N+1 queries
273
+
274
+ ├─► Slow Page / High Latency
275
+ │ └─► Check: cache-strategy, lazy-sections, vtex-cookies learnings
276
+ │ ├─► Match? Apply fix
277
+ │ └─► No match? Run MONITOR_CACHE_STATUS, check for uncached loaders
278
+
279
+ ├─► Missing Content / Blank Areas
280
+ │ └─► Check: dangling-block, duplicate-sections learnings
281
+ │ ├─► Match? Apply fix
282
+ │ └─► No match? Run block validation, check browser console
283
+
284
+ ├─► Visual / UI Bug
285
+ │ └─► Check: invisible-clickable, responsive, safari, lazy-css learnings
286
+ │ ├─► Match? Apply fix
287
+ │ └─► No match? Inspect DOM, check CSS loading order
288
+
289
+ ├─► VTEX Error
290
+ │ └─► Check: vtex-domain, vtex-cookies learnings
291
+ │ ├─► Match? Apply fix
292
+ │ └─► No match? Check VTEX status, verify credentials
293
+
294
+ └─► Unknown Error
295
+ └─► Run full diagnostics (Step 3a-3c)
296
+ └─► Create new learning when resolved
297
+ ```
298
+
299
+ ## Speed Tips
300
+
301
+ 1. **Parallel searches**: Run multiple grep commands at once
302
+ 2. **Use exact error text**: Copy-paste errors for precise matching
303
+ 3. **Check recent deploys first**: Most incidents follow deployments
304
+ 4. **Trust the learnings**: If symptoms match, the fix likely works
305
+ 5. **Don't over-investigate**: If you find a match, apply it and verify
306
+
307
+ ## Common Pitfalls
308
+
309
+ - **Over-diagnosing**: Stop investigating once you find the cause
310
+ - **Ignoring learnings**: Always check learnings before deep diving
311
+ - **Missing scope**: Verify if issue is widespread or isolated
312
+ - **Forgetting to document**: Novel issues must become learnings