@explorer02/cfm-survey-sdk 0.2.3 → 0.2.5

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 (100) hide show
  1. package/dist/cli/index.js +141 -33
  2. package/dist/cli/index.mjs +141 -33
  3. package/dist/index.js +1 -1
  4. package/dist/index.mjs +1 -1
  5. package/package.json +3 -1
  6. package/postinstall.js +9 -5
  7. package/templates/AGENT.md +60 -19
  8. package/templates/deploy-wizard-to-s3.sh +52 -0
  9. package/templates/docs/00-integration/agent-execution-flow.md +293 -0
  10. package/templates/docs/00-integration/agent-operating-contract.md +268 -0
  11. package/templates/docs/00-integration/apply-ui-config.md +390 -0
  12. package/templates/docs/00-integration/aws-deploy.md +117 -3
  13. package/templates/docs/00-integration/canonical-survey-fixtures.md +94 -0
  14. package/templates/docs/00-integration/client-integration-guide.md +9 -7
  15. package/templates/docs/00-integration/client-lib-folder.md +115 -0
  16. package/templates/docs/00-integration/component-checklist.md +90 -62
  17. package/templates/docs/00-integration/constraints.md +14 -5
  18. package/templates/docs/00-integration/custom-field-logic-and-navigation.md +56 -0
  19. package/templates/docs/00-integration/mockup-ui-extraction.md +113 -0
  20. package/templates/docs/00-integration/placeholders-and-custom-fields-wiring.md +192 -0
  21. package/templates/docs/00-integration/placeholders-and-tokens.md +2 -1
  22. package/templates/docs/00-integration/progress.md +4 -2
  23. package/templates/docs/00-integration/setup.md +12 -0
  24. package/templates/docs/00-integration/ui-customization-wizard.md +123 -0
  25. package/templates/docs/00-integration/useSurveySDK.md +35 -1
  26. package/templates/docs/00-integration/wizard-api.md +126 -0
  27. package/templates/docs/00-integration/wizard-config-handoff.md +292 -0
  28. package/templates/docs/00-integration/wizard-preview-build-guide.md +405 -0
  29. package/templates/docs/00-integration/wizard-question-type-styling.md +197 -0
  30. package/templates/docs/00-integration/wizard-troubleshooting.md +80 -0
  31. package/templates/docs/01-components/01-survey-page.md +18 -8
  32. package/templates/docs/01-components/02-question.md +2 -2
  33. package/templates/docs/01-components/03-rating-scale.md +12 -18
  34. package/templates/docs/01-components/05-csat-matrix-scale.md +18 -26
  35. package/templates/docs/01-components/06-likert-matrix-scale.md +19 -39
  36. package/templates/docs/01-components/07-slider-matrix-scale.md +48 -33
  37. package/templates/docs/01-components/09-custom-slider-track.md +15 -25
  38. package/templates/docs/01-components/10-header-footer.md +23 -4
  39. package/templates/docs/01-components/11-progress-bar.md +14 -6
  40. package/templates/docs/01-components/19-survey-sticky-chrome.md +79 -0
  41. package/templates/docs/01-components/README.md +2 -2
  42. package/templates/docs/02-reference/question-types/10-slider-matrix.md +38 -26
  43. package/templates/docs/02-reference/routing-table.md +1 -0
  44. package/templates/docs/02-reference/value-derivation.md +1 -1
  45. package/templates/docs/03-ui-specs/00-question-shell.md +10 -0
  46. package/templates/docs/03-ui-specs/01-rating.md +18 -0
  47. package/templates/docs/03-ui-specs/02-radio.md +16 -1
  48. package/templates/docs/03-ui-specs/03-text.md +12 -1
  49. package/templates/docs/03-ui-specs/04-csat.md +84 -50
  50. package/templates/docs/03-ui-specs/06-slider.md +3 -1
  51. package/templates/docs/03-ui-specs/07-matrix-cfm.md +71 -48
  52. package/templates/docs/03-ui-specs/08-matrix-csat-rating.md +48 -18
  53. package/templates/docs/03-ui-specs/09-slider-matrix.md +59 -32
  54. package/templates/docs/03-ui-specs/10-file-upload.md +11 -0
  55. package/templates/docs/03-ui-specs/11-text-and-media.md +4 -0
  56. package/templates/docs/03-ui-specs/12-survey-chrome.md +54 -5
  57. package/templates/docs/03-ui-specs/13-heatmap.md +12 -1
  58. package/templates/docs/03-ui-specs/14-rank-order.md +11 -0
  59. package/templates/docs/03-ui-specs/README.md +4 -2
  60. package/templates/docs/03-ui-specs/shared/matrix-dropdown.md +1 -1
  61. package/templates/docs/MANIFEST.json +180 -7
  62. package/templates/docs/index.md +114 -117
  63. package/templates/docs/templates/CsatMatrixScale.tsx +637 -0
  64. package/templates/docs/templates/FileUploadScale.tsx +262 -0
  65. package/templates/docs/templates/HeatmapScale.tsx +114 -0
  66. package/templates/docs/templates/LikertMatrixScale.tsx +414 -0
  67. package/templates/docs/templates/Question.tsx +3 -0
  68. package/templates/docs/templates/RatingScale.tsx +129 -0
  69. package/templates/docs/templates/SliderMatrixScale.tsx +248 -0
  70. package/templates/docs/templates/SurveyStickyChrome.tsx +24 -0
  71. package/templates/docs/templates/customFieldValues.ts +36 -0
  72. package/templates/docs/templates/deploy-to-aws.sh +74 -0
  73. package/templates/docs/templates/implementation_plan.md +64 -10
  74. package/templates/docs/templates/labelStyles.ts +33 -0
  75. package/templates/docs/templates/selectionStyles.ts +100 -0
  76. package/templates/docs/templates/surveyUiIcons.tsx +11 -0
  77. package/templates/docs/templates/surveyUiScaleUtils.ts +51 -0
  78. package/templates/docs/templates/verify-agent-build.sh +119 -0
  79. package/templates/preview-harness/preview-bridge.inline.js +201 -0
  80. package/templates/preview-harness/previewPages.js +108 -0
  81. package/templates/preview-harness/previewPages.ts +298 -0
  82. package/templates/preview-harness/vite-app/src/PreviewConfigContext.tsx +67 -0
  83. package/templates/preview-harness/vite-app/src/QuestionPreview.tsx +122 -0
  84. package/templates/preview-harness/vite-app/src/SurveyPagePreview.tsx +75 -0
  85. package/templates/preview-harness/vite-app/src/fixtures/questions.ts +311 -0
  86. package/templates/preview-harness/vite-app/src/globals.css +16 -0
  87. package/templates/preview-harness/vite-app/src/mount.tsx +9 -0
  88. package/templates/preview-harness/vite-app/src/preview-live-overrides.css +101 -0
  89. package/templates/preview-harness/vite-app/stubs/next-dynamic.tsx +25 -0
  90. package/templates/preview-harness/vite-app/stubs/next-image.tsx +29 -0
  91. package/templates/previewBridge.ts +153 -0
  92. package/templates/survey-theme.css +295 -0
  93. package/templates/survey-ui-config.schema.json +213 -0
  94. package/templates/wizard-dist/assets/PreviewMock-AoZdAEPZ.js +1 -0
  95. package/templates/wizard-dist/assets/TypePanel-39FnbtvG.js +1 -0
  96. package/templates/wizard-dist/assets/index-BhWM50Yu.css +1 -0
  97. package/templates/wizard-dist/assets/index-CWKdsJOp.js +34 -0
  98. package/templates/wizard-dist/assets/vendor-BwkXDkd3.js +17 -0
  99. package/templates/wizard-dist/index.html +20 -0
  100. package/templates/wizard.html +13 -1129
@@ -4,173 +4,170 @@
4
4
 
5
5
  Master guide for AI coding agents. Machine-readable index: `MANIFEST.json`.
6
6
 
7
+ **Authoritative execution order:** [`00-integration/agent-operating-contract.md`](00-integration/agent-operating-contract.md) (read **first**) → [`agent-execution-flow.md`](00-integration/agent-execution-flow.md) → this file.
8
+
7
9
  **Installed package path:** `node_modules/@explorer02/cfm-survey-sdk/templates/docs/` (docs ship inside `templates/` — no postinstall copy needed).
8
10
 
11
+ ## Anti-hallucination (agents)
12
+
13
+ Client-side coding agents **must not guess** SDK behavior. Before any code:
14
+
15
+ 1. Read [`agent-operating-contract.md`](00-integration/agent-operating-contract.md) — source hierarchy, phase gates, hallucination blocklist, doc routing table
16
+ 2. Read [`agent-execution-flow.md`](00-integration/agent-execution-flow.md) — pipeline and client questions
17
+ 3. For each fetched `question.type`, read MANIFEST `blueprint` + `reference` + `uiSpec` **before** implementing that type
18
+ 4. Copy from `docs/templates/` — do not rewrite dispatchers or scales from memory
19
+ 5. Run `verify-agent-build.sh` before claiming the build is done
20
+
21
+ **Prime directive:** If it is not in these docs or templates, do not implement it.
22
+
9
23
  ## Documentation Layout
10
24
 
11
25
  ```
12
- templates/docs/ ← installed npm package layout
13
- packages/sdk/templates/docs/monorepo layout
14
- ├── index.mdYOU ARE HERE
15
- ├── MANIFEST.json ← Phase + question-type routing (for tooling)
16
- ├── 00-integration/ Setup, hook contract, constraints
17
- ├── 01-components/ Wiring blueprints (read per type from MANIFEST)
18
- ├── 02-reference/ ← Routing table, exports, config-field-index
19
- ├── 03-ui-specs/ ← Authoritative UI specs
26
+ templates/docs/
27
+ ├── index.md YOU ARE HERE
28
+ ├── MANIFEST.jsonPhase + question-type routing
29
+ ├── 00-integration/
30
+ ├── agent-operating-contract.md Anti-hallucination read FIRST
31
+ ├── agent-execution-flow.md Pipeline, client questions, wizard-ready build
32
+ ├── wizard-preview-build-guide.md
33
+ ├── wizard-question-type-styling.md
34
+ │ └── …
35
+ ├── 01-components/ ← Wiring blueprints (per type from MANIFEST)
36
+ ├── 02-reference/ ← Data shapes, routing, config fields
37
+ ├── 03-ui-specs/ ← UI anatomy + wizard token sections
20
38
  └── templates/
21
- ├── implementation_plan.md
22
- ├── survey-inventory.schema.json
23
- ├── verify-agent-build.sh
24
- ├── deploy-to-aws.sh
25
- ├── heatmapCoords.ts
26
- └── Question.tsx ← Canonical dispatcher (copy before building)
39
+ ├── Question.tsx ← Canonical dispatcher (copy first)
40
+ ├── selectionStyles.ts ← Wizard selection colors (copy to src/lib/surveyUi/)
41
+ ├── labelStyles.ts ← Matrix/slider label items
42
+ ├── survey-theme.css ← Full --cfm-* defaults
43
+ └── implementation_plan.md
27
44
  ```
28
45
 
29
- **Import rule:** Use whatever package name appears in the project's `package.json` (`@explorer02/cfm-survey-sdk` or `@repo/sdk`).
46
+ **Import rule:** Use whatever package name appears in `package.json` (`@explorer02/cfm-survey-sdk` or `@repo/sdk`).
30
47
 
31
48
  ## Do Not Read
32
49
 
33
50
  - Internal SDK mapper/source paths (`packages/sdk/src/**` or `node_modules/.../src/**`)
34
- - `cfm-sdk init`, `survey-config.json`, or any setup wizard
35
- - Stale `apps/client` code without verifying type literals against `MANIFEST.json` `typeLiterals`
51
+ - Legacy `survey-config.json` or pre-build setup wizard
52
+ - `apps/client` as implementation source it is a reference snapshot only; agents build from `docs/templates/` + these docs
36
53
 
37
54
  ---
38
55
 
39
- ## Client Inputs (3 only)
56
+ ## Client inputs (4) — when to ask
40
57
 
41
- 1. **Initial prompt** mockup, brand colors, layout preferences
42
- 2. **Instance ID** — JWT token (agent asks in chat)
43
- 3. **Deploy confirmation**yes/no for production deploy
58
+ | # | Phase | Agent question | Doc |
59
+ |---|-------|----------------|-----|
60
+ | 1 | Start | *(Client prompt usually provided)* | Extract branding → `implementation_plan.md` |
61
+ | 2 | Phase 2 | *"Please provide your survey instance ID (JWT token)."* | `useSurveySDK.md` |
62
+ | 3 | Phase 6 | *"Your survey is running locally. Would you like to customize the UI through the web wizard?"* | `ui-customization-wizard.md` |
63
+ | 4 | Phase 7 | *"Your survey is built and verified. Ready to deploy to production?"* | `aws-deploy.md` / deploy CLI |
44
64
 
45
- **Branding comes from INPUT 1 only.** No setup wizard. No `survey-config.json`.
65
+ **Branding defaults from INPUT 1.** Wizard (INPUT 3) is optional — but Phase 5 build must still be **wizard-ready**.
46
66
 
47
67
  ---
48
68
 
49
- ## Execution Pipeline
50
-
51
- ### PHASE 0: ORIENT
69
+ ## Execution pipeline (summary)
52
70
 
53
- - Read this file and `AGENT.md`:
54
- - **Monorepo:** `packages/sdk/templates/AGENT.md`
55
- - **Installed npm:** `node_modules/@explorer02/cfm-survey-sdk/templates/AGENT.md`
56
- - Detect framework: read `package.json` — Next.js / Vite / CRA (see `00-integration/setup.md`)
57
- - Extract branding and layout from client prompt
58
- - For existing apps: read project structure; do not blindly scaffold
71
+ Full step-by-step: [`agent-execution-flow.md`](00-integration/agent-execution-flow.md).
59
72
 
60
- ### PHASE 1: SCAFFOLD
73
+ | Phase | Goal | Key reads |
74
+ |-------|------|-----------|
75
+ | **0** Orient | Framework + branding | `index.md`, `AGENT.md`, `agent-execution-flow.md`, `MANIFEST.json` |
76
+ | **1** Scaffold | Install SDK | `setup.md` |
77
+ | **2** Instance ID | Get JWT | `useSurveySDK.md` — **ask client** |
78
+ | **3** SDK contract | Hook + logic | `client-integration-guide.md`, `question-type-sdk-matrix.md`, logic docs |
79
+ | **4** Plan | Inventory + copy dispatcher | `component-checklist.md`, per-type MANIFEST docs, `implementation_plan.md` |
80
+ | **5** Build | Wizard-ready UI | `constraints.md`, `wizard-preview-build-guide.md`, `wizard-question-type-styling.md`, `03-ui-specs/*` |
81
+ | **6** Verify | Build + dev server | `verify-agent-build.sh` — **ask wizard** |
82
+ | **6b** Wizard | Optional customize | **`npx cfm-sdk customize`** (default) — EC2 `customize-ui` only if client on another device |
83
+ | **6c** Apply | Sync final config | `apply-ui-config.md` |
84
+ | **7** Deploy | Production | **ask deploy** — `aws-deploy.md` or Vercel |
61
85
 
62
- Read: `00-integration/setup.md` (matching framework section)
86
+ **Auto-proceed:** Phase 4 → 5 and Phase 5 → 6 without waiting for approval.
63
87
 
64
- Install SDK + `@tanstack/react-query` + `react-icons`. Apply framework-specific config.
65
-
66
- ### PHASE 2: INSTANCE ID (INPUT 2)
88
+ ---
67
89
 
68
- Read: `00-integration/useSurveySDK.md`
90
+ ### PHASE 5 — Build (wizard-ready, required artifacts)
69
91
 
70
- Ask: *"Please provide your survey instance ID (JWT token)."*
92
+ Every agent build includes these even if the client later skips the wizard:
71
93
 
72
- ### PHASE 3: SDK CONTRACT
94
+ | Artifact | Source | Destination |
95
+ |----------|--------|-------------|
96
+ | Theme CSS | `templates/survey-theme.css` | `src/styles/survey-theme.css` |
97
+ | Selection helpers | `templates/selectionStyles.ts` | `src/lib/surveyUi/selectionStyles.ts` |
98
+ | Label helpers | `templates/labelStyles.ts` | `src/lib/surveyUi/labelStyles.ts` |
99
+ | Preview bridge | `templates/previewBridge.ts` | `src/lib/previewBridge.ts` |
100
+ | Dispatcher | `templates/Question.tsx` | `src/components/Question.tsx` |
101
+ | Scale components | `templates/*Scale*.tsx` etc. | `src/components/` per inventory |
102
+ | Draft config | agent-written | `./survey-ui-config.json` |
73
103
 
74
- Read: `00-integration/client-integration-guide.md` (start here), `00-integration/question-type-sdk-matrix.md`, `00-integration/useSurveySDK.md`, `02-reference/exports.md`, `00-integration/skip-logic-and-navigation.md`, `00-integration/display-logic-and-navigation.md`, `00-integration/question-display-variants.md`, `00-integration/question-numbering.md`, `00-integration/placeholders-and-tokens.md`, `00-integration/partial-save-and-recovery.md`, `00-integration/survey-lifecycle-analytics.md`, `00-integration/end-page-logic.md`, `00-integration/answer-logic-and-navigation.md`, `00-integration/custom-field-logic-and-navigation.md`, `00-integration/progress.md`, `02-reference/value-derivation.md`, `00-integration/logic-fields-catalog.md`, `00-integration/analytics-events-catalog.md`
104
+ **Chrome:** `data-cfm-logo` / `data-cfm-logo-text`, `data-cfm-company`, `data-cfm-btn-next`, `data-cfm-btn-back`, `data-cfm-survey-title`, `data-cfm-thank-you` see `wizard-preview-build-guide.md`.
75
105
 
76
- Understand `useSurveySDK`, `onAction`, `state.answers`. Do **not** read internal mapper/source paths.
106
+ **Selection pattern:** focus ring = outer border + inner dot; cell selected = annulus fill — see `wizard-question-type-styling.md`.
77
107
 
78
- Optional: read `02-reference/routing-table.md` for type overview.
108
+ **Forbidden:** stub branches, `subType` routing, changing `onAction` payloads, hardcoded hex for wizard-controlled tokens.
79
109
 
80
- ### PHASE 4: PLAN + INGEST (CRITICAL)
110
+ Copy scale templates: `SliderMatrixScale`, `LikertMatrixScale`, `CsatMatrixScale`, `RatingScale`, `FileUploadScale`, `HeatmapScale`, `RankOrderScale`, `MatrixDropdown`, `CustomSliderTrack`, `surveyUiIcons`, `surveyUiScaleUtils`, `heatmapCoords`, `customFieldValues` (when needed).
81
111
 
82
- 1. Fetch survey with `instanceId`; extract unique `question.type` values from `survey.pages`
83
- 2. Write inventory to `implementation_plan.md` §3b (validate against `templates/survey-inventory.schema.json`)
84
- 3. Read **always**: `component-checklist.md`, `00-integration/question-type-sdk-matrix.md`, `03-ui-specs/00-question-shell.md`, `03-ui-specs/12-survey-chrome.md`, `01-components/01-survey-page.md`, `01-components/02-question.md`, `01-components/14-intro-page.md`, `01-components/15-end-page.md`, `01-components/16-paused-page.md`
85
- 4. For **each type in the survey**, read MANIFEST `questionTypes.{type}` → blueprint + reference + uiSpec; cross-check the matching row in `question-type-sdk-matrix.md`
86
- 5. When config flags match MANIFEST `sharedUiSpecTriggers` (e.g. `gridLayout:dropdown`, `displayStyle:graphics`) → read matching `03-ui-specs/shared/` specs
87
- 6. Copy `docs/templates/implementation_plan.md` → `./implementation_plan.md` and fill every section
88
- 7. Copy `docs/templates/Question.tsx` as the dispatcher starting point
89
- 8. **Auto-proceed to Phase 5** — do not wait for approval
112
+ ---
90
113
 
91
- **Fallback:** If survey fetch fails, read all `01-components/*.md` blueprints before coding.
114
+ ### PHASE 6 Verify checklist
92
115
 
93
- ### PHASE 5: BUILD
116
+ - [ ] `Question.tsx` covers all **11** `question.type` values (flat literals)
117
+ - [ ] Zero `"not yet implemented"` matches
118
+ - [ ] `src/styles/survey-theme.css` + `selectionStyles.ts` + `labelStyles.ts` present
119
+ - [ ] Chrome `data-cfm-*` hooks on Header, SurveyPage, Intro/End
120
+ - [ ] `npm run build` exits 0
121
+ - [ ] Dev server loads survey
122
+ - [ ] AWS: `out/index.html` exists; file count ≤ 500
94
123
 
95
- Read: `00-integration/constraints.md`, `00-integration/component-checklist.md`, `00-integration/question-type-sdk-matrix.md`
124
+ Run: `bash templates/verify-agent-build.sh`
96
125
 
97
- Create all required scale component files **before** wiring `Question.tsx`. **Copy portable templates** from `docs/templates/` when listed in `component-checklist.md` (`RankOrderScale.tsx`, `MatrixDropdown.tsx`, `CustomSliderTrack.tsx`, `surveyUiIcons.tsx`, `heatmapCoords.ts`). For each question in the survey:
126
+ ---
98
127
 
99
- 1. Read the matching row in `question-type-sdk-matrix.md` (answer shape, visibility helper, performance)
100
- 2. Read `02-reference/question-types/` doc for data shape (MANIFEST `reference`)
101
- 2. Read matching `03-ui-specs/` (MANIFEST `uiSpec`)
102
- 3. If `gridLayout`, `displayStyle`, or `statementLayout` triggers shared specs → read `03-ui-specs/shared/`
103
- 4. Cross-check `02-reference/config-field-index.md` for every non-default field
104
- 5. Implement per ui-spec — trust SDK Integration Checklist in blueprint/reference + `templates/Question.tsx` + exported SDK types + `02-reference/value-derivation.md`
128
+ ### PHASE 6b / 6c Wizard (wait apply every change)
105
129
 
106
- Implement components per blueprints + UI specs. Use exported types:
130
+ Only after Phase 6 passes and client says **yes**:
107
131
 
108
- ```typescript
109
- import { useSurveySDK, ACTIONS, QUESTION_TYPE, type SurveyAction } from '@explorer02/cfm-survey-sdk';
132
+ ```bash
133
+ npx cfm-sdk customize # DEFAULT — opens localhost:4200, WAITS until client saves
110
134
  ```
111
135
 
112
- **Dispatch on flat `question.type` only** **11** `QUESTION_TYPE` literals, no `subType`. See `MANIFEST.json` `typeLiterals`.
113
-
114
- **AWS deploy prep (when client prompt mentions AWS / CloudFront / S3 / EC2 / Sprinklr):** apply Next.js static export config **during this phase**, not at deploy time. Read `00-integration/setup.md#nextjs-aws-static-export` and `00-integration/aws-deploy.md` § Build Config. Fill `implementation_plan.md` §8.
115
-
116
- ### PHASE 6: VERIFY
117
-
118
- Read: `00-integration/constraints.md` (troubleshooting)
136
+ **Phase 6b:** Client on same machine → `customize` writes `survey-ui-config.json` directly. Remote client `customize-ui` + EC2 link (see `wizard-troubleshooting.md`). Apply per `apply-ui-config.md`.
119
137
 
120
- Run: `bash templates/verify-agent-build.sh` (from project root, after copying script if needed)
121
-
122
- Checklist:
123
-
124
- - [ ] `Question.tsx` copied from `docs/templates/Question.tsx` — covers all **11** `question.type` values
125
- - [ ] Each matrix variant routes by its own type literal (`CFM_MATRIX`, `CSAT_MATRIX`, `RATING_MATRIX`) — **no `subType`**
126
- - [ ] All scale components from `component-checklist.md` exist for types in survey
127
- - [ ] **Zero stub text:** `grep -r "not yet implemented" src/ components/ app/` returns no matches
128
- - [ ] Every question wrapper has `id={question.id}`
129
- - [ ] No imports from `@explorer02/cfm-survey-sdk/src/...` or `@repo/sdk/src/...`
130
- - [ ] `SurveyPage` handles loading / error / empty / all `state.phase` values / active content
131
- - [ ] Hook uses `state.answers`, `state.canGoBack`, `state.primaryButtonType`, and `payload.answerValue`
132
- - [ ] Stable `customFieldValues` ref when survey uses custom-field logic; passed to hook and `Question` visibility helpers
133
- - [ ] `SURVEY_PLACEHOLDERS` stable ref; `surveyOptions` in `useMemo` (see `placeholders-and-tokens.md`)
134
- - [ ] `SCROLL` + `RECORD_QUESTION_VIEW` lifecycle effects wired (see `survey-lifecycle-analytics.md`)
135
- - [ ] Monorepo: `packages/sdk` built before client dev (`npm run build`)
136
- - [ ] `npm run build` exits 0
137
- - [ ] **AWS intent:** `out/index.html` exists; file count ≤ 500; Next.js static export configured (`output: export`, `assetPrefix: "./"`)
138
-
139
- ### PHASE 7: DEPLOY (INPUT 3)
140
-
141
- Ask: *"Your survey is built and verified. Ready to deploy?"*
142
-
143
- **Route by client prompt** (see MANIFEST `deployTargets` and `phases[7].selectTargetFromPrompt`):
144
-
145
- | Prompt mentions | Target | Action |
146
- |-----------------|--------|--------|
147
- | AWS, CloudFront, S3, EC2, Sprinklr | **AWS** | Read `00-integration/aws-deploy.md`; set env vars; run 3-channel deploy or `bash templates/deploy-to-aws.sh` |
148
- | Vercel or unspecified (default) | **Vercel** | `npx cfm-sdk deploy` (requires `VERCEL_TOKEN` or Vercel CLI) |
149
-
150
- **AWS env vars (dev machine):**
138
+ **Phase 6c:** Apply from `survey-ui-config.final.json` per [`wizard-config-handoff.md`](00-integration/wizard-config-handoff.md) + [`apply-ui-config.md`](00-integration/apply-ui-config.md) **every** diff path. Then:
151
139
 
152
140
  ```bash
153
- export CFM_INSTANCE_ID="<same JWT as SurveyPage>"
154
- export CFM_DEPLOY_API_BASE="http://43.204.26.213:3000"
155
- export OUT_DIR="<absolute path to out/ or dist/>"
141
+ npx cfm-sdk confirm-ui-config
156
142
  ```
157
143
 
158
- **AWS success:** print live CloudFront HTTPS URL from `/deploy/complete`; ask client to open in browser.
159
-
160
- **Vercel success:** CLI prints production URL.
144
+ Re-run verify script + build.
161
145
 
162
146
  ---
163
147
 
164
- ## Progressive Reading Guide
148
+ ## Progressive reading guide
165
149
 
166
150
  | When | Read |
167
151
  |------|------|
168
- | Always first | `index.md`, `00-integration/client-integration-guide.md`, `00-integration/question-type-sdk-matrix.md`, `00-integration/setup.md`, `00-integration/useSurveySDK.md`, `00-integration/constraints.md` |
169
- | Lifecycle & placeholders | `survey-lifecycle-analytics.md`, `placeholders-and-tokens.md`, `partial-save-and-recovery.md`, `analytics-events-catalog.md` |
170
- | Skip logic & progress | `skip-logic-and-navigation.md`, `display-logic-and-navigation.md`, `question-display-variants.md`, `question-numbering.md`, `end-page-logic.md`, `answer-logic-and-navigation.md`, `custom-field-logic-and-navigation.md`, `progress.md`, `logic-fields-catalog.md` |
171
- | File upload submit | `file-upload-aws.md`, `03-ui-specs/10-file-upload.md` |
172
- | Before any React code | `component-checklist.md`, `templates/Question.tsx`, MANIFEST `readAlways` docs |
173
- | After instanceId fetch | Per-type docs from MANIFEST `questionTypes` (blocking: `CFM_MATRIX`, `CSAT_MATRIX`, `RATING_MATRIX`, `SLIDER_MATRIX`, `FILE_UPLOAD`) |
152
+ | **Always first** | `agent-operating-contract.md`, `agent-execution-flow.md`, `mockup-ui-extraction.md`, `index.md`, `client-integration-guide.md`, `constraints.md` |
153
+ | Phase 3 contract | `question-type-sdk-matrix.md`, `useSurveySDK.md`, logic/navigation docs |
154
+ | Phase 4 plan | `mockup-ui-extraction.md`, `placeholders-and-custom-fields-wiring.md`, `component-checklist.md`, per-type `03-ui-specs/*` |
155
+ | Wizard build | `wizard-preview-build-guide.md`, `wizard-question-type-styling.md` |
156
+ | Wizard run | `wizard-config-handoff.md`, `ui-customization-wizard.md`, `wizard-api.md`, `wizard-troubleshooting.md` |
157
+ | After wizard (apply all paths) | `apply-ui-config.md` |
158
+ | Deploy | `aws-deploy.md` (§ Logos & local assets), `setup.md#nextjs-aws-static-export` |
174
159
  | Config audit | `02-reference/config-field-index.md` |
175
- | AWS deploy | `00-integration/aws-deploy.md`, `setup.md#nextjs-aws-static-export`, `templates/deploy-to-aws.sh` |
176
- | Tooling | `MANIFEST.json`, `templates/implementation_plan.md`, `templates/survey-inventory.schema.json` |
160
+
161
+ ---
162
+
163
+ ## Wizard styling (all types)
164
+
165
+ | Token | Variable | Applies to |
166
+ |-------|----------|------------|
167
+ | Cell selected | `--cfm-matrix-selected` | Radio annulus; numbered/star cell fill |
168
+ | Focus ring | `--cfm-input-focus-ring` | Radio outer border + inner dot |
169
+ | Label items | `--cfm-*-column-label-*` | Matrix column headers (not hint labels on CFM) |
170
+ | Hint labels | `--cfm-hint-label-*` | NPS min/max anchors |
171
+ | Number labels | `--cfm-number-*` | Traffic-light badges (unselected only) |
172
+
173
+ Full per-type table: [`wizard-question-type-styling.md`](00-integration/wizard-question-type-styling.md).