@friedbotstudio/create-baseline 0.6.0 → 0.8.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 +19 -13
  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/memory_session_start.sh +24 -0
  6. package/obj/template/.claude/hooks/track_guard.sh +11 -1
  7. package/obj/template/.claude/manifest.json +31 -99
  8. package/obj/template/.claude/schemas/workflow-track.v1.json +64 -0
  9. package/obj/template/.claude/skills/audit-baseline/audit.sh +2 -2
  10. package/obj/template/.claude/skills/chore/SKILL.md +2 -2
  11. package/obj/template/.claude/skills/harness/SKILL.md +15 -6
  12. package/obj/template/.claude/skills/intake/SKILL.md +1 -1
  13. package/obj/template/.claude/skills/swarm-plan/SKILL.md +2 -0
  14. package/obj/template/.claude/skills/tdd/SKILL.md +2 -2
  15. package/obj/template/.claude/skills/triage/SKILL.md +29 -6
  16. package/obj/template/.claude/skills/triage/seed-tasklist.mjs +107 -0
  17. package/obj/template/.claude/skills/upgrade-project/SKILL.md +18 -7
  18. package/obj/template/.claude/workflows.jsonl +6 -0
  19. package/obj/template/CLAUDE.md +8 -14
  20. package/obj/template/docs/init/seed.md +148 -3
  21. package/package.json +1 -1
  22. package/src/.claude/workflows.template.jsonl +6 -0
  23. package/src/CLAUDE.template.md +8 -14
  24. package/src/cli/install.js +5 -1
  25. package/src/cli/merge.js +42 -5
  26. package/src/cli/track-tasklist-materializer.js +223 -0
  27. package/src/cli/tui/upgrade.js +30 -41
  28. package/src/cli/upgrade-tiers.js +42 -4
  29. package/src/cli/workflow-migrator.js +40 -0
  30. package/src/cli/workflows-validator-invariants.js +417 -0
  31. package/src/cli/workflows-validator-predicates.js +19 -0
  32. package/src/cli/workflows-validator.js +156 -0
  33. package/src/seed.template.md +148 -3
  34. package/obj/template/.claude/skills/google-analytics/SKILL.md +0 -129
  35. package/obj/template/.claude/skills/google-analytics/references/audiences.md +0 -389
  36. package/obj/template/.claude/skills/google-analytics/references/bigquery.md +0 -470
  37. package/obj/template/.claude/skills/google-analytics/references/custom-dimensions.md +0 -355
  38. package/obj/template/.claude/skills/google-analytics/references/custom-events.md +0 -383
  39. package/obj/template/.claude/skills/google-analytics/references/data-management.md +0 -416
  40. package/obj/template/.claude/skills/google-analytics/references/debugview.md +0 -364
  41. package/obj/template/.claude/skills/google-analytics/references/events-fundamentals.md +0 -398
  42. package/obj/template/.claude/skills/google-analytics/references/gtag.md +0 -502
  43. package/obj/template/.claude/skills/google-analytics/references/gtm-integration.md +0 -483
  44. package/obj/template/.claude/skills/google-analytics/references/measurement-protocol.md +0 -519
  45. package/obj/template/.claude/skills/google-analytics/references/privacy.md +0 -441
  46. package/obj/template/.claude/skills/google-analytics/references/recommended-events.md +0 -464
  47. package/obj/template/.claude/skills/google-analytics/references/reporting.md +0 -397
  48. package/obj/template/.claude/skills/google-analytics/references/setup.md +0 -344
  49. package/obj/template/.claude/skills/google-analytics/references/user-tracking.md +0 -417
  50. package/obj/template/.claude/skills/optimize-seo/SKILL.md +0 -313
  51. package/obj/template/.claude/skills/optimize-seo/scripts/pagespeed.mjs +0 -197
  52. package/obj/template/.claude/skills/pagespeed-insights/LICENSE.md +0 -37
  53. package/obj/template/.claude/skills/pagespeed-insights/SKILL.md +0 -446
  54. package/obj/template/.claude/skills/pagespeed-insights/reference.md +0 -50
  55. package/src/cli/diff-render.js +0 -54
@@ -1,355 +0,0 @@
1
- # GA4 Custom Dimensions and Metrics
2
-
3
- Expert guidance for registering event parameters as custom dimensions and creating custom metrics.
4
-
5
- ## Overview
6
-
7
- Custom dimensions and metrics transform event parameters into reportable fields in GA4. All custom parameters remain invisible in reports until registered. Registration requires understanding scope types, following naming conventions, and accounting for processing delays.
8
-
9
- ## Understanding Scopes
10
-
11
- GA4 uses three scopes that determine what data the parameter applies to:
12
-
13
- ### Event Scope
14
-
15
- **Applies to:** Single event occurrence
16
- **Lifespan:** That specific event only
17
- **Use for:** Event-specific information
18
-
19
- ```javascript
20
- gtag('event', 'button_click', {
21
- 'button_name': 'Subscribe', // Event-scoped
22
- 'button_location': 'header', // Event-scoped
23
- 'button_id': 'btn_subscribe_01' // Event-scoped
24
- });
25
- ```
26
-
27
- **Examples:** form_name, video_title, button_name, page_section
28
-
29
- ### User Scope
30
-
31
- **Applies to:** All events from that user
32
- **Lifespan:** Session persistence (until cleared)
33
- **Use for:** User attributes that persist
34
-
35
- ```javascript
36
- gtag('set', 'user_properties', {
37
- 'subscription_tier': 'premium', // User-scoped
38
- 'customer_lifetime_value': 5000, // User-scoped
39
- 'preferred_language': 'en' // User-scoped
40
- });
41
- ```
42
-
43
- **Examples:** subscription_tier, customer_segment, company_size, signup_date
44
-
45
- ### Item Scope
46
-
47
- **Applies to:** Individual items in ecommerce events
48
- **Lifespan:** That transaction only
49
- **Use for:** Product-specific information
50
-
51
- ```javascript
52
- gtag('event', 'purchase', {
53
- 'items': [
54
- {
55
- 'item_id': 'SKU_123',
56
- 'item_name': 'Blue T-Shirt',
57
- 'item_color': 'blue', // Item-scoped
58
- 'item_size': 'large', // Item-scoped
59
- 'supplier': 'Vendor A' // Item-scoped
60
- }
61
- ]
62
- });
63
- ```
64
-
65
- **Examples:** item_color, item_size, supplier, product_quality
66
-
67
- ## Scope Selection Matrix
68
-
69
- | Question | Event Scope | User Scope | Item Scope |
70
- |----------|-------------|------------|------------|
71
- | Applies to one event? | Yes | No | No |
72
- | Applies to all user events? | No | Yes | No |
73
- | Applies to products? | No | No | Yes |
74
- | Changes per interaction? | Yes | Rarely | Per item |
75
-
76
- ## Dimension Limits
77
-
78
- ### Standard GA4
79
-
80
- | Dimension Type | Limit |
81
- |----------------|-------|
82
- | Event-scoped | 50 |
83
- | User-scoped | 25 |
84
- | Item-scoped | 10 |
85
- | Custom metrics | 50 |
86
- | Calculated metrics | 5 |
87
-
88
- ### GA4 360
89
-
90
- | Dimension Type | Limit |
91
- |----------------|-------|
92
- | Event-scoped | 125 |
93
- | User-scoped | 100 |
94
- | Item-scoped | 25 |
95
- | Custom metrics | 125 |
96
- | Calculated metrics | 50 |
97
-
98
- ## Registration Workflow
99
-
100
- ### Step 1: Send Parameter in Event
101
-
102
- First, ensure the parameter is being sent in events:
103
-
104
- **Event-scoped parameter:**
105
- ```javascript
106
- gtag('event', 'video_watched', {
107
- 'video_title': 'Getting Started Guide',
108
- 'video_duration': 180,
109
- 'video_quality': 'hd'
110
- });
111
- ```
112
-
113
- **User-scoped parameter (user property):**
114
- ```javascript
115
- gtag('set', 'user_properties', {
116
- 'customer_segment': 'enterprise',
117
- 'subscription_tier': 'premium'
118
- });
119
- ```
120
-
121
- **Item-scoped parameter:**
122
- ```javascript
123
- gtag('event', 'purchase', {
124
- 'items': [{
125
- 'item_id': 'SKU_123',
126
- 'supplier': 'Vendor A' // Custom item parameter
127
- }]
128
- });
129
- ```
130
-
131
- ### Step 2: Verify in DebugView
132
-
133
- Before registration, confirm the parameter appears:
134
-
135
- 1. Admin -> DebugView
136
- 2. Enable Google Analytics Debugger extension
137
- 3. Trigger the event
138
- 4. Click event in DebugView
139
- 5. See parameter in event details
140
- 6. Note exact parameter name (case-sensitive)
141
-
142
- ### Step 3: Register as Custom Dimension
143
-
144
- Navigate to Admin -> Data Display -> Custom Definitions:
145
-
146
- 1. Click "Create custom dimension"
147
- 2. Fill form:
148
- - **Dimension name:** Human-friendly name (e.g., "Video Quality")
149
- - **Scope:** Select Event, User, or Item
150
- - **Description:** Optional notes
151
- - **Event parameter / User property:** Exact name from code (case-sensitive)
152
- 3. Click Save
153
-
154
- ### Step 4: Wait for Data Population
155
-
156
- **Critical:** Custom dimensions don't appear immediately.
157
-
158
- - **Wait time:** 24-48 hours
159
- - **Historical data:** Retroactively processed
160
- - **New data:** Starts populating
161
- - **Do not** create duplicate dimensions while waiting
162
-
163
- ### Step 5: Use in Reports
164
-
165
- After 24-48 hours:
166
-
167
- - **Standard Reports:** Add as secondary dimension
168
- - **Explorations:** Select from dimension picker
169
- - **Filters/Segments:** Filter by dimension values
170
- - **Google Ads:** Export for audience building
171
-
172
- ## Creating Custom Metrics
173
-
174
- ### Standard Custom Metrics
175
-
176
- For numerical tracking beyond standard metrics:
177
-
178
- ```javascript
179
- gtag('event', 'video_watched', {
180
- 'video_title': 'GA4 Tutorial',
181
- 'minutes_watched': 45, // Custom metric
182
- 'completion_rate': 85 // Custom metric
183
- });
184
- ```
185
-
186
- **Registration:**
187
-
188
- 1. Admin -> Data Display -> Custom Definitions
189
- 2. Click "Create custom metric"
190
- 3. Fill form:
191
- - **Metric name:** Display name (e.g., "Minutes Watched")
192
- - **Scope:** Event (only option)
193
- - **Event parameter:** Parameter name (minutes_watched)
194
- - **Unit of measurement:** Standard, Currency, Distance, Time (optional)
195
- 4. Save and wait 24-48 hours
196
-
197
- ### Calculated Metrics
198
-
199
- Create metrics derived from existing metrics:
200
-
201
- **Examples:**
202
- - Revenue per User = revenue / users
203
- - Conversion Rate = conversions / sessions * 100
204
- - Average Order Value = revenue / purchases
205
-
206
- **Creation:**
207
-
208
- 1. Admin -> Data Display -> Custom Definitions
209
- 2. Click "Create custom metric"
210
- 3. Metric Name: "Revenue per User"
211
- 4. Type: Calculated
212
- 5. Formula: `revenue / users`
213
- 6. Save (no processing delay for calculated metrics)
214
-
215
- ## Common Registration Examples
216
-
217
- ### Event-Scoped Dimensions
218
-
219
- | Dimension Name | Parameter Name | Use Case |
220
- |----------------|----------------|----------|
221
- | Video Title | video_title | Track video performance |
222
- | Form Name | form_name | Analyse form submissions |
223
- | Button Location | button_location | Track CTA placement |
224
- | Content Type | content_type | Categorise content |
225
- | Error Message | error_message | Debug issues |
226
-
227
- ### User-Scoped Dimensions
228
-
229
- | Dimension Name | User Property | Use Case |
230
- |----------------|---------------|----------|
231
- | Subscription Tier | subscription_tier | Segment by plan |
232
- | Customer Segment | customer_segment | Analyse cohorts |
233
- | Company Size | company_size | B2B analysis |
234
- | Account Age | account_age_days | Retention analysis |
235
- | Preferred Language | preferred_language | Localisation |
236
-
237
- ### Item-Scoped Dimensions
238
-
239
- | Dimension Name | Item Parameter | Use Case |
240
- |----------------|----------------|----------|
241
- | Item Colour | item_color | Product analysis |
242
- | Item Size | item_size | Inventory insights |
243
- | Supplier | supplier | Vendor performance |
244
- | Material | material | Product attributes |
245
- | Stock Status | stock_status | Availability analysis |
246
-
247
- ## Troubleshooting
248
-
249
- ### Dimension Not Appearing After 48 Hours
250
-
251
- **Possible causes:**
252
- - Parameter name mismatch (case-sensitive)
253
- - Events not sending parameter
254
- - Wrong scope selected
255
- - Low data volume (threshold not met)
256
-
257
- **Solutions:**
258
- 1. Verify exact parameter name in DebugView
259
- 2. Confirm events are sending parameter
260
- 3. Check scope matches how parameter is sent
261
- 4. Wait for more data volume
262
-
263
- ### Parameter in DebugView But Not Reports
264
-
265
- **Expected behaviour for first 24-48 hours**
266
-
267
- **If persists:**
268
- 1. Check Realtime reports (available sooner)
269
- 2. Verify at least 1000 events with parameter
270
- 3. Check data retention settings
271
- 4. Confirm dimension registered correctly
272
-
273
- ### Dimension Quota Exceeded
274
-
275
- **Cause:** Hit maximum dimension limit
276
-
277
- **Solutions:**
278
- 1. Delete unused dimensions
279
- 2. Combine similar dimensions
280
- 3. Plan essential dimensions
281
- 4. Consider GA4 360 for higher limits
282
-
283
- ### Multiple Users Same Dimension Value
284
-
285
- **For user-scoped:** Expected - applies to all user events
286
- **For event-scoped:** Expected if same value sent
287
- **For item-scoped:** Expected across products
288
-
289
- ## Best Practices
290
-
291
- ### Planning Strategy
292
-
293
- 1. **Audit existing parameters** - What are you already sending?
294
- 2. **Prioritise dimensions** - Which are essential for reporting?
295
- 3. **Reserve capacity** - Don't use all 50 immediately
296
- 4. **Document dimensions** - Maintain registry of all dimensions
297
-
298
- ### Naming Conventions
299
-
300
- **Parameter names:**
301
- - snake_case
302
- - Under 40 characters
303
- - Descriptive and consistent
304
-
305
- **Dimension display names:**
306
- - Title Case
307
- - Clear and descriptive
308
- - Match parameter purpose
309
-
310
- ### Documentation Template
311
-
312
- ```markdown
313
- ## Custom Dimension: Video Title
314
-
315
- **Parameter Name:** video_title
316
- **Scope:** Event
317
- **Description:** Title of video watched by user
318
- **Events Using:** video_start, video_complete, video_progress
319
- **Registration Date:** 2024-01-15
320
- **Status:** Active
321
-
322
- **Example Value:** "Getting Started with GA4"
323
-
324
- **Reports Using:**
325
- - Video Performance Exploration
326
- - Content Engagement Dashboard
327
- ```
328
-
329
- ## Quick Reference
330
-
331
- ### Registration Checklist
332
-
333
- - [ ] Parameter sent in events
334
- - [ ] Verified in DebugView
335
- - [ ] Correct scope selected
336
- - [ ] Exact parameter name used
337
- - [ ] Waited 24-48 hours
338
- - [ ] Tested in Explorations
339
-
340
- ### Scope Quick Guide
341
-
342
- | I want to track... | Use Scope |
343
- |-------------------|-----------|
344
- | Per-event data | Event |
345
- | User attributes | User |
346
- | Product attributes | Item |
347
-
348
- ### Limits Summary
349
-
350
- | Type | Standard | 360 |
351
- |------|----------|-----|
352
- | Event dimensions | 50 | 125 |
353
- | User dimensions | 25 | 100 |
354
- | Item dimensions | 10 | 25 |
355
- | Custom metrics | 50 | 125 |