@friedbotstudio/create-baseline 0.5.0 → 0.7.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 (55) hide show
  1. package/README.md +14 -10
  2. package/bin/cli.js +46 -15
  3. package/obj/template/.claude/commands/init-project-doctor.md +74 -0
  4. package/obj/template/.claude/hooks/lib/resume_writer.py +14 -1
  5. package/obj/template/.claude/hooks/track_guard.sh +11 -1
  6. package/obj/template/.claude/manifest.json +848 -230
  7. package/obj/template/.claude/schemas/workflow-track.v1.json +64 -0
  8. package/obj/template/.claude/skills/audit-baseline/audit.sh +6 -3
  9. package/obj/template/.claude/skills/chore/SKILL.md +2 -2
  10. package/obj/template/.claude/skills/harness/SKILL.md +15 -6
  11. package/obj/template/.claude/skills/intake/SKILL.md +1 -1
  12. package/obj/template/.claude/skills/swarm-plan/SKILL.md +2 -0
  13. package/obj/template/.claude/skills/tdd/SKILL.md +2 -2
  14. package/obj/template/.claude/skills/triage/SKILL.md +29 -6
  15. package/obj/template/.claude/skills/triage/seed-tasklist.mjs +107 -0
  16. package/obj/template/.claude/skills/upgrade-project/SKILL.md +121 -0
  17. package/obj/template/.claude/workflows.jsonl +6 -0
  18. package/obj/template/CLAUDE.md +14 -19
  19. package/obj/template/docs/init/seed.md +152 -7
  20. package/package.json +1 -1
  21. package/src/.claude/workflows.template.jsonl +6 -0
  22. package/src/CLAUDE.template.md +14 -19
  23. package/src/cli/diff-render.js +54 -0
  24. package/src/cli/install.js +38 -3
  25. package/src/cli/manifest.js +7 -3
  26. package/src/cli/merge.js +107 -13
  27. package/src/cli/track-tasklist-materializer.js +223 -0
  28. package/src/cli/tui/upgrade.js +130 -27
  29. package/src/cli/upgrade-tiers.js +256 -0
  30. package/src/cli/workflow-migrator.js +40 -0
  31. package/src/cli/workflows-validator-invariants.js +417 -0
  32. package/src/cli/workflows-validator-predicates.js +19 -0
  33. package/src/cli/workflows-validator.js +156 -0
  34. package/src/seed.template.md +152 -7
  35. package/obj/template/.claude/skills/google-analytics/SKILL.md +0 -129
  36. package/obj/template/.claude/skills/google-analytics/references/audiences.md +0 -389
  37. package/obj/template/.claude/skills/google-analytics/references/bigquery.md +0 -470
  38. package/obj/template/.claude/skills/google-analytics/references/custom-dimensions.md +0 -355
  39. package/obj/template/.claude/skills/google-analytics/references/custom-events.md +0 -383
  40. package/obj/template/.claude/skills/google-analytics/references/data-management.md +0 -416
  41. package/obj/template/.claude/skills/google-analytics/references/debugview.md +0 -364
  42. package/obj/template/.claude/skills/google-analytics/references/events-fundamentals.md +0 -398
  43. package/obj/template/.claude/skills/google-analytics/references/gtag.md +0 -502
  44. package/obj/template/.claude/skills/google-analytics/references/gtm-integration.md +0 -483
  45. package/obj/template/.claude/skills/google-analytics/references/measurement-protocol.md +0 -519
  46. package/obj/template/.claude/skills/google-analytics/references/privacy.md +0 -441
  47. package/obj/template/.claude/skills/google-analytics/references/recommended-events.md +0 -464
  48. package/obj/template/.claude/skills/google-analytics/references/reporting.md +0 -397
  49. package/obj/template/.claude/skills/google-analytics/references/setup.md +0 -344
  50. package/obj/template/.claude/skills/google-analytics/references/user-tracking.md +0 -417
  51. package/obj/template/.claude/skills/optimize-seo/SKILL.md +0 -313
  52. package/obj/template/.claude/skills/optimize-seo/scripts/pagespeed.mjs +0 -197
  53. package/obj/template/.claude/skills/pagespeed-insights/LICENSE.md +0 -37
  54. package/obj/template/.claude/skills/pagespeed-insights/SKILL.md +0 -446
  55. package/obj/template/.claude/skills/pagespeed-insights/reference.md +0 -50
@@ -1,464 +0,0 @@
1
- # GA4 Recommended Events
2
-
3
- Complete guide to implementing Google-defined recommended events including ecommerce, engagement, and monetisation events.
4
-
5
- ## Overview
6
-
7
- GA4 provides recommended event names and parameter structures defined by Google for consistency across analytics implementations. These standardised events enable key features like ecommerce reports, conversion modelling, and Google Ads integration.
8
-
9
- ## Why Use Recommended Events
10
-
11
- 1. **Standard reporting** - Pre-built reports for recommended events
12
- 2. **Google Ads integration** - Automatic conversion import
13
- 3. **Machine learning** - Better predictive audiences
14
- 4. **Consistency** - Cross-property comparison
15
- 5. **Future compatibility** - New features use standard events
16
-
17
- ## Recommended Events Categories
18
-
19
- ### Engagement Events
20
-
21
- | Event | Description | Key Parameters |
22
- |-------|-------------|----------------|
23
- | login | User authentication | method |
24
- | sign_up | Account creation | method |
25
- | search | Site search | search_term |
26
- | share | Content sharing | method, content_type, item_id |
27
- | select_content | Content selection | content_type, item_id |
28
-
29
- ### Monetisation Events (Ecommerce)
30
-
31
- | Event | Description | Key Parameters |
32
- |-------|-------------|----------------|
33
- | view_item | Product page view | items, value, currency |
34
- | view_item_list | Product list view | items, item_list_id, item_list_name |
35
- | select_item | Product selected | items |
36
- | add_to_cart | Cart addition | items, value, currency |
37
- | remove_from_cart | Cart removal | items |
38
- | view_cart | Cart viewed | items, value, currency |
39
- | begin_checkout | Checkout started | items, value, currency |
40
- | add_shipping_info | Shipping selected | shipping_tier, items |
41
- | add_payment_info | Payment entered | payment_type, items |
42
- | purchase | Transaction complete | transaction_id, value, currency, items |
43
- | refund | Purchase refunded | transaction_id, value, items |
44
-
45
- ### Promotion Events
46
-
47
- | Event | Description | Key Parameters |
48
- |-------|-------------|----------------|
49
- | view_promotion | Promotion displayed | promotion_id, promotion_name, items |
50
- | select_promotion | Promotion clicked | promotion_id, promotion_name, items |
51
-
52
- ### Other Recommended Events
53
-
54
- | Event | Description | Key Parameters |
55
- |-------|-------------|----------------|
56
- | add_to_wishlist | Wishlist addition | items, value, currency |
57
- | generate_lead | Lead generation | value, currency |
58
-
59
- ## The Items Array
60
-
61
- The items array is critical for ecommerce tracking. Each item object can contain:
62
-
63
- ### Required (At Least One)
64
-
65
- | Parameter | Type | Description |
66
- |-----------|------|-------------|
67
- | item_id | string | Product SKU |
68
- | item_name | string | Product name |
69
-
70
- ### Highly Recommended
71
-
72
- | Parameter | Type | Description |
73
- |-----------|------|-------------|
74
- | price | number | Unit price |
75
- | quantity | integer | Number of units |
76
- | item_category | string | Primary category |
77
-
78
- ### Optional
79
-
80
- | Parameter | Type | Description |
81
- |-----------|------|-------------|
82
- | item_brand | string | Brand name |
83
- | item_variant | string | Size, colour, etc. |
84
- | coupon | string | Item-level coupon |
85
- | discount | number | Discount amount |
86
- | item_category2-5 | string | Hierarchy categories |
87
- | item_list_id | string | List identifier |
88
- | item_list_name | string | List name |
89
- | affiliation | string | Store affiliation |
90
- | location_id | string | Store location |
91
- | index | integer | Position in list |
92
-
93
- ### Items Array Example
94
-
95
- ```javascript
96
- 'items': [
97
- {
98
- 'item_id': 'SKU_001',
99
- 'item_name': 'Blue T-Shirt',
100
- 'item_brand': 'Acme',
101
- 'item_category': 'Apparel',
102
- 'item_category2': 'T-Shirts',
103
- 'item_variant': 'Large',
104
- 'price': 29.99,
105
- 'quantity': 2,
106
- 'coupon': 'SUMMER20',
107
- 'discount': 5.00
108
- },
109
- {
110
- 'item_id': 'SKU_002',
111
- 'item_name': 'Black Jeans',
112
- 'item_brand': 'Acme',
113
- 'item_category': 'Apparel',
114
- 'item_category2': 'Jeans',
115
- 'item_variant': '32',
116
- 'price': 59.99,
117
- 'quantity': 1
118
- }
119
- ]
120
- ```
121
-
122
- ## Complete Ecommerce Implementation
123
-
124
- ### Purchase Event (Most Important)
125
-
126
- ```javascript
127
- gtag('event', 'purchase', {
128
- 'transaction_id': 'TXN_12345', // Required: unique per purchase
129
- 'value': 119.97, // Recommended: total value
130
- 'currency': 'USD', // Recommended: currency code
131
- 'tax': 8.40, // Optional: tax amount
132
- 'shipping': 9.99, // Optional: shipping cost
133
- 'coupon': 'SUMMER20', // Optional: order-level coupon
134
- 'affiliation': 'Online Store', // Optional: store name
135
- 'items': [
136
- {
137
- 'item_id': 'SKU_001',
138
- 'item_name': 'Blue T-Shirt',
139
- 'item_category': 'Apparel',
140
- 'price': 29.99,
141
- 'quantity': 2
142
- },
143
- {
144
- 'item_id': 'SKU_002',
145
- 'item_name': 'Black Jeans',
146
- 'item_category': 'Apparel',
147
- 'price': 59.99,
148
- 'quantity': 1
149
- }
150
- ]
151
- });
152
- ```
153
-
154
- ### Full Ecommerce Journey
155
-
156
- **1. view_item_list (Product Listing Page)**
157
-
158
- ```javascript
159
- gtag('event', 'view_item_list', {
160
- 'item_list_id': 'category_apparel',
161
- 'item_list_name': 'Apparel Collection',
162
- 'items': [
163
- {
164
- 'item_id': 'SKU_001',
165
- 'item_name': 'Blue T-Shirt',
166
- 'price': 29.99,
167
- 'index': 1
168
- },
169
- {
170
- 'item_id': 'SKU_002',
171
- 'item_name': 'Black Jeans',
172
- 'price': 59.99,
173
- 'index': 2
174
- }
175
- ]
176
- });
177
- ```
178
-
179
- **2. select_item (Product Click)**
180
-
181
- ```javascript
182
- gtag('event', 'select_item', {
183
- 'item_list_id': 'category_apparel',
184
- 'item_list_name': 'Apparel Collection',
185
- 'items': [
186
- {
187
- 'item_id': 'SKU_001',
188
- 'item_name': 'Blue T-Shirt',
189
- 'price': 29.99
190
- }
191
- ]
192
- });
193
- ```
194
-
195
- **3. view_item (Product Detail Page)**
196
-
197
- ```javascript
198
- gtag('event', 'view_item', {
199
- 'currency': 'USD',
200
- 'value': 29.99,
201
- 'items': [
202
- {
203
- 'item_id': 'SKU_001',
204
- 'item_name': 'Blue T-Shirt',
205
- 'item_brand': 'Acme',
206
- 'item_category': 'Apparel',
207
- 'item_variant': 'Large',
208
- 'price': 29.99
209
- }
210
- ]
211
- });
212
- ```
213
-
214
- **4. add_to_cart**
215
-
216
- ```javascript
217
- gtag('event', 'add_to_cart', {
218
- 'currency': 'USD',
219
- 'value': 59.98,
220
- 'items': [
221
- {
222
- 'item_id': 'SKU_001',
223
- 'item_name': 'Blue T-Shirt',
224
- 'price': 29.99,
225
- 'quantity': 2
226
- }
227
- ]
228
- });
229
- ```
230
-
231
- **5. view_cart**
232
-
233
- ```javascript
234
- gtag('event', 'view_cart', {
235
- 'currency': 'USD',
236
- 'value': 119.97,
237
- 'items': [
238
- {
239
- 'item_id': 'SKU_001',
240
- 'item_name': 'Blue T-Shirt',
241
- 'price': 29.99,
242
- 'quantity': 2
243
- },
244
- {
245
- 'item_id': 'SKU_002',
246
- 'item_name': 'Black Jeans',
247
- 'price': 59.99,
248
- 'quantity': 1
249
- }
250
- ]
251
- });
252
- ```
253
-
254
- **6. begin_checkout**
255
-
256
- ```javascript
257
- gtag('event', 'begin_checkout', {
258
- 'currency': 'USD',
259
- 'value': 119.97,
260
- 'coupon': 'SUMMER20',
261
- 'items': [
262
- {
263
- 'item_id': 'SKU_001',
264
- 'item_name': 'Blue T-Shirt',
265
- 'price': 29.99,
266
- 'quantity': 2
267
- },
268
- {
269
- 'item_id': 'SKU_002',
270
- 'item_name': 'Black Jeans',
271
- 'price': 59.99,
272
- 'quantity': 1
273
- }
274
- ]
275
- });
276
- ```
277
-
278
- **7. add_shipping_info**
279
-
280
- ```javascript
281
- gtag('event', 'add_shipping_info', {
282
- 'currency': 'USD',
283
- 'value': 119.97,
284
- 'shipping_tier': 'Express',
285
- 'items': [/* same items array */]
286
- });
287
- ```
288
-
289
- **8. add_payment_info**
290
-
291
- ```javascript
292
- gtag('event', 'add_payment_info', {
293
- 'currency': 'USD',
294
- 'value': 119.97,
295
- 'payment_type': 'Credit Card',
296
- 'items': [/* same items array */]
297
- });
298
- ```
299
-
300
- **9. purchase** (see complete example above)
301
-
302
- ## Engagement Events Implementation
303
-
304
- ### login Event
305
-
306
- ```javascript
307
- gtag('event', 'login', {
308
- 'method': 'Google' // or 'Email', 'Facebook', etc.
309
- });
310
- ```
311
-
312
- ### sign_up Event
313
-
314
- ```javascript
315
- gtag('event', 'sign_up', {
316
- 'method': 'Email'
317
- });
318
- ```
319
-
320
- ### search Event
321
-
322
- ```javascript
323
- gtag('event', 'search', {
324
- 'search_term': 'blue t-shirt'
325
- });
326
- ```
327
-
328
- ### share Event
329
-
330
- ```javascript
331
- gtag('event', 'share', {
332
- 'method': 'Twitter',
333
- 'content_type': 'article',
334
- 'item_id': 'ARTICLE_123'
335
- });
336
- ```
337
-
338
- ### generate_lead Event
339
-
340
- ```javascript
341
- gtag('event', 'generate_lead', {
342
- 'currency': 'USD',
343
- 'value': 50.00 // Estimated lead value
344
- });
345
- ```
346
-
347
- ## GTM Implementation
348
-
349
- ### Data Layer Push
350
-
351
- ```javascript
352
- dataLayer.push({
353
- 'event': 'purchase',
354
- 'ecommerce': {
355
- 'transaction_id': 'TXN_12345',
356
- 'value': 119.97,
357
- 'currency': 'USD',
358
- 'tax': 8.40,
359
- 'shipping': 9.99,
360
- 'items': [
361
- {
362
- 'item_id': 'SKU_001',
363
- 'item_name': 'Blue T-Shirt',
364
- 'price': 29.99,
365
- 'quantity': 2
366
- }
367
- ]
368
- }
369
- });
370
- ```
371
-
372
- ### GTM Configuration
373
-
374
- 1. Create Data Layer Variables for ecommerce parameters
375
- 2. Create Custom Event trigger for 'purchase'
376
- 3. Create GA4 Event tag:
377
- - Event Name: purchase
378
- - Map ecommerce parameters to event parameters
379
- 4. Test in Preview mode
380
- 5. Publish
381
-
382
- ## Critical Implementation Rules
383
-
384
- ### Transaction ID
385
-
386
- - **Must be unique** for each purchase
387
- - Same transaction_id = duplicate (deduped by GA4)
388
- - Use order number or generate unique ID
389
-
390
- ### Currency
391
-
392
- - **Always include** with monetary events
393
- - Use ISO 4217 codes (USD, EUR, GBP, AUD)
394
- - Same currency for value and item prices
395
-
396
- ### Items Array
397
-
398
- - Include at least item_id OR item_name (required)
399
- - Keep items array consistent across events
400
- - Maximum 27 items per event
401
-
402
- ### Value Calculation
403
-
404
- - Should match sum of (price * quantity) for all items
405
- - Include discounts in calculation
406
- - Exclude tax and shipping from item values
407
-
408
- ## Testing Recommended Events
409
-
410
- ### DebugView Validation
411
-
412
- 1. Enable debug mode
413
- 2. Complete user journey
414
- 3. For each event, verify:
415
- - Event name matches exactly
416
- - All required parameters present
417
- - Parameter values correct
418
- - Items array structure valid
419
-
420
- ### Ecommerce Validation Checklist
421
-
422
- - [ ] view_item fires on product pages
423
- - [ ] add_to_cart fires when adding items
424
- - [ ] begin_checkout fires at checkout start
425
- - [ ] purchase fires once per transaction
426
- - [ ] transaction_id is unique
427
- - [ ] Value matches cart total
428
- - [ ] Currency included on all monetary events
429
- - [ ] Items array populated correctly
430
-
431
- ## Common Issues
432
-
433
- ### Duplicate Purchases
434
-
435
- **Cause:** Same transaction_id sent multiple times
436
- **Solution:** Ensure unique ID, implement prevention logic
437
-
438
- ### Missing Revenue
439
-
440
- **Cause:** Currency parameter missing
441
- **Solution:** Always include currency with value
442
-
443
- ### Empty Items Array
444
-
445
- **Cause:** Data not available when event fires
446
- **Solution:** Validate items array before sending
447
-
448
- ### Wrong Event Names
449
-
450
- **Cause:** Using custom names instead of recommended
451
- **Solution:** Use exact recommended event names (case-sensitive)
452
-
453
- ## Key Events (Conversions)
454
-
455
- Mark recommended events as key events for conversion tracking:
456
-
457
- 1. Admin -> Events
458
- 2. Find event (e.g., purchase)
459
- 3. Toggle "Mark as key event"
460
-
461
- Events marked as key events:
462
- - Appear in conversion reports
463
- - Can be imported to Google Ads
464
- - Used for optimisation