@elevasis/sdk 1.15.0 → 1.16.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 (66) hide show
  1. package/dist/cli.cjs +2325 -124
  2. package/dist/index.d.ts +882 -794
  3. package/dist/index.js +170 -46
  4. package/dist/node/index.d.ts +69 -0
  5. package/dist/node/index.js +273 -0
  6. package/dist/test-utils/index.d.ts +857 -711
  7. package/dist/test-utils/index.js +2 -0
  8. package/dist/types/worker/adapters/lead.d.ts +1 -1
  9. package/dist/types/worker/platform.d.ts +2 -9
  10. package/dist/worker/index.js +1 -0
  11. package/package.json +12 -3
  12. package/reference/_navigation.md +23 -1
  13. package/reference/_reference-manifest.json +98 -0
  14. package/reference/claude-config/rules/agent-start-here.md +13 -0
  15. package/reference/claude-config/rules/organization-model.md +40 -40
  16. package/reference/claude-config/rules/organization-os.md +16 -16
  17. package/reference/claude-config/rules/ui.md +2 -6
  18. package/reference/claude-config/rules/vibe.md +13 -13
  19. package/reference/claude-config/skills/knowledge/SKILL.md +253 -0
  20. package/reference/claude-config/skills/{configure → knowledge}/operations/codify-level-a.md +100 -100
  21. package/reference/claude-config/skills/{configure → knowledge}/operations/codify-level-b.md +158 -158
  22. package/reference/claude-config/skills/knowledge/operations/customers.md +109 -0
  23. package/reference/claude-config/skills/knowledge/operations/features.md +113 -0
  24. package/reference/claude-config/skills/knowledge/operations/goals.md +118 -0
  25. package/reference/claude-config/skills/knowledge/operations/identity.md +93 -0
  26. package/reference/claude-config/skills/knowledge/operations/labels.md +89 -0
  27. package/reference/claude-config/skills/knowledge/operations/offerings.md +109 -0
  28. package/reference/claude-config/skills/knowledge/operations/roles.md +99 -0
  29. package/reference/claude-config/skills/knowledge/operations/techStack.md +102 -0
  30. package/reference/claude-config/skills/run-ui/SKILL.md +73 -0
  31. package/reference/claude-config/skills/setup/SKILL.md +270 -270
  32. package/reference/claude-config/skills/tutorial/SKILL.md +249 -0
  33. package/reference/claude-config/skills/tutorial/progress-template.md +74 -0
  34. package/reference/claude-config/skills/tutorial/technical.md +1309 -0
  35. package/reference/claude-config/skills/tutorial/vibe-coder.md +890 -0
  36. package/reference/claude-config/sync-notes/2026-05-02-crm-ownership-next-action.md +58 -0
  37. package/reference/claude-config/sync-notes/2026-05-02-template-hardcode-workos-config.md +56 -0
  38. package/reference/claude-config/sync-notes/2026-05-04-elevasis-workspace.md +71 -0
  39. package/reference/claude-config/sync-notes/2026-05-04-template-skills-run-ui-and-tutorial.md +59 -0
  40. package/reference/deployment/index.mdx +5 -5
  41. package/reference/examples/organization-model.ts +40 -0
  42. package/reference/framework/index.mdx +1 -1
  43. package/reference/framework/tutorial-system.mdx +86 -173
  44. package/reference/packages/core/src/knowledge/README.md +32 -0
  45. package/reference/packages/ui/src/knowledge/README.md +31 -0
  46. package/reference/packages/ui/src/theme/presets/README.md +19 -0
  47. package/reference/scaffold/core/organization-model.mdx +1 -1
  48. package/reference/scaffold/recipes/add-a-feature.md +1 -1
  49. package/reference/scaffold/recipes/customize-crm-actions.md +3 -3
  50. package/reference/scaffold/recipes/customize-organization-model.md +3 -3
  51. package/reference/scaffold/recipes/extend-crm.md +12 -8
  52. package/reference/scaffold/recipes/extend-lead-gen.md +129 -20
  53. package/reference/scaffold/recipes/gate-by-feature-or-admin.md +1 -1
  54. package/reference/scaffold/recipes/index.md +6 -0
  55. package/reference/scaffold/reference/contracts.md +829 -595
  56. package/reference/scaffold/reference/feature-registry.md +2 -1
  57. package/reference/scaffold/ui/composition-extensibility.mdx +17 -0
  58. package/reference/claude-config/skills/configure/SKILL.md +0 -98
  59. package/reference/claude-config/skills/configure/operations/customers.md +0 -150
  60. package/reference/claude-config/skills/configure/operations/features.md +0 -162
  61. package/reference/claude-config/skills/configure/operations/goals.md +0 -147
  62. package/reference/claude-config/skills/configure/operations/identity.md +0 -133
  63. package/reference/claude-config/skills/configure/operations/labels.md +0 -128
  64. package/reference/claude-config/skills/configure/operations/offerings.md +0 -159
  65. package/reference/claude-config/skills/configure/operations/roles.md +0 -153
  66. package/reference/claude-config/skills/configure/operations/techStack.md +0 -139
@@ -1,275 +1,275 @@
1
- ---
2
- name: setup
3
- description: First-time project setup — detect and replace template placeholders, install dependencies, verify build, then hand off to /configure for org-model configuration
4
- argument-hint: ""
5
- ---
6
-
7
- # Setup
8
-
9
- First-time project setup for projects cloned directly from the template. Handles placeholder replacement, dependency install, and build verification. After bootstrap, delegates org-model configuration to `/configure`.
10
-
11
- **Usage:** `/setup`
12
-
13
- ---
14
-
15
- ## State Detection (Run Before Anything Else)
16
-
17
- Before collecting any information or running any steps, determine which state the project is in. Read these files:
18
-
19
- - `package.json` — look for `__PROJECT_SLUG__` in the `name` field
20
- - `CLAUDE.md` — look for `TEMPLATE_PROJECT_NAME` AND check whether `{CLIENT_CONTEXT}` and `{USER_PREFERENCES}` are still literal placeholder strings
21
- - `ui/package.json` — look for `__PROJECT_SLUG__`
22
- - `ui/index.html` — look for `__PROJECT_NAME__`
23
-
24
- **State A — Virgin (placeholders present):** One or more of the above placeholder strings is found. Run the full bootstrap flow (Steps 1–7 below), then hand off to `/configure`.
25
-
1
+ ---
2
+ name: setup
3
+ description: First-time project setup — detect and replace template placeholders, install dependencies, verify build, then hand off to /knowledge for org-model configuration
4
+ argument-hint: ""
5
+ ---
6
+
7
+ # Setup
8
+
9
+ First-time project setup for projects cloned directly from the template. Handles placeholder replacement, dependency install, and build verification. After bootstrap, delegates org-model configuration to `/knowledge`.
10
+
11
+ **Usage:** `/setup`
12
+
13
+ ---
14
+
15
+ ## State Detection (Run Before Anything Else)
16
+
17
+ Before collecting any information or running any steps, determine which state the project is in. Read these files:
18
+
19
+ - `package.json` — look for `__PROJECT_SLUG__` in the `name` field
20
+ - `CLAUDE.md` — look for `TEMPLATE_PROJECT_NAME` AND check whether `{CLIENT_CONTEXT}` and `{USER_PREFERENCES}` are still literal placeholder strings
21
+ - `ui/package.json` — look for `__PROJECT_SLUG__`
22
+ - `ui/index.html` — look for `__PROJECT_NAME__`
23
+
24
+ **State A — Virgin (placeholders present):** One or more of the above placeholder strings is found. Run the full bootstrap flow (Steps 1–7 below), then hand off to `/knowledge`.
25
+
26
26
  **State B — Already bootstrapped, org-model at defaults:** No placeholders found, but `core/config/organization-model.ts` contains only the default branding override (just `branding.organizationName`, `branding.productName`, `branding.shortName` — no identity, customers, offerings, roles, goals, or techStack overrides). Print:
27
-
28
- ```
29
- This project is already set up. The organization model has not been configured yet.
30
- Running /configure to set up your organization profile...
31
- ```
32
-
33
- Then execute `/configure` (the full layered flow) and stop.
34
-
27
+
28
+ ```
29
+ This project is already set up. The organization model has not been configured yet.
30
+ Running /knowledge to set up your organization profile...
31
+ ```
32
+
33
+ Then execute `/knowledge` (the full layered flow) and stop.
34
+
35
35
  **State C — Fully configured:** No placeholders found AND `core/config/organization-model.ts` has at least one non-branding domain populated (identity, customers, offerings, roles, goals, or techStack present). Print:
36
-
37
- ```
38
- This project is already configured. To update your organization profile, run /configure.
39
- To re-verify the build, run the checks below.
40
- ```
41
-
42
- Offer to run the verification checks (Steps 6b–6e) if the user wants them. Do not re-ask any questions. Do not re-run placeholder replacement. Stop after verification.
43
-
44
- ---
45
-
46
- ## Full Bootstrap Flow (State A Only)
47
-
48
- ### Step 1: Collect Project Info
49
-
50
- Ask the user for three values:
51
-
52
- 1. **Slug** — lowercase, hyphens only (e.g., `acme-dashboard`). Default to the basename of the current working directory.
53
- 2. **Human-readable name** — used in titles, docs, and CLAUDE.md (e.g., `Acme Dashboard`).
54
- 3. **Short description** — one sentence, used in `package.json` and CLAUDE.md (e.g., `Client dashboard for Acme Corp.`).
55
-
56
- Confirm the values before proceeding:
57
-
58
- ```
59
- Configuring project with:
60
- Slug: <slug>
61
- Name: <name>
62
- Description: <description>
63
- Date: <YYYY-MM-DD>
64
-
65
- Proceed? (yes/no)
66
- ```
67
-
68
- ### Step 2: Get to Know the User and Client
69
-
70
- Transition naturally after confirming the project values: "Now let me learn a bit about you and the client so I can be more helpful going forward."
71
-
72
- **About the user (ask conversationally, one at a time):**
73
-
74
- 1. **Name** -- "What's your first name?"
75
- 2. **Role** -- "What's your role?" (e.g., founder, developer, project lead)
76
- 3. **Technical level** -- "How comfortable are you with technical stuff? No wrong answer -- just helps me know how to explain things."
77
- 4. **Communication style** -- "When I explain things or write docs, do you prefer short and to-the-point, or more detailed with context?"
78
-
79
- Use their name naturally from this point on.
80
-
81
- **About the client/company this project is for:**
82
-
83
- 5. **Company name** -- "Who's this project for? What's the company name?"
84
- 6. **What they do** -- "What does {company} do? Just a sentence or two."
85
- 7. **Industry** -- "What industry or space are they in?"
86
- 8. **Key context** -- "Anything else that would help me understand the project context? Key stakeholders, business goals, important constraints -- whatever comes to mind. (Totally fine to skip, we can add this as we go.)"
87
-
88
- React to what they share, ask natural follow-ups if something is interesting or unclear. Don't make it feel like a form.
89
-
90
- After gathering, confirm:
91
-
92
- ```
93
- Got it! Here's what I captured:
94
-
95
- User: {name} ({role}, {technical level}, prefers {style})
96
-
97
- Client: {company}
98
- {what they do}
99
- Industry: {industry}
100
- {any additional context}
101
-
102
- Look good?
103
- ```
104
-
105
- ### Step 3: Replace Placeholders
106
-
107
- Search ALL files in the project matching these extensions: `.ts`, `.tsx`, `.js`, `.mjs`, `.json`, `.md`, `.mdx`, `.html`, `.yaml`, `.yml`, `.css`, `.env.example`
108
-
109
- Exclude these directories and files: `node_modules/`, `dist/`, `.tanstack/`, `pnpm-lock.yaml`
110
-
111
- For each matching file, replace all occurrences of:
112
-
113
- | Placeholder | Replace with |
114
- | ------------------------------ | ----------------------- |
115
- | `__PROJECT_NAME__` | human-readable name |
116
- | `__PROJECT_SLUG__` | slug |
117
- | `__PROJECT_DESCRIPTION__` | description |
118
- | `__DATE__` | today's date YYYY-MM-DD |
119
- | `TEMPLATE_PROJECT_NAME` | human-readable name |
120
- | `TEMPLATE_PROJECT_DESCRIPTION` | description |
121
-
122
- Use the Read tool to read each file, then the Edit tool (with `replace_all: true`) or Write tool to apply the replacements. Read each file before writing.
123
-
124
- After all replacements, re-scan the four key files from State Detection to verify zero placeholders remain. If any are still present, report them by file and fix immediately.
125
-
126
- ### Step 4: Populate CLAUDE.md Knowledge Sections
127
-
128
- **Idempotency check (MANDATORY before writing):** Read `CLAUDE.md` and check whether `{CLIENT_CONTEXT}` and `{USER_PREFERENCES}` are still literal placeholder strings. Only write if they are still placeholders. If either section is already filled in (user or a previous run already populated it), skip that section entirely — do not overwrite.
129
-
130
- **`{CLIENT_CONTEXT}`** -- replace with a single line (only if still a placeholder):
131
-
132
- ```markdown
133
- **{company name}** — {what they do, one sentence}
134
- ```
135
-
136
- **`{USER_PREFERENCES}`** -- replace with a table (only if still a placeholder):
137
-
138
- ```markdown
139
- | Name | Role | Technical Level | Communication |
140
- | ------ | ------ | --------------- | ------------- |
141
- | {name} | {role} | {level} | {preference} |
142
- ```
143
-
144
- If the user skipped any knowledge questions, fill in what was provided and omit what wasn't -- don't leave placeholder text behind.
145
-
146
- ### Step 5: Write Client Brief to Org Model
147
-
36
+
37
+ ```
38
+ This project is already configured. To update your organization profile, run /knowledge.
39
+ To re-verify the build, run the checks below.
40
+ ```
41
+
42
+ Offer to run the verification checks (Steps 6b–6e) if the user wants them. Do not re-ask any questions. Do not re-run placeholder replacement. Stop after verification.
43
+
44
+ ---
45
+
46
+ ## Full Bootstrap Flow (State A Only)
47
+
48
+ ### Step 1: Collect Project Info
49
+
50
+ Ask the user for three values:
51
+
52
+ 1. **Slug** — lowercase, hyphens only (e.g., `acme-dashboard`). Default to the basename of the current working directory.
53
+ 2. **Human-readable name** — used in titles, docs, and CLAUDE.md (e.g., `Acme Dashboard`).
54
+ 3. **Short description** — one sentence, used in `package.json` and CLAUDE.md (e.g., `Client dashboard for Acme Corp.`).
55
+
56
+ Confirm the values before proceeding:
57
+
58
+ ```
59
+ Configuring project with:
60
+ Slug: <slug>
61
+ Name: <name>
62
+ Description: <description>
63
+ Date: <YYYY-MM-DD>
64
+
65
+ Proceed? (yes/no)
66
+ ```
67
+
68
+ ### Step 2: Get to Know the User and Client
69
+
70
+ Transition naturally after confirming the project values: "Now let me learn a bit about you and the client so I can be more helpful going forward."
71
+
72
+ **About the user (ask conversationally, one at a time):**
73
+
74
+ 1. **Name** -- "What's your first name?"
75
+ 2. **Role** -- "What's your role?" (e.g., founder, developer, project lead)
76
+ 3. **Technical level** -- "How comfortable are you with technical stuff? No wrong answer -- just helps me know how to explain things."
77
+ 4. **Communication style** -- "When I explain things or write docs, do you prefer short and to-the-point, or more detailed with context?"
78
+
79
+ Use their name naturally from this point on.
80
+
81
+ **About the client/company this project is for:**
82
+
83
+ 5. **Company name** -- "Who's this project for? What's the company name?"
84
+ 6. **What they do** -- "What does {company} do? Just a sentence or two."
85
+ 7. **Industry** -- "What industry or space are they in?"
86
+ 8. **Key context** -- "Anything else that would help me understand the project context? Key stakeholders, business goals, important constraints -- whatever comes to mind. (Totally fine to skip, we can add this as we go.)"
87
+
88
+ React to what they share, ask natural follow-ups if something is interesting or unclear. Don't make it feel like a form.
89
+
90
+ After gathering, confirm:
91
+
92
+ ```
93
+ Got it! Here's what I captured:
94
+
95
+ User: {name} ({role}, {technical level}, prefers {style})
96
+
97
+ Client: {company}
98
+ {what they do}
99
+ Industry: {industry}
100
+ {any additional context}
101
+
102
+ Look good?
103
+ ```
104
+
105
+ ### Step 3: Replace Placeholders
106
+
107
+ Search ALL files in the project matching these extensions: `.ts`, `.tsx`, `.js`, `.mjs`, `.json`, `.md`, `.mdx`, `.html`, `.yaml`, `.yml`, `.css`, `.env.example`
108
+
109
+ Exclude these directories and files: `node_modules/`, `dist/`, `.tanstack/`, `pnpm-lock.yaml`
110
+
111
+ For each matching file, replace all occurrences of:
112
+
113
+ | Placeholder | Replace with |
114
+ | ------------------------------ | ----------------------- |
115
+ | `__PROJECT_NAME__` | human-readable name |
116
+ | `__PROJECT_SLUG__` | slug |
117
+ | `__PROJECT_DESCRIPTION__` | description |
118
+ | `__DATE__` | today's date YYYY-MM-DD |
119
+ | `TEMPLATE_PROJECT_NAME` | human-readable name |
120
+ | `TEMPLATE_PROJECT_DESCRIPTION` | description |
121
+
122
+ Use the Read tool to read each file, then the Edit tool (with `replace_all: true`) or Write tool to apply the replacements. Read each file before writing.
123
+
124
+ After all replacements, re-scan the four key files from State Detection to verify zero placeholders remain. If any are still present, report them by file and fix immediately.
125
+
126
+ ### Step 4: Populate CLAUDE.md Knowledge Sections
127
+
128
+ **Idempotency check (MANDATORY before writing):** Read `CLAUDE.md` and check whether `{CLIENT_CONTEXT}` and `{USER_PREFERENCES}` are still literal placeholder strings. Only write if they are still placeholders. If either section is already filled in (user or a previous run already populated it), skip that section entirely — do not overwrite.
129
+
130
+ **`{CLIENT_CONTEXT}`** -- replace with a single line (only if still a placeholder):
131
+
132
+ ```markdown
133
+ **{company name}** — {what they do, one sentence}
134
+ ```
135
+
136
+ **`{USER_PREFERENCES}`** -- replace with a table (only if still a placeholder):
137
+
138
+ ```markdown
139
+ | Name | Role | Technical Level | Communication |
140
+ | ------ | ------ | --------------- | ------------- |
141
+ | {name} | {role} | {level} | {preference} |
142
+ ```
143
+
144
+ If the user skipped any knowledge questions, fill in what was provided and omit what wasn't -- don't leave placeholder text behind.
145
+
146
+ ### Step 5: Write Client Brief to Org Model
147
+
148
148
  **Idempotency check:** Read `core/config/organization-model.ts` and inspect `identity.clientBrief`. If the field is already a non-empty string, skip this step entirely — do not overwrite.
149
-
150
- If the field is empty or absent, compose the client brief from the information gathered in Step 2:
151
-
152
- ```markdown
153
- **Company:** {company name}
154
- **Industry:** {industry}
155
- **Description:** {what they do}
156
-
157
- ## Additional Context
158
-
159
- {any additional context shared — key stakeholders, business goals, constraints, etc. If nothing was shared, write "No additional context provided yet. Update this as the project evolves."}
160
- ```
161
-
162
- Propose the composed content to the user before writing (read → propose → confirm → write — the same ceremony `/configure` uses):
163
-
164
- ```
165
- Here's the client brief I'll write into identity.clientBrief:
166
-
167
- ---
168
- {composed content}
169
- ---
170
-
171
- Write this? (yes/no)
172
- ```
173
-
149
+
150
+ If the field is empty or absent, compose the client brief from the information gathered in Step 2:
151
+
152
+ ```markdown
153
+ **Company:** {company name}
154
+ **Industry:** {industry}
155
+ **Description:** {what they do}
156
+
157
+ ## Additional Context
158
+
159
+ {any additional context shared — key stakeholders, business goals, constraints, etc. If nothing was shared, write "No additional context provided yet. Update this as the project evolves."}
160
+ ```
161
+
162
+ Propose the composed content to the user before writing (read → propose → confirm → write — the same ceremony `/knowledge` uses):
163
+
164
+ ```
165
+ Here's the client brief I'll write into identity.clientBrief:
166
+
167
+ ---
168
+ {composed content}
169
+ ---
170
+
171
+ Write this? (yes/no)
172
+ ```
173
+
174
174
  On confirmation, use the Edit tool to replace the `clientBrief: ''` value in `core/config/organization-model.ts` with a template literal containing the composed markdown. Use a regular string (backtick or single-quoted multi-line) — ensure the closing quote and trailing comma are correct TypeScript.
175
-
176
- After the edit, run:
177
-
178
- ```bash
175
+
176
+ After the edit, run:
177
+
178
+ ```bash
179
179
  pnpm -C core test
180
- ```
181
-
182
- If type-check fails, report the error and do not proceed to Step 6 until it is resolved.
183
-
184
- ### Step 6: Install and Verify
185
-
186
- #### Step 6a: Install Dependencies
187
-
188
- ```bash
189
- pnpm install
190
- ```
191
-
192
- This generates the project's own `pnpm-lock.yaml`. Report success or any errors.
193
-
194
- #### Step 6b–6e: Verify Build
195
-
196
- Run all checks sequentially (stop and report on first failure, but attempt all):
197
-
198
- ```bash
199
- pnpm -C ui check-types
200
- pnpm -C ui build
201
- pnpm -C operations check
202
- pnpm -C operations check-types
203
- ```
204
-
205
- For each check, record PASS or FAIL. If a check fails, read the output and report the error clearly. Do not silently skip failures.
206
-
207
- ### Step 7: Bootstrap Report
208
-
209
- ```
210
- You're all set, {name}!
211
- ========================
212
- Project: <Human Name>
213
- Slug: <slug>
214
- Client: <company name> (<industry>)
215
-
216
- Verification:
217
- [PASS/FAIL] Type-check (ui)
218
- [PASS/FAIL] Production build (ui)
219
- [PASS/FAIL] Resource validation (operations)
220
- [PASS/FAIL] Type-check (operations)
221
- ```
222
-
223
- If any verification step failed, add an Errors section listing each failure with its output.
224
-
225
- ### Step 8: Hand Off to /configure
226
-
227
- After a successful bootstrap, transition to the org-model configuration flow. Print:
228
-
229
- ```
230
- Bootstrap complete. Now let's set up your organization profile.
231
- ```
232
-
233
- Then execute `/configure` (the full layered flow, no argument). This is where identity, customers, offerings, roles, goals, and techStack are configured. Do not attempt to collect or write org-model data here — that ceremony belongs entirely to /configure.
234
-
235
- If the user wants to skip org-model setup for now, they can stop here and run `/configure` later.
236
-
237
- ---
238
-
239
- ## Error Recovery
240
-
241
- If placeholder replacement leaves stragglers:
242
-
243
- ```
244
- Placeholder Cleanup Required
245
- =============================
246
- Remaining: <list files and placeholders>
247
- Action: Re-applying replacements to affected files...
248
- ```
249
-
250
- Fix each remaining occurrence before proceeding to Step 6a.
251
-
252
- ---
253
-
254
- ## Idempotency Guarantees
255
-
256
- Running `/setup` more than once is safe:
257
-
258
- - **Placeholder replacement** only runs when placeholders are detected (State A). It is skipped entirely in States B and C.
259
- - **CLAUDE.md knowledge sections** (`{CLIENT_CONTEXT}`, `{USER_PREFERENCES}`) are checked before writing. If already replaced, the write is skipped.
260
- - **`identity.clientBrief`** is only written when the field is empty. A non-empty field is never overwritten by `/setup`. The write uses a read → propose → confirm ceremony before touching the file.
261
- - **All other org-model fields** (`core/config/organization-model.ts`) are never written by `/setup`. All other org-model edits go through `/configure`, which has its own diff-preview and confirm ceremony.
262
-
263
- ---
264
-
265
- ## Relationship to /configure
266
-
267
- `/setup` is a thin bootstrap wrapper. It:
268
-
269
- 1. Replaces scaffold placeholders (project name, slug, description)
270
- 2. Fills lightweight CLAUDE.md knowledge sections (user and client basics, idempotent)
271
- 3. Writes the client brief into `identity.clientBrief` in the org model (confirm-before-write, idempotent)
272
- 4. Installs dependencies and verifies the build
273
- 5. Hands off to `/configure` for full org-model configuration
274
-
275
- `/configure` owns all other structural org-model editing (identity fields beyond clientBrief, customers, offerings, roles, goals, techStack, features, labels). It is idempotent, confirm-before-overwrite, and includes a runtime validation gate. Re-run `/configure` any time organizational reality changes — no need to re-run `/setup`.
180
+ ```
181
+
182
+ If type-check fails, report the error and do not proceed to Step 6 until it is resolved.
183
+
184
+ ### Step 6: Install and Verify
185
+
186
+ #### Step 6a: Install Dependencies
187
+
188
+ ```bash
189
+ pnpm install
190
+ ```
191
+
192
+ This generates the project's own `pnpm-lock.yaml`. Report success or any errors.
193
+
194
+ #### Step 6b–6e: Verify Build
195
+
196
+ Run all checks sequentially (stop and report on first failure, but attempt all):
197
+
198
+ ```bash
199
+ pnpm -C ui check-types
200
+ pnpm -C ui build
201
+ pnpm -C operations check
202
+ pnpm -C operations check-types
203
+ ```
204
+
205
+ For each check, record PASS or FAIL. If a check fails, read the output and report the error clearly. Do not silently skip failures.
206
+
207
+ ### Step 7: Bootstrap Report
208
+
209
+ ```
210
+ You're all set, {name}!
211
+ ========================
212
+ Project: <Human Name>
213
+ Slug: <slug>
214
+ Client: <company name> (<industry>)
215
+
216
+ Verification:
217
+ [PASS/FAIL] Type-check (ui)
218
+ [PASS/FAIL] Production build (ui)
219
+ [PASS/FAIL] Resource validation (operations)
220
+ [PASS/FAIL] Type-check (operations)
221
+ ```
222
+
223
+ If any verification step failed, add an Errors section listing each failure with its output.
224
+
225
+ ### Step 8: Hand Off to /knowledge
226
+
227
+ After a successful bootstrap, transition to the org-model configuration flow. Print:
228
+
229
+ ```
230
+ Bootstrap complete. Now let's set up your organization profile.
231
+ ```
232
+
233
+ Then execute `/knowledge` (the full layered flow, no argument). This is where identity, customers, offerings, roles, goals, and techStack are configured. Do not attempt to collect or write org-model data here — that ceremony belongs entirely to /knowledge.
234
+
235
+ If the user wants to skip org-model setup for now, they can stop here and run `/knowledge` later.
236
+
237
+ ---
238
+
239
+ ## Error Recovery
240
+
241
+ If placeholder replacement leaves stragglers:
242
+
243
+ ```
244
+ Placeholder Cleanup Required
245
+ =============================
246
+ Remaining: <list files and placeholders>
247
+ Action: Re-applying replacements to affected files...
248
+ ```
249
+
250
+ Fix each remaining occurrence before proceeding to Step 6a.
251
+
252
+ ---
253
+
254
+ ## Idempotency Guarantees
255
+
256
+ Running `/setup` more than once is safe:
257
+
258
+ - **Placeholder replacement** only runs when placeholders are detected (State A). It is skipped entirely in States B and C.
259
+ - **CLAUDE.md knowledge sections** (`{CLIENT_CONTEXT}`, `{USER_PREFERENCES}`) are checked before writing. If already replaced, the write is skipped.
260
+ - **`identity.clientBrief`** is only written when the field is empty. A non-empty field is never overwritten by `/setup`. The write uses a read → propose → confirm ceremony before touching the file.
261
+ - **All other org-model fields** (`core/config/organization-model.ts`) are never written by `/setup`. All other org-model edits go through `/knowledge`, which has its own diff-preview and confirm ceremony.
262
+
263
+ ---
264
+
265
+ ## Relationship to /knowledge
266
+
267
+ `/setup` is a thin bootstrap wrapper. It:
268
+
269
+ 1. Replaces scaffold placeholders (project name, slug, description)
270
+ 2. Fills lightweight CLAUDE.md knowledge sections (user and client basics, idempotent)
271
+ 3. Writes the client brief into `identity.clientBrief` in the org model (confirm-before-write, idempotent)
272
+ 4. Installs dependencies and verifies the build
273
+ 5. Hands off to `/knowledge` for full org-model configuration
274
+
275
+ `/knowledge` owns all other structural org-model editing (identity fields beyond clientBrief, customers, offerings, roles, goals, techStack, features, labels). It is idempotent, confirm-before-overwrite, and includes a runtime validation gate. Re-run `/knowledge` any time organizational reality changes — no need to re-run `/setup`.