@elevasis/sdk 1.20.2 → 1.22.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 (164) hide show
  1. package/dist/cli.cjs +4220 -1583
  2. package/dist/index.d.ts +1035 -481
  3. package/dist/index.js +7381 -4187
  4. package/dist/node/index.d.ts +1 -3
  5. package/dist/node/index.js +40 -49
  6. package/dist/test-utils/index.d.ts +699 -123
  7. package/dist/test-utils/index.js +3826 -630
  8. package/dist/worker/index.js +3616 -442
  9. package/package.json +3 -3
  10. package/reference/_navigation.md +9 -7
  11. package/reference/_reference-manifest.json +1 -1
  12. package/reference/claude-config/hooks/post-edit-validate.mjs +98 -98
  13. package/reference/claude-config/hooks/scaffold-registry-reminder.mjs +188 -188
  14. package/reference/claude-config/hooks/tool-failure-recovery.mjs +73 -73
  15. package/reference/claude-config/registries/graph-skills.json +4 -4
  16. package/reference/claude-config/registries/knowledge-flags.json +0 -2
  17. package/reference/claude-config/rules/active-change-index.md +80 -80
  18. package/reference/claude-config/rules/agent-start-here.md +277 -273
  19. package/reference/claude-config/rules/deployment.md +57 -57
  20. package/reference/claude-config/rules/error-handling.md +56 -56
  21. package/reference/claude-config/rules/execution.md +40 -40
  22. package/reference/claude-config/rules/frontend.md +4 -4
  23. package/reference/claude-config/rules/observability.md +31 -31
  24. package/reference/claude-config/rules/operations.md +29 -17
  25. package/reference/claude-config/rules/organization-model.md +108 -40
  26. package/reference/claude-config/rules/organization-os.md +115 -113
  27. package/reference/claude-config/rules/package-taxonomy.md +33 -33
  28. package/reference/claude-config/rules/platform.md +42 -42
  29. package/reference/claude-config/rules/shared-types.md +49 -46
  30. package/reference/claude-config/rules/task-tracking.md +47 -47
  31. package/reference/claude-config/rules/ui.md +200 -200
  32. package/reference/claude-config/rules/vibe.md +235 -231
  33. package/reference/claude-config/scripts/statusline-command.js +18 -18
  34. package/reference/claude-config/settings.json +34 -34
  35. package/reference/claude-config/skills/deploy/{SKILL.md → skill.md} +156 -156
  36. package/reference/claude-config/skills/dsp/SKILL.md +66 -66
  37. package/reference/claude-config/skills/elevasis/SKILL.md +235 -235
  38. package/reference/claude-config/skills/explore/SKILL.md +6 -6
  39. package/reference/claude-config/skills/git-sync/SKILL.md +126 -126
  40. package/reference/claude-config/skills/knowledge/SKILL.md +330 -271
  41. package/reference/claude-config/skills/knowledge/operations/codify-level-a.md +100 -100
  42. package/reference/claude-config/skills/knowledge/operations/codify-level-b.md +159 -158
  43. package/reference/claude-config/skills/knowledge/operations/customers.md +109 -109
  44. package/reference/claude-config/skills/knowledge/operations/features.md +76 -113
  45. package/reference/claude-config/skills/knowledge/operations/goals.md +118 -118
  46. package/reference/claude-config/skills/knowledge/operations/identity.md +93 -93
  47. package/reference/claude-config/skills/knowledge/operations/labels.md +94 -89
  48. package/reference/claude-config/skills/knowledge/operations/offerings.md +109 -109
  49. package/reference/claude-config/skills/knowledge/operations/roles.md +99 -99
  50. package/reference/claude-config/skills/knowledge/operations/techStack.md +30 -30
  51. package/reference/claude-config/skills/project/SKILL.md +1088 -1088
  52. package/reference/claude-config/skills/run-ui/SKILL.md +73 -73
  53. package/reference/claude-config/skills/save/SKILL.md +3 -3
  54. package/reference/claude-config/skills/setup/SKILL.md +275 -275
  55. package/reference/claude-config/skills/status/SKILL.md +59 -59
  56. package/reference/claude-config/skills/submit-request/SKILL.md +180 -180
  57. package/reference/claude-config/skills/sync/SKILL.md +47 -47
  58. package/reference/claude-config/skills/tutorial/SKILL.md +259 -259
  59. package/reference/claude-config/skills/tutorial/progress-template.md +74 -74
  60. package/reference/claude-config/skills/tutorial/technical.md +1303 -1306
  61. package/reference/claude-config/skills/tutorial/vibe-coder.md +890 -890
  62. package/reference/claude-config/sync-notes/2026-04-22-git-sync-and-sync-notes.md +27 -27
  63. package/reference/claude-config/sync-notes/2026-04-22-lead-gen-deliverability-removal.md +30 -30
  64. package/reference/claude-config/sync-notes/2026-04-24-test-utils-and-template-tests.md +73 -73
  65. package/reference/claude-config/sync-notes/2026-04-24-ui-consolidation-and-sdk-cli-train.md +86 -86
  66. package/reference/claude-config/sync-notes/2026-04-25-auth-role-system-and-settings-roles.md +55 -55
  67. package/reference/claude-config/sync-notes/2026-04-27-crm-hitl-action-layer-cutover.md +97 -97
  68. package/reference/claude-config/sync-notes/2026-04-27-lead-gen-substrate-train.md +112 -112
  69. package/reference/claude-config/sync-notes/2026-04-29-crm-state-and-lead-gen-processing-status.md +93 -93
  70. package/reference/claude-config/sync-notes/2026-05-02-crm-ownership-next-action.md +58 -58
  71. package/reference/claude-config/sync-notes/2026-05-02-template-hardcode-workos-config.md +56 -56
  72. package/reference/claude-config/sync-notes/2026-05-04-elevasis-workspace.md +71 -71
  73. package/reference/claude-config/sync-notes/2026-05-04-knowledge-bundle.md +83 -83
  74. package/reference/claude-config/sync-notes/2026-05-04-template-skills-run-ui-and-tutorial.md +59 -59
  75. package/reference/claude-config/sync-notes/2026-05-05-list-builder.md +42 -42
  76. package/reference/claude-config/sync-notes/2026-05-06-crm-spine.md +60 -60
  77. package/reference/claude-config/sync-notes/2026-05-06-sdk-changes-release-train.md +37 -37
  78. package/reference/claude-config/sync-notes/2026-05-07-sdk-changes-release-train.md +34 -34
  79. package/reference/claude-config/sync-notes/2026-05-08-resource-governance-scaffold-guidance.md +38 -38
  80. package/reference/claude-config/sync-notes/2026-05-09-clients-domain.md +32 -32
  81. package/reference/claude-config/sync-notes/2026-05-09-command-system.md +33 -33
  82. package/reference/claude-config/sync-notes/2026-05-09-resource-governance-and-misc.md +69 -69
  83. package/reference/claude-config/sync-notes/2026-05-12-sdk-ready-release-train.md +30 -0
  84. package/reference/claude-config/sync-notes/2026-05-14-organization-model-ontology-refactor.md +42 -0
  85. package/reference/claude-config/sync-notes/README.md +43 -43
  86. package/reference/cli.mdx +808 -668
  87. package/reference/concepts.mdx +146 -146
  88. package/reference/deployment/api.mdx +297 -297
  89. package/reference/deployment/command-center.mdx +209 -209
  90. package/reference/deployment/index.mdx +195 -195
  91. package/reference/deployment/provided-features.mdx +107 -93
  92. package/reference/deployment/ui-execution.mdx +250 -250
  93. package/reference/examples/organization-model.ts +147 -84
  94. package/reference/framework/agent.mdx +156 -156
  95. package/reference/framework/index.mdx +195 -195
  96. package/reference/framework/interaction-guidance.mdx +182 -182
  97. package/reference/framework/memory.mdx +326 -326
  98. package/reference/framework/project-structure.mdx +282 -282
  99. package/reference/framework/tutorial-system.mdx +135 -135
  100. package/reference/getting-started.mdx +142 -142
  101. package/reference/index.mdx +106 -106
  102. package/reference/packages/core/src/README.md +14 -14
  103. package/reference/packages/core/src/business/README.md +2 -2
  104. package/reference/packages/core/src/knowledge/README.md +33 -32
  105. package/reference/packages/core/src/organization-model/README.md +149 -109
  106. package/reference/packages/core/src/test-utils/README.md +37 -37
  107. package/reference/packages/ui/src/api/README.md +18 -18
  108. package/reference/packages/ui/src/app/README.md +24 -24
  109. package/reference/packages/ui/src/auth/README.md +18 -18
  110. package/reference/packages/ui/src/components/README.md +24 -24
  111. package/reference/packages/ui/src/execution/README.md +16 -16
  112. package/reference/packages/ui/src/features/README.md +28 -28
  113. package/reference/packages/ui/src/graph/README.md +16 -16
  114. package/reference/packages/ui/src/hooks/README.md +23 -23
  115. package/reference/packages/ui/src/initialization/README.md +19 -19
  116. package/reference/packages/ui/src/knowledge/README.md +31 -31
  117. package/reference/packages/ui/src/organization/README.md +18 -18
  118. package/reference/packages/ui/src/profile/README.md +19 -19
  119. package/reference/packages/ui/src/provider/README.md +32 -32
  120. package/reference/packages/ui/src/router/README.md +18 -18
  121. package/reference/packages/ui/src/sse/README.md +13 -13
  122. package/reference/packages/ui/src/test-utils/README.md +7 -7
  123. package/reference/packages/ui/src/theme/README.md +23 -23
  124. package/reference/packages/ui/src/theme/presets/README.md +19 -19
  125. package/reference/packages/ui/src/types/README.md +16 -16
  126. package/reference/packages/ui/src/utils/README.md +18 -18
  127. package/reference/packages/ui/src/zustand/README.md +18 -18
  128. package/reference/platform-tools/adapters-integration.mdx +301 -301
  129. package/reference/platform-tools/adapters-platform.mdx +553 -553
  130. package/reference/platform-tools/index.mdx +217 -217
  131. package/reference/platform-tools/type-safety.mdx +82 -82
  132. package/reference/resources/index.mdx +349 -349
  133. package/reference/resources/patterns.mdx +449 -449
  134. package/reference/resources/types.mdx +116 -116
  135. package/reference/roadmap.mdx +165 -165
  136. package/reference/runtime.mdx +173 -173
  137. package/reference/scaffold/core/organization-graph.mdx +110 -89
  138. package/reference/scaffold/core/organization-model.mdx +226 -171
  139. package/reference/scaffold/index.mdx +67 -67
  140. package/reference/scaffold/operations/propagation-pipeline.md +77 -77
  141. package/reference/scaffold/operations/scaffold-maintenance.md +10 -10
  142. package/reference/scaffold/operations/workflow-recipes.md +138 -138
  143. package/reference/scaffold/recipes/add-a-feature.md +310 -88
  144. package/reference/scaffold/recipes/add-a-resource.md +137 -117
  145. package/reference/scaffold/recipes/customize-crm-actions.md +439 -439
  146. package/reference/scaffold/recipes/customize-knowledge-browser.md +384 -0
  147. package/reference/scaffold/recipes/customize-organization-model.md +281 -118
  148. package/reference/scaffold/recipes/extend-a-base-entity.md +8 -8
  149. package/reference/scaffold/recipes/extend-crm.md +40 -39
  150. package/reference/scaffold/recipes/extend-lead-gen.md +400 -401
  151. package/reference/scaffold/recipes/gate-by-feature-or-admin.md +118 -114
  152. package/reference/scaffold/recipes/index.md +47 -46
  153. package/reference/scaffold/recipes/query-the-knowledge-graph.md +227 -0
  154. package/reference/scaffold/reference/contracts.md +2389 -2121
  155. package/reference/scaffold/reference/feature-registry.md +9 -20
  156. package/reference/scaffold/reference/glossary.md +76 -76
  157. package/reference/scaffold/ui/composition-extensibility.mdx +233 -233
  158. package/reference/scaffold/ui/customization.md +243 -243
  159. package/reference/scaffold/ui/feature-flags-and-gating.md +46 -46
  160. package/reference/scaffold/ui/feature-shell.mdx +72 -72
  161. package/reference/scaffold/ui/recipes.md +221 -213
  162. package/reference/spine/spine-primer.md +96 -96
  163. package/reference/templates/index.mdx +47 -47
  164. package/reference/troubleshooting.mdx +223 -223
@@ -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 /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
- **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 /knowledge to set up your organization profile...
31
- ```
32
-
33
- Then execute `/knowledge` (the full layered flow) and stop.
34
-
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 /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
- **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 `/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
- 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
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 /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`.
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
+ **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 /knowledge to set up your organization profile...
31
+ ```
32
+
33
+ Then execute `/knowledge` (the full layered flow) and stop.
34
+
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 /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
+ **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 `/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
+ 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
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 /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, systems, actions, labels, and legacy feature compatibility). 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`.
@@ -1,59 +1,59 @@
1
- ---
2
- name: status
3
- description: Quick project health check
4
- ---
5
-
6
- # Status
7
-
8
- Quick project health check.
9
-
10
- **Usage:** `/status`
11
-
12
- ## Process
13
-
14
- ### Step 1: Gather Data
15
-
16
- Run in parallel:
17
-
18
- 1. `git status` - working tree state
19
- 2. `git log --oneline -5` - recent commits
20
- 3. `pnpm test` - test results
21
- 4. `pnpm lint` - type check
22
-
23
- ### Step 2: Check Active Work
24
-
25
- 1. Query active project work via `pnpm elevasis-sdk project:list --status active --pretty` and `pnpm elevasis-sdk project:list --status blocked --pretty` - active project/task count lives in the DB
26
-
27
- ### Step 3: Report
28
-
29
- ```
30
- Project Status
31
- ==============
32
-
33
- Git
34
- ---
35
- Branch: <branch>
36
- Clean: Yes/No (N uncommitted changes)
37
- Last commit: <hash> - <message> (<date>)
38
-
39
- Tests
40
- -----
41
- Result: All passing / N failures
42
- Details: [if failures, list them]
43
-
44
- Types
45
- -----
46
- Result: Clean / N errors
47
- Details: [if errors, list them]
48
-
49
- Docs
50
- ----
51
- Architecture: N docs
52
- Features: N docs
53
-
54
- Active Work (DB)
55
- ----------------
56
- Projects: N active, N blocked
57
- - [client 1] (status)
58
- - [client 2] (status)
59
- ```
1
+ ---
2
+ name: status
3
+ description: Quick project health check
4
+ ---
5
+
6
+ # Status
7
+
8
+ Quick project health check.
9
+
10
+ **Usage:** `/status`
11
+
12
+ ## Process
13
+
14
+ ### Step 1: Gather Data
15
+
16
+ Run in parallel:
17
+
18
+ 1. `git status` - working tree state
19
+ 2. `git log --oneline -5` - recent commits
20
+ 3. `pnpm test` - test results
21
+ 4. `pnpm lint` - type check
22
+
23
+ ### Step 2: Check Active Work
24
+
25
+ 1. Query active project work via `pnpm elevasis-sdk project:list --status active --pretty` and `pnpm elevasis-sdk project:list --status blocked --pretty` - active project/task count lives in the DB
26
+
27
+ ### Step 3: Report
28
+
29
+ ```
30
+ Project Status
31
+ ==============
32
+
33
+ Git
34
+ ---
35
+ Branch: <branch>
36
+ Clean: Yes/No (N uncommitted changes)
37
+ Last commit: <hash> - <message> (<date>)
38
+
39
+ Tests
40
+ -----
41
+ Result: All passing / N failures
42
+ Details: [if failures, list them]
43
+
44
+ Types
45
+ -----
46
+ Result: Clean / N errors
47
+ Details: [if errors, list them]
48
+
49
+ Docs
50
+ ----
51
+ Architecture: N docs
52
+ Features: N docs
53
+
54
+ Active Work (DB)
55
+ ----------------
56
+ Projects: N active, N blocked
57
+ - [client 1] (status)
58
+ - [client 2] (status)
59
+ ```