@elevasis/sdk 1.44.3 → 1.46.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 (259) hide show
  1. package/dist/cli.cjs +35026 -30226
  2. package/dist/index.d.ts +1786 -808
  3. package/dist/index.js +789 -739
  4. package/dist/node/index.d.ts +105 -181
  5. package/dist/node/index.js +2 -2
  6. package/dist/test-utils/index.d.ts +901 -359
  7. package/dist/test-utils/index.js +587 -824
  8. package/dist/worker/index.d.ts +12685 -0
  9. package/dist/worker/index.js +188 -216
  10. package/package.json +4 -7
  11. package/reference/_navigation.md +161 -22
  12. package/reference/_reference-manifest.json +228 -4
  13. package/reference/claude-config.md +8 -0
  14. package/reference/core/exports.mdx +2 -0
  15. package/reference/core/index.mdx +3 -3
  16. package/reference/examples/organization-model.ts +117 -111
  17. package/reference/index.mdx +4 -4
  18. package/reference/packages/core/src/business/README.md +4 -1
  19. package/reference/packages/core/src/content/README.md +19 -0
  20. package/reference/packages/core/src/organization-model/README.md +148 -149
  21. package/reference/packages/core/src/organization-model/readiness/README.md +42 -0
  22. package/reference/packages/ui/src/features/README.md +28 -28
  23. package/reference/rules/active-change-index.md +40 -54
  24. package/reference/rules/agent-runtime.md +81 -0
  25. package/reference/rules/agent-start-here.md +71 -163
  26. package/reference/rules/deployment.md +33 -10
  27. package/reference/rules/error-handling.md +26 -0
  28. package/reference/rules/execution.md +13 -0
  29. package/reference/rules/frontend.md +10 -3
  30. package/reference/rules/observability.md +9 -1
  31. package/reference/rules/operations.md +26 -17
  32. package/reference/rules/organization-model.md +74 -88
  33. package/reference/rules/organization-os.md +71 -88
  34. package/reference/rules/package-taxonomy.md +11 -2
  35. package/reference/rules/platform.md +13 -7
  36. package/reference/rules/shared-types.md +36 -0
  37. package/reference/rules/task-tracking.md +30 -5
  38. package/reference/rules/ui.md +145 -3
  39. package/reference/rules/vibe-intents.md +271 -0
  40. package/reference/rules/vibe.md +17 -243
  41. package/reference/scaffold/core/organization-graph.mdx +112 -99
  42. package/reference/scaffold/core/organization-model.mdx +231 -215
  43. package/reference/scaffold/operations/propagation-pipeline.md +16 -17
  44. package/reference/scaffold/operations/scaffold-maintenance.md +22 -20
  45. package/reference/scaffold/operations/workflow-recipes.md +72 -20
  46. package/reference/scaffold/recipes/add-a-feature.md +156 -146
  47. package/reference/scaffold/recipes/add-a-resource.md +123 -117
  48. package/reference/scaffold/recipes/customize-crm-actions.md +28 -13
  49. package/reference/scaffold/recipes/customize-knowledge-browser.md +52 -117
  50. package/reference/scaffold/recipes/customize-organization-model.md +161 -149
  51. package/reference/scaffold/recipes/extend-a-base-entity.md +156 -140
  52. package/reference/scaffold/recipes/extend-content.md +265 -0
  53. package/reference/scaffold/recipes/extend-crm.md +16 -11
  54. package/reference/scaffold/recipes/extend-lead-gen.md +37 -21
  55. package/reference/scaffold/recipes/gate-by-feature-or-admin.md +160 -118
  56. package/reference/scaffold/recipes/index.md +6 -3
  57. package/reference/scaffold/recipes/query-the-knowledge-graph.md +23 -23
  58. package/reference/scaffold/reference/contracts.md +30 -56
  59. package/reference/scaffold/reference/feature-registry.md +3 -0
  60. package/reference/scaffold/reference/glossary.md +4 -4
  61. package/reference/scaffold/reference/system-interface-capabilities.md +5 -4
  62. package/reference/scaffold/ui/composition-extensibility.mdx +271 -232
  63. package/reference/scaffold/ui/customization.md +2 -2
  64. package/reference/scaffold/ui/feature-flags-and-gating.md +14 -6
  65. package/reference/scaffold/ui/feature-shell.mdx +277 -62
  66. package/reference/scaffold/ui/recipes.md +229 -197
  67. package/reference/sdk/cli-management.mdx +166 -33
  68. package/reference/sdk/cli.mdx +90 -13
  69. package/reference/sdk/concepts.mdx +2 -0
  70. package/reference/sdk/define-builders.mdx +76 -0
  71. package/reference/sdk/deployment/command-center.mdx +6 -2
  72. package/reference/sdk/deployment/execution-reference.mdx +64 -186
  73. package/reference/sdk/deployment/index.mdx +2 -0
  74. package/reference/sdk/exports.mdx +4 -4
  75. package/reference/sdk/framework/agent.mdx +52 -116
  76. package/reference/sdk/framework/index.mdx +46 -65
  77. package/reference/sdk/framework/project-structure.mdx +150 -205
  78. package/reference/sdk/framework/tutorial-system.mdx +2 -2
  79. package/reference/sdk/human-in-the-loop.mdx +152 -0
  80. package/reference/sdk/index.mdx +6 -7
  81. package/reference/sdk/platform-tools/adapters-platform.mdx +3 -1
  82. package/reference/sdk/platform-tools/index.mdx +12 -0
  83. package/reference/sdk/platform-tools/type-safety.mdx +4 -0
  84. package/reference/sdk/project-deployment-spec.mdx +131 -0
  85. package/reference/sdk/resources/index.mdx +21 -7
  86. package/reference/sdk/resources/patterns.mdx +54 -24
  87. package/reference/sdk/resources/types.mdx +7 -4
  88. package/reference/sdk/templates/data-enrichment.mdx +7 -3
  89. package/reference/sdk/templates/email-sender.mdx +139 -135
  90. package/reference/sdk/templates/lead-scorer.mdx +5 -1
  91. package/reference/sdk/templates/pdf-generator.mdx +155 -151
  92. package/reference/sdk/templates/recurring-job.mdx +195 -189
  93. package/reference/sdk/templates/text-classifier.mdx +4 -0
  94. package/reference/sdk/templates/web-scraper.mdx +139 -135
  95. package/reference/spine/spine-primer.md +135 -96
  96. package/reference/ui/exports.mdx +1 -0
  97. package/reference/ui/index.mdx +14 -7
  98. package/dist/types/worker/adapters/anymailfinder.d.ts +0 -14
  99. package/dist/types/worker/adapters/apify.d.ts +0 -14
  100. package/dist/types/worker/adapters/approval.d.ts +0 -23
  101. package/dist/types/worker/adapters/attio.d.ts +0 -22
  102. package/dist/types/worker/adapters/clickup.d.ts +0 -22
  103. package/dist/types/worker/adapters/create-adapter.d.ts +0 -41
  104. package/dist/types/worker/adapters/crm.d.ts +0 -20
  105. package/dist/types/worker/adapters/dropbox.d.ts +0 -14
  106. package/dist/types/worker/adapters/email.d.ts +0 -25
  107. package/dist/types/worker/adapters/execution.d.ts +0 -22
  108. package/dist/types/worker/adapters/gmail.d.ts +0 -14
  109. package/dist/types/worker/adapters/google-sheets.d.ts +0 -14
  110. package/dist/types/worker/adapters/index.d.ts +0 -33
  111. package/dist/types/worker/adapters/instantly.d.ts +0 -14
  112. package/dist/types/worker/adapters/lead.d.ts +0 -28
  113. package/dist/types/worker/adapters/list.d.ts +0 -9
  114. package/dist/types/worker/adapters/llm.d.ts +0 -45
  115. package/dist/types/worker/adapters/millionverifier.d.ts +0 -14
  116. package/dist/types/worker/adapters/notification.d.ts +0 -28
  117. package/dist/types/worker/adapters/pdf.d.ts +0 -22
  118. package/dist/types/worker/adapters/projects.d.ts +0 -20
  119. package/dist/types/worker/adapters/resend.d.ts +0 -14
  120. package/dist/types/worker/adapters/scheduler.d.ts +0 -25
  121. package/dist/types/worker/adapters/signature-api.d.ts +0 -14
  122. package/dist/types/worker/adapters/storage.d.ts +0 -33
  123. package/dist/types/worker/adapters/stripe.d.ts +0 -14
  124. package/dist/types/worker/adapters/tomba.d.ts +0 -14
  125. package/dist/types/worker/index.d.ts +0 -60
  126. package/dist/types/worker/platform.d.ts +0 -90
  127. package/dist/types/worker/utils.d.ts +0 -9
  128. package/reference/claude-config/Overview.md +0 -230
  129. package/reference/claude-config/hooks/post-edit-validate.mjs +0 -98
  130. package/reference/claude-config/hooks/scaffold-registry-reminder.mjs +0 -187
  131. package/reference/claude-config/hooks/tool-failure-recovery.mjs +0 -73
  132. package/reference/claude-config/registries/graph-skills.json +0 -4
  133. package/reference/claude-config/registries/knowledge-flags.json +0 -154
  134. package/reference/claude-config/registries/skill-coverage.json +0 -20
  135. package/reference/claude-config/rules/active-change-index.md +0 -22
  136. package/reference/claude-config/rules/agent-start-here.md +0 -22
  137. package/reference/claude-config/rules/deployment.md +0 -22
  138. package/reference/claude-config/rules/error-handling.md +0 -22
  139. package/reference/claude-config/rules/execution.md +0 -22
  140. package/reference/claude-config/rules/frontend.md +0 -22
  141. package/reference/claude-config/rules/observability.md +0 -22
  142. package/reference/claude-config/rules/operations.md +0 -22
  143. package/reference/claude-config/rules/organization-model.md +0 -22
  144. package/reference/claude-config/rules/organization-os.md +0 -22
  145. package/reference/claude-config/rules/package-taxonomy.md +0 -22
  146. package/reference/claude-config/rules/platform.md +0 -22
  147. package/reference/claude-config/rules/shared-types.md +0 -22
  148. package/reference/claude-config/rules/task-tracking.md +0 -22
  149. package/reference/claude-config/rules/topbar-actions.md +0 -70
  150. package/reference/claude-config/rules/ui.md +0 -22
  151. package/reference/claude-config/rules/vibe.md +0 -22
  152. package/reference/claude-config/scripts/statusline-command.js +0 -18
  153. package/reference/claude-config/settings.json +0 -30
  154. package/reference/claude-config/skills/client/SKILL.md +0 -201
  155. package/reference/claude-config/skills/deploy/SKILL.md +0 -159
  156. package/reference/claude-config/skills/dsp/SKILL.md +0 -66
  157. package/reference/claude-config/skills/elevasis/SKILL.md +0 -251
  158. package/reference/claude-config/skills/explore/SKILL.md +0 -78
  159. package/reference/claude-config/skills/git-sync/SKILL.md +0 -166
  160. package/reference/claude-config/skills/om/SKILL.md +0 -475
  161. package/reference/claude-config/skills/om/operations/build.md +0 -237
  162. package/reference/claude-config/skills/om/operations/codify-level-a.md +0 -109
  163. package/reference/claude-config/skills/om/operations/codify-level-b.md +0 -159
  164. package/reference/claude-config/skills/om/operations/customers.md +0 -114
  165. package/reference/claude-config/skills/om/operations/features.md +0 -88
  166. package/reference/claude-config/skills/om/operations/goals.md +0 -123
  167. package/reference/claude-config/skills/om/operations/identity.md +0 -97
  168. package/reference/claude-config/skills/om/operations/labels.md +0 -110
  169. package/reference/claude-config/skills/om/operations/offerings.md +0 -114
  170. package/reference/claude-config/skills/om/operations/roles.md +0 -104
  171. package/reference/claude-config/skills/om/operations/scaffold.md +0 -163
  172. package/reference/claude-config/skills/om/operations/techStack.md +0 -38
  173. package/reference/claude-config/skills/project/SKILL.md +0 -1114
  174. package/reference/claude-config/skills/run-ui/SKILL.md +0 -73
  175. package/reference/claude-config/skills/save/SKILL.md +0 -183
  176. package/reference/claude-config/skills/setup/SKILL.md +0 -290
  177. package/reference/claude-config/skills/status/SKILL.md +0 -59
  178. package/reference/claude-config/skills/submit-request/SKILL.md +0 -180
  179. package/reference/claude-config/skills/sync/SKILL.md +0 -47
  180. package/reference/claude-config/skills/tutorial/SKILL.md +0 -259
  181. package/reference/claude-config/skills/tutorial/progress-template.md +0 -74
  182. package/reference/claude-config/skills/tutorial/technical.md +0 -1303
  183. package/reference/claude-config/skills/tutorial/vibe-coder.md +0 -890
  184. package/reference/claude-config/sync-notes/2026-04-22-git-sync-and-sync-notes.md +0 -27
  185. package/reference/claude-config/sync-notes/2026-04-22-lead-gen-deliverability-removal.md +0 -30
  186. package/reference/claude-config/sync-notes/2026-04-24-test-utils-and-template-tests.md +0 -73
  187. package/reference/claude-config/sync-notes/2026-04-24-ui-consolidation-and-sdk-cli-train.md +0 -86
  188. package/reference/claude-config/sync-notes/2026-04-25-auth-role-system-and-settings-roles.md +0 -55
  189. package/reference/claude-config/sync-notes/2026-04-27-crm-hitl-action-layer-cutover.md +0 -97
  190. package/reference/claude-config/sync-notes/2026-04-27-lead-gen-substrate-train.md +0 -112
  191. package/reference/claude-config/sync-notes/2026-04-29-crm-state-and-lead-gen-processing-status.md +0 -93
  192. package/reference/claude-config/sync-notes/2026-05-02-crm-ownership-next-action.md +0 -58
  193. package/reference/claude-config/sync-notes/2026-05-02-template-hardcode-workos-config.md +0 -56
  194. package/reference/claude-config/sync-notes/2026-05-04-elevasis-workspace.md +0 -71
  195. package/reference/claude-config/sync-notes/2026-05-04-knowledge-bundle.md +0 -83
  196. package/reference/claude-config/sync-notes/2026-05-04-template-skills-run-ui-and-tutorial.md +0 -59
  197. package/reference/claude-config/sync-notes/2026-05-05-list-builder.md +0 -42
  198. package/reference/claude-config/sync-notes/2026-05-06-crm-spine.md +0 -60
  199. package/reference/claude-config/sync-notes/2026-05-06-sdk-changes-release-train.md +0 -37
  200. package/reference/claude-config/sync-notes/2026-05-07-sdk-changes-release-train.md +0 -34
  201. package/reference/claude-config/sync-notes/2026-05-08-resource-governance-scaffold-guidance.md +0 -38
  202. package/reference/claude-config/sync-notes/2026-05-09-clients-domain.md +0 -32
  203. package/reference/claude-config/sync-notes/2026-05-09-command-system.md +0 -33
  204. package/reference/claude-config/sync-notes/2026-05-09-resource-governance-and-misc.md +0 -69
  205. package/reference/claude-config/sync-notes/2026-05-12-sdk-ready-release-train.md +0 -30
  206. package/reference/claude-config/sync-notes/2026-05-14-organization-model-ontology-refactor.md +0 -45
  207. package/reference/claude-config/sync-notes/2026-05-15-om-skill-rename-and-write-family.md +0 -52
  208. package/reference/claude-config/sync-notes/2026-05-17-sdk-boundary-consolidation.md +0 -33
  209. package/reference/claude-config/sync-notes/2026-05-20-om-define-helpers.md +0 -32
  210. package/reference/claude-config/sync-notes/2026-05-22-access-model-and-right-panel.md +0 -43
  211. package/reference/claude-config/sync-notes/2026-05-22-lead-gen-tenant-config.md +0 -40
  212. package/reference/claude-config/sync-notes/2026-05-22-org-model-multi-file-split.md +0 -61
  213. package/reference/claude-config/sync-notes/2026-05-23-branding-names-to-identity.md +0 -49
  214. package/reference/claude-config/sync-notes/2026-05-23-lead-gen-manage-access.md +0 -31
  215. package/reference/claude-config/sync-notes/2026-05-23-om-deployment-drift-detection.md +0 -42
  216. package/reference/claude-config/sync-notes/2026-05-23-om-full-model-deploy-contract.md +0 -33
  217. package/reference/claude-config/sync-notes/2026-05-23-ui-sdk-package-fixes.md +0 -37
  218. package/reference/claude-config/sync-notes/2026-05-24-platform-invite-router-core-baseline.md +0 -28
  219. package/reference/claude-config/sync-notes/2026-05-24-system-interface-readiness.md +0 -43
  220. package/reference/claude-config/sync-notes/2026-05-25-invitation-login-loader.md +0 -26
  221. package/reference/claude-config/sync-notes/2026-05-25-om-topbar-requests.md +0 -33
  222. package/reference/claude-config/sync-notes/2026-05-25-system-interface-profile-registry-and-substrate.md +0 -35
  223. package/reference/claude-config/sync-notes/2026-05-25-tenant-om-scaffold-cli.md +0 -49
  224. package/reference/claude-config/sync-notes/2026-05-25-vibe-operate-intent.md +0 -47
  225. package/reference/claude-config/sync-notes/2026-05-28-om-snapshot-sdk-workflow-config.md +0 -33
  226. package/reference/claude-config/sync-notes/2026-05-30-client-source-and-om-profiles.md +0 -39
  227. package/reference/claude-config/sync-notes/2026-06-02-knowledge-nested-group-routing.md +0 -27
  228. package/reference/claude-config/sync-notes/2026-06-02-nest-projects-under-platform.md +0 -45
  229. package/reference/claude-config/sync-notes/2026-06-03-skill-autogen-and-client-skill.md +0 -34
  230. package/reference/claude-config/sync-notes/2026-06-04-scaffold-registry-lane-severity.md +0 -34
  231. package/reference/claude-config/sync-notes/2026-06-05-appearance-app-mode-decouple.md +0 -29
  232. package/reference/claude-config/sync-notes/2026-06-05-ontology-endpoint-rename-and-knowledge-browser-ui.md +0 -86
  233. package/reference/claude-config/sync-notes/2026-06-06-om-build-systems-scaffold.md +0 -47
  234. package/reference/claude-config/sync-notes/2026-06-06-om-item-copy-references.md +0 -50
  235. package/reference/claude-config/sync-notes/2026-06-08-knowledge-base-page-not-found-fix.md +0 -76
  236. package/reference/claude-config/sync-notes/2026-06-09-agent-sessions-public-agent-chat-route.md +0 -75
  237. package/reference/claude-config/sync-notes/2026-06-09-sdk-cli-load-org-model-resolution.md +0 -42
  238. package/reference/claude-config/sync-notes/2026-06-12-agent-grants-visualizer-operations.md +0 -30
  239. package/reference/claude-config/sync-notes/2026-06-14-session-ux-and-project-cli-json.md +0 -33
  240. package/reference/claude-config/sync-notes/2026-06-14-shared-session-conversation-view.md +0 -26
  241. package/reference/claude-config/sync-notes/2026-06-15-session-chat-zero-wiring.md +0 -46
  242. package/reference/claude-config/sync-notes/2026-06-17-agent-session-ux-features.md +0 -34
  243. package/reference/claude-config/sync-notes/2026-06-25-shared-page-scroll-contract-guard.md +0 -52
  244. package/reference/claude-config/sync-notes/2026-06-26-leadgen-overview-om-telemetry.md +0 -47
  245. package/reference/claude-config/sync-notes/2026-07-21-agent-scaffold-hardening.md +0 -75
  246. package/reference/claude-config/sync-notes/2026-07-23-agent-session-memory.md +0 -49
  247. package/reference/claude-config/sync-notes/2026-07-23-workos-org-marker.md +0 -50
  248. package/reference/claude-config/sync-notes/2026-07-24-claude-5-models-and-session-surface-fixes.md +0 -116
  249. package/reference/claude-config/sync-notes/2026-07-27-agent-strict-output-and-turn-drift.md +0 -73
  250. package/reference/claude-config/sync-notes/2026-07-28-agent-reply-is-its-own-field.md +0 -84
  251. package/reference/claude-config/sync-notes/2026-07-30-login-screen-and-member-provisioning-state.md +0 -114
  252. package/reference/claude-config/sync-notes/2026-08-02-auth-guard-defaults-and-truncation-fix.md +0 -122
  253. package/reference/claude-config/sync-notes/2026-08-03-agent-prose-escape-normalization.md +0 -88
  254. package/reference/claude-config/sync-notes/2026-08-03-cli-gateway-errors-and-request-timeout.md +0 -120
  255. package/reference/claude-config/sync-notes/README.md +0 -43
  256. package/reference/sdk/framework/interaction-guidance.mdx +0 -182
  257. package/reference/sdk/framework/memory.mdx +0 -326
  258. package/reference/sdk/framework/resource-documentation.mdx +0 -90
  259. package/reference/sdk/roadmap.mdx +0 -164
@@ -11,93 +11,52 @@ Read this file first when entering a freshly scaffolded project.
11
11
 
12
12
  ## Project Profile
13
13
 
14
- Before doing anything else, check for `.claude/memory/profile.md`. It is created by `/tutorial` on first invocation and persists across sessions.
14
+ Before doing anything else, check for `.claude/memory/profile.md`. It is created by `/tutorial` on first invocation and persists across sessions. If present, read it: it declares the active onboarding **track** and ships a tone block.
15
15
 
16
- If present, read it. The file declares which onboarding **track** is active -- `vibe-coder` (non-technical user, agent does the work) or `technical` (developer, code-first) -- and ships a tone block describing how to communicate.
16
+ Apply that tone block to ALL agent output for the rest of the session, not just inside `/tutorial`:
17
17
 
18
- Apply the tone block to ALL agent output for the rest of the session, not just inside `/tutorial`:
19
-
20
- - **vibe-coder track:** never use technical vocabulary in user-facing dialogue (workflow -> automation, deploy -> make it live, schema -> "the information your automation needs"). Tool calls are made silently -- do not narrate slash commands, file paths, or build steps. The full swap table lives in `profile.md`.
21
- - **technical track:** code-first, current command surface, real file paths. The user reads diffs and stacktraces; do not over-explain.
18
+ - **vibe-coder track** (non-technical user, agent does the work) -- never use technical vocabulary in user-facing dialogue (workflow -> automation, deploy -> make it live, schema -> "the information your automation needs"). Make tool calls silently: do not narrate slash commands, file paths, or build steps. The full swap table lives in `profile.md`.
19
+ - **technical track** (developer, code-first) -- current command surface, real file paths. The user reads diffs and stacktraces; do not over-explain.
22
20
 
23
21
  If the file does not exist, the user has not run `/tutorial` yet. Proceed normally and note that running `/tutorial` would establish a project tone for future sessions.
24
22
 
25
23
  ## First Action: Check Active Projects
26
24
 
27
- Before loading any docs for a new session, check whether the user's ask resumes or relates to an in-flight client project. Project context (milestones, tasks, resume notes) is DB-canonical -- agents and CLI read/write it through the `elevasis-sdk project:*` surface.
28
-
29
- 1. **Portfolio snapshot.** Run this first to see what is active or blocked:
30
-
31
- ```bash
32
- pnpm elevasis-sdk project:list --status active --pretty
33
- pnpm elevasis-sdk project:list --status blocked --pretty
34
- ```
35
-
36
- 2. **Resume-style asks.** If the user says "continue", "pick up", references a client name, or names a task/milestone, resolve it via:
37
-
38
- ```bash
39
- pnpm elevasis-sdk project:work <query>
40
- ```
41
-
42
- `project:work` fuzzy-matches a project or task by name/ID and returns the current resume context -- the canonical continuity payload (current state, next steps, files modified, key docs).
43
-
44
- 3. **Fresh non-project asks.** Only if the portfolio snapshot and the request show no overlap with active projects, fall back to the docs-index flow below. Even then, if the work will take more than a single file edit, offer to create a project first (`/project create` or `project:create`) so continuity is captured from the start.
45
-
46
- ### Resume Context Source of Truth
47
-
48
- `resume_context` lives in the `prj_tasks` table in the database, not in task-doc frontmatter. There is one source of truth:
49
-
50
- - **Humans write** via the inline resume-context editor on the Project Detail page in Command Center.
51
- - **Agents and the CLI write** via `pnpm elevasis-sdk project:task:save <task-id> --current-state ... --next-steps ... --files-modified ...`.
52
- - **Readers** consume it via `project:work <query>` or `project:task:resume <id>`.
53
-
54
- Do not write resume state into markdown frontmatter. Task-doc frontmatter is limited to `title`, `description`, and `status`.
25
+ **This rule owns session bootstrap.** Run this flow on the first response of a session, before loading any docs. Project context (milestones, tasks, resume notes) is DB-canonical -- agents and CLI read and write it through the `elevasis-sdk project:*` surface only.
55
26
 
56
- ### Session-Start Dashboard
27
+ 1. **Portfolio snapshot.** Run first: `pnpm elevasis-sdk project:list --status active --pretty`, then the same with `--status blocked`.
28
+ 2. **Resume-style asks** ("continue", "pick up", a client name, a task or milestone name): resolve with `pnpm elevasis-sdk project:work <query>`. It fuzzy-matches a project or task by name/ID and returns the current resume context -- current state, next steps, files modified, key docs.
29
+ 3. **Fresh non-project asks.** Only when the snapshot and the request show no overlap, fall back to the Discovery Order below. Even then, if the work is more than a single file edit, offer to create a project first (`/project create` or `project:create`) so continuity is captured from the start.
57
30
 
58
- **This rule owns session bootstrap.** Run the "First Action" flow above on the first response of a session. `CLAUDE.md` only points here it is project-owned and never overwritten by sync, so it deliberately carries no procedure that might need correcting later.
59
-
60
- Older projects may still have a copy of the dashboard directive inline in their `CLAUDE.md`. If the two ever disagree, this file wins: it ships with the SDK version the project actually runs.
31
+ `CLAUDE.md` only points here -- it is project-owned and never overwritten by sync, so it deliberately carries no procedure that might need correcting later. Older projects may still have an inline copy of the session-start directive in their `CLAUDE.md`; if the two disagree, this file wins, because it ships with the SDK version the project actually runs.
61
32
 
62
33
  ## Template Surfaces
63
34
 
64
- Once project continuity is resolved (or confirmed irrelevant), the template is not just an app starter. It is an agent operating environment with several distinct surfaces:
35
+ Once project continuity is resolved (or confirmed irrelevant): the template is an agent operating environment, not just an app starter.
65
36
 
66
37
  - `ui/` -- React frontend app and shell composition
67
38
  - `operations/` -- Elevasis SDK resources deployed to the platform
68
39
  - `core/` -- runtime-agnostic shared contracts and organization model adaptation
69
40
  - `.claude/` -- local agent rules, skills, and hooks
70
- - `operations/node_modules/@elevasis/sdk/reference/scaffold/` -- SDK reference scaffold: canonical recipes, UI patterns, gating model, contracts, and glossary. Entry point: `index.mdx`.
41
+ - `operations/node_modules/@elevasis/sdk/reference/scaffold/index.mdx` -- SDK reference scaffold, available after `pnpm install`: pathway recipes, UI patterns, gating model, core architecture, contracts, feature registry, glossary. For feature integration, resource authoring, or UI customization, start here rather than at local docs.
71
42
 
72
43
  ## Discovery Order
73
44
 
74
45
  Use this order unless a more specific doc tells you otherwise:
75
46
 
76
47
  1. Complete the "First Action: Check Active Projects" flow above.
77
- 2. Read `CLAUDE.md` for this project's identity, client context, and user preferences. It is deliberately short for structure, stack, commands, and the slash-command surface, read `.claude/Overview.md`, which sync keeps current.
78
- 3. Read `OPERATIONS.md` at the project root, if present -- it is tenant-owned, never overwritten by sync, and records operational quirks true for this tenant only (non-obvious deploy targets, environment gotchas). Read it early: it can override generic guidance elsewhere in this file for this specific tenant.
79
- 4. Read this rule and classify the task using the Task Classes below.
80
- 5. Read `identity.clientBrief` from the OrganizationModel (`core/config/organization-model.ts`) for organization context and naming.
81
- 6. Read the relevant structural map:
82
- - Glob `operations/node_modules/@elevasis/sdk/reference/` for published package surfaces
83
- - Read `operations/src/index.ts` for deployment assembly, `core/config/organization-model.ts` for resource descriptors, or run `pnpm elevasis-sdk project:list --pretty` for live DB state
84
- 7. For feature integration, resource authoring, or UI customization tasks, read `operations/node_modules/@elevasis/sdk/reference/scaffold/index.mdx` to find the canonical recipe or reference doc.
85
- 8. Drill into the co-located local explainer for the abstraction boundary you are changing.
86
- 9. Check the `.claude/rules/active-change-index.md` rule before trusting stable assumptions in areas that are under active architecture work.
87
-
88
- ## SDK Reference Scaffold
89
-
90
- Universal scaffold documentation (recipes, patterns, architecture, reference) has been centralized in the SDK reference. After `pnpm install`, the entry point is:
91
-
92
- `operations/node_modules/@elevasis/sdk/reference/scaffold/index.mdx`
93
-
94
- This index links to all scaffold docs including pathway recipes, UI patterns, core architecture, and auto-generated contracts/feature registry.
95
-
96
- For task classes that involve feature integration, resource authoring, or UI customization, start with the scaffold index rather than local docs.
48
+ 2. `CLAUDE.md` -- this project's identity, client context, and user preferences. It is deliberately short; for structure, stack, commands, and the slash-command surface read `.claude/Overview.md`, which sync keeps current.
49
+ 3. `OPERATIONS.md` at the project root, if present -- tenant-owned, never overwritten by sync, and records operational quirks true for this tenant only (non-obvious deploy targets, environment gotchas). Read it early: it can override generic guidance elsewhere in this file.
50
+ 4. This rule -- classify the task using the Task Classes below.
51
+ 5. `identity.clientBrief` in `core/config/organization-model.ts` -- organization context and naming.
52
+ 6. Structural state: `operations/src/index.ts` for deployment assembly, `core/config/organization-model.ts` for resource descriptors, `pnpm elevasis-sdk project:list --pretty` for live DB state.
53
+ 7. The scaffold index (see Template Surfaces) for the canonical recipe covering the task.
54
+ 8. The co-located local explainer for the abstraction boundary you are changing.
55
+ 9. `.claude/rules/active-change-index.md` before trusting stable assumptions in an area under active architecture work.
97
56
 
98
57
  ## Task Classes
99
58
 
100
- Classify the request, then follow the load/inspect/verify sequence for that class.
59
+ Classify the request, then follow the load/inspect/verify sequence for that class. Every class starts at the scaffold index; the extra loads below are what that class adds.
101
60
 
102
61
  ### 1. UI / Shell Work
103
62
 
@@ -105,27 +64,16 @@ Examples: add a page, change sidebar behavior, adjust feature visibility, update
105
64
 
106
65
  Load first:
107
66
 
108
- - `operations/node_modules/@elevasis/sdk/reference/scaffold/index.mdx` (scaffold index -- UI recipes, feature flags, customization)
109
67
  - `.claude/rules/ui.md`
110
- - `ui/src/routes/README.md`
111
- - `core/config/README.md`
112
- - `operations/node_modules/@elevasis/sdk/reference/scaffold/ui/recipes.md` -- specifically recipe 6 when building a "run this resource" surface
113
- - `operations/node_modules/@elevasis/sdk/reference/scaffold/recipes/extend-crm.md` -- when building or extending CRM pages, sidebars, hooks, workflows, or deal data surfaces
114
- - `operations/node_modules/@elevasis/sdk/reference/scaffold/recipes/extend-lead-gen.md` -- when building or extending lead-gen pages, sidebars, hooks, workflows, list/member state, or artifacts
115
- - `operations/node_modules/@elevasis/sdk/reference/scaffold/recipes/customize-crm-actions.md` -- when changing CRM deal action buttons or adding a workflow-backed deal action
116
-
117
- Then inspect:
68
+ - `ui/src/routes/README.md`, `core/config/README.md`
69
+ - `operations/node_modules/@elevasis/sdk/reference/scaffold/ui/recipes.md` -- recipe 6 when building a "run this resource" surface
70
+ - `operations/node_modules/@elevasis/sdk/reference/scaffold/recipes/extend-crm.md` -- CRM pages, sidebars, hooks, workflows, deal data surfaces
71
+ - `operations/node_modules/@elevasis/sdk/reference/scaffold/recipes/extend-lead-gen.md` -- lead-gen pages, sidebars, hooks, workflows, list/member state, artifacts
72
+ - `operations/node_modules/@elevasis/sdk/reference/scaffold/recipes/customize-crm-actions.md` -- deal action buttons and workflow-backed deal actions
118
73
 
119
- - `ui/src/routes/__root.tsx`
120
- - `ui/src/config/*`
121
- - relevant `ui/src/routes/*`
122
- - relevant `ui/src/features/*`
123
- - `core/config/organization-model.ts`
74
+ Then inspect: `ui/src/routes/__root.tsx`, `ui/src/config/*`, the relevant `ui/src/routes/*` and `ui/src/features/*`, `core/config/organization-model.ts`.
124
75
 
125
- Verify with:
126
-
127
- - route and manifest source
128
- - any relevant package README from `packages/ui`
76
+ Verify with: route and manifest source, plus the mirrored `@elevasis/ui` source in the bundle (see References) when a prop or hook signature is in question.
129
77
 
130
78
  ### 2. Workflow / Agent / Operations Work
131
79
 
@@ -133,22 +81,17 @@ Examples: add a workflow, update an agent, change resource registration, underst
133
81
 
134
82
  Load first:
135
83
 
136
- - `operations/node_modules/@elevasis/sdk/reference/scaffold/index.mdx` (scaffold index -- workflow recipes, resource authoring)
137
84
  - `.claude/rules/operations.md`
138
85
  - `operations/src/README.md`
139
86
 
140
87
  Then inspect:
141
88
 
142
- - `operations/src/index.ts`
143
- - relevant `operations/src/<feature>/*`
89
+ - `operations/src/index.ts` and the relevant `operations/src/<feature>/*`
144
90
  - `core/types/index.ts` -- workflow input/output Zod schemas
145
- - `core/types/entities.ts` -- typed entity contracts (Project, Deal, etc.) extending `@elevasis/core/entities` base types. Read this when authoring a workflow that takes or returns these entities so the input/output schemas reference the canonical entity shapes rather than redeclaring them.
91
+ - `core/types/entities.ts` -- typed entity contracts (Project, Deal, etc.) extending `@elevasis/core/entities` base types. Read this when a workflow takes or returns these entities so its schemas reference the canonical shapes instead of redeclaring them.
146
92
  - `operations/elevasis.config.ts`
147
93
 
148
- Verify with:
149
-
150
- - Read `operations/src/index.ts` for deployment assembly, `core/config/organization-model.ts` for resource descriptors, or run `pnpm elevasis-sdk project:list --pretty` for live DB state
151
- - local SDK guidance in `.claude/skills/elevasis/SKILL.md`
94
+ Verify with: the structural state sources in Discovery Order step 6, and `.claude/skills/elevasis/SKILL.md`.
152
95
 
153
96
  ### 3. Organization Model / Feature Access Work
154
97
 
@@ -156,27 +99,19 @@ Examples: rename a feature area, change quick access surfaces, map new business
156
99
 
157
100
  Load first:
158
101
 
159
- - `operations/node_modules/@elevasis/sdk/reference/scaffold/index.mdx` (scaffold index -- contracts, gating patterns, glossary)
160
102
  - `core/config/README.md`
161
103
  - `operations/node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md`
162
- - typed feature/surface constants from `@elevasis/core/organization-model` -- `SALES_FEATURE_ID`, `PROSPECTING_FEATURE_ID`, `PROJECTS_FEATURE_ID`, `OPERATIONS_FEATURE_ID`, `MONITORING_FEATURE_ID`, `SETTINGS_FEATURE_ID`, `SEO_FEATURE_ID`, `SALES_PIPELINE_SURFACE_ID`, `PROSPECTING_LISTS_SURFACE_ID`, `PROJECTS_INDEX_SURFACE_ID`, `OPERATIONS_COMMAND_VIEW_SURFACE_ID`. Use these typed constants instead of magic strings when overriding feature/surface IDs.
163
- - `operations/node_modules/@elevasis/sdk/reference/scaffold/recipes/extend-crm.md` -- CRM is an Organization OS + UI + hooks + workflow-adapter surface; read this before extending CRM structure.
164
- - `operations/node_modules/@elevasis/sdk/reference/scaffold/recipes/extend-lead-gen.md` -- lead gen is an Organization OS + UI + hooks + workflow-adapter surface; read this before extending lead-gen lists, members, artifacts, or state transitions.
165
- - `operations/node_modules/@elevasis/sdk/reference/scaffold/recipes/customize-crm-actions.md` -- CRM action buttons are not `sales.actions` org-model config in v1; use the recipe's provider/custom-button path.
166
104
  - `operations/node_modules/@elevasis/sdk/reference/scaffold/ui/feature-flags-and-gating.md`
105
+ - Typed feature and surface ID constants exported from `@elevasis/core/organization-model` (`SALES_FEATURE_ID`, `PROSPECTING_LISTS_SURFACE_ID`, and the rest). Always use these constants instead of magic strings when overriding feature/surface IDs; the full list is enumerated in `.claude/rules/organization-os.md`.
106
+ - The `extend-crm.md`, `extend-lead-gen.md`, and `customize-crm-actions.md` recipes listed under Class 1 -- CRM and lead gen are Organization OS + UI + hooks + workflow-adapter surfaces, and CRM action buttons are not `sales.actions` org-model config in v1 (use the recipe's provider/custom-button path).
167
107
 
168
108
  Then inspect:
169
109
 
170
- - `core/config/organization-model.ts`
171
110
  - `core/config/organization-model.ts` -- Organization Model overrides plus Systems and Resources descriptors. Start here for feature labels, surface mapping, and resource identity/governance changes.
172
- - `ui/src/routes/__root.tsx`
173
- - feature-access gating call sites built from `createFeatureAccessHook` (`@elevasis/ui/hooks`) -- the template no longer ships a local `useFeatureAccess.ts`; the hook factory is the published equivalent
174
- - relevant nav config files
111
+ - `ui/src/routes/__root.tsx` and the relevant nav config files
112
+ - Access-gating call sites: `useAccess(accessKey)` from `@elevasis/ui/hooks` and `<AccessGuard accessKey={...}>` from `@elevasis/ui/auth`. The template ships no local `useFeatureAccess.ts` and there is no hook factory -- these two published entry points are the whole gating surface.
175
113
 
176
- Verify with:
177
-
178
- - published package docs for `@elevasis/core/organization-model`
179
- - current scaffold routes and manifests
114
+ Verify with: published docs for `@elevasis/core/organization-model`, plus current scaffold routes and manifests.
180
115
 
181
116
  ### 4. Debugging / Impact Analysis
182
117
 
@@ -184,79 +119,38 @@ Examples: why is this automation disconnected, what does this workflow affect, w
184
119
 
185
120
  Load first:
186
121
 
187
- - `operations/src/README.md`
188
- - `.claude/rules/active-change-index.md`
189
- - Read `operations/src/index.ts` for deployment assembly, `core/config/organization-model.ts` for resource descriptors, or run `pnpm elevasis-sdk project:list --pretty` for live DB state
190
- - For "why didn't this run?", "why is this still pending?", "what needs approval?", or schedule/queue debugging, inspect live operations state with `pnpm elevasis-sdk schedule:list --pretty`, `pnpm elevasis-sdk queue:list --status pending --pretty`, and `pnpm elevasis-sdk queue:status --pretty`.
191
-
192
- Then inspect:
193
-
194
- - `operations/src/index.ts`
195
- - resource definitions
196
- - related UI route and feature files
197
- - related core contracts
198
- - pending HITL items via `elevasis-sdk queue:get <id>` before selecting or expiring an action
199
- - recurring automation via `elevasis-sdk schedule:get <id>` before pausing, resuming, or cancelling it
122
+ - `operations/src/README.md`, `.claude/rules/active-change-index.md`
123
+ - The structural state sources in Discovery Order step 6
124
+ - For "why didn't this run?", "why is this still pending?", "what needs approval?", or schedule/queue questions: `pnpm elevasis-sdk schedule:list --pretty`, `queue:list --status pending --pretty`, `queue:status --pretty`
200
125
 
201
- Verify with:
126
+ Then inspect: `operations/src/index.ts`, resource definitions, related UI route/feature files, related core contracts. Always check a pending HITL item with `elevasis-sdk queue:get <id>` before selecting or expiring it, and a recurring automation with `elevasis-sdk schedule:get <id>` before pausing, resuming, or cancelling it.
202
127
 
203
- - resource registration and relationship declarations
204
- - generated maps
205
- - package and source ownership boundaries
206
- - `queue:*` or `schedule:*` CLI output when runtime state is part of the question
128
+ Verify with: resource registration and relationship declarations, generated maps, package/source ownership boundaries, and `queue:*` or `schedule:*` output when runtime state is part of the question.
207
129
 
208
130
  ### 5. Platform Extension / Package Contract Work
209
131
 
210
132
  Examples: extend a published package contract, understand how a scaffold surface maps to `@elevasis/ui`, update a package-facing reference doc.
211
133
 
212
- Load first:
134
+ Load first: `.claude/rules/active-change-index.md`, then glob `operations/node_modules/@elevasis/sdk/reference/` for the current SDK package surface and read the package reference found there.
213
135
 
214
- - `.claude/rules/active-change-index.md`
215
- - Glob `operations/node_modules/@elevasis/sdk/reference/` for the current SDK package surface
216
- - package README found via that glob
136
+ Then inspect: package source entrypoints, package reference manifests, and the scaffold files that consume the contract.
217
137
 
218
- Then inspect:
219
-
220
- - package source entrypoints
221
- - package reference manifests
222
- - scaffold files that consume that contract
223
-
224
- Verify with:
225
-
226
- - published package docs
227
- - source exports
228
- - scaffold consumption points
138
+ Verify with: published package docs, source exports, and scaffold consumption points.
229
139
 
230
140
  ## Boundary Resolution
231
141
 
232
- Once the request is classified, determine which boundary owns the change:
233
-
234
- - **Core boundary** -- semantics, aliases, labels, shared schemas
235
- - **UI shell boundary** -- provider composition, manifests, navigation, route ownership
236
- - **Operations boundary** -- deployable resource registration, workflow/agent contracts, topology
237
- - **Package boundary** -- public exports, shared platform behavior, reusable contracts
142
+ Once the request is classified, determine which boundary owns the change. If a task spans boundaries, start at the semantic boundary, then runtime composition, then registration/deployment.
238
143
 
239
- If a task spans boundaries, start at the semantic boundary, then move to runtime composition, then to registration/deployment.
240
-
241
- ## Main Boundaries
242
-
243
- ### `core/config/organization-model.ts`
244
-
245
- The semantic adaptation point between platform contracts and scaffold-local terminology. Start here for feature labels, legacy aliases, quick-access surfaces, and shell-facing organization semantics.
246
-
247
- ### `ui/src/routes/__root.tsx`
248
-
249
- The shell composition point. Start here for manifest mounting, provider wiring, app-local nav, and how the scaffold combines published feature surfaces with project-owned shell concerns.
250
-
251
- ### `operations/src/index.ts`
252
-
253
- The deployment aggregation point. Start here for what resources are registered and deployed as part of the scaffold.
144
+ - **Core boundary** -- semantics, aliases, labels, shared schemas. Entry: `core/config/organization-model.ts`, the adaptation point between platform contracts and scaffold-local terminology (feature labels, legacy aliases, quick-access surfaces, shell-facing organization semantics).
145
+ - **UI shell boundary** -- provider composition, manifests, navigation, route ownership. Entry: `ui/src/routes/__root.tsx`, where the scaffold combines published feature surfaces with project-owned shell concerns.
146
+ - **Operations boundary** -- deployable resource registration, workflow/agent contracts, topology. Entry: `operations/src/index.ts`, the deployment aggregation point.
147
+ - **Package boundary** -- public exports, shared platform behavior, reusable contracts. Entry: the SDK reference bundle.
254
148
 
255
149
  ## Source of Truth
256
150
 
257
151
  Trust these in order:
258
152
 
259
- 1. Tenant-owned `OPERATIONS.md` at the project root, when present, for facts specific to this tenant's own environment and operational quirks -- it is never overwritten by sync and can override any generic guidance below for this tenant specifically
153
+ 1. Tenant-owned `OPERATIONS.md`, when present, for this tenant's own environment and operational quirks -- never overwritten by sync, and it overrides any generic guidance below
260
154
  2. Source code and published package docs
261
155
  3. Co-located boundary docs
262
156
  4. Generated structural maps
@@ -268,23 +162,37 @@ If a hand-authored doc conflicts with source or published package docs, trust so
268
162
  ## Common Traps
269
163
 
270
164
  - Do not assume feature directories are exhaustive without also checking `operations/src/index.ts` and `core/config/organization-model.ts` directly.
271
- - Do not assume placeholder knowledge is sufficient for real client context. Read `identity.clientBrief` from the OrganizationModel (`core/config/organization-model.ts`).
165
+ - Do not assume placeholder knowledge is sufficient for real client context. Read `identity.clientBrief` from `core/config/organization-model.ts`.
272
166
  - Do not trust stable docs blindly when `.claude/rules/active-change-index.md` flags related in-progress architecture work.
273
- - Do not write `resume_context` into task-doc frontmatter. DB is canonical; write via `project:task:save` or the inline editor in Command Center.
167
+ - Never write `resume_context` into task-doc frontmatter -- the DB is canonical. Write it via `pnpm elevasis-sdk project:task:save` or the inline editor on the Project Detail page in Command Center; full rule in `operations/node_modules/@elevasis/sdk/reference/rules/task-tracking.md`.
274
168
 
275
169
  ## Capability Surface
276
170
 
277
171
  When a user asks what skills or commands are available, do NOT answer from recollection.
278
172
 
279
- - **Skill inventory:** Read `.claude/Overview.md` it is the authoritative list of skills available in this project.
280
- - **Live CLI capability:** Run `pnpm elevasis-sdk cli` it outputs every command and domain currently registered in the SDK, grouped by domain.
173
+ - **Skill inventory:** read `.claude/Overview.md` -- the authoritative list of skills in this project.
174
+ - **Live CLI capability:** run `pnpm elevasis-sdk cli` -- every command and domain currently registered in the SDK, grouped by domain.
281
175
 
282
176
  ## Operations-Only Projects
283
177
 
284
- Some projects derived from this template are operations-only. They have `operations/` (or a top-level `src/`) but NO `ui/`, NO `core/config/organization-model.ts`, and NO frontend. Finding none of these is not missing scaffolding -- it is by design.
178
+ Some projects derived from this template are operations-only: they have `operations/` (or a top-level `src/`) but NO `ui/`, NO `core/config/organization-model.ts`, and NO frontend. Finding none of these is not missing scaffolding -- it is by design.
179
+
180
+ **Signal:** the project's `CLAUDE.md` includes `Project type: operations-only` in its `## Project` section.
181
+
182
+ **What applies:** only Task Classes 2 and 4. Classes 1, 3, and 5 do not apply and can be skipped. The project's own `CLAUDE.md` and its Navigation table are the canonical first-read; this rule still supplies task routing, but its surface map does not.
183
+
184
+ ## Related Rules
285
185
 
286
- **What applies:** Only Task Classes 2 (Workflow / Agent / Operations Work) and 4 (Debugging / Impact Analysis) apply to operations-only projects. Task Classes 1 (UI / Shell Work), 3 (Organization Model / Feature Access Work), and 5 (Platform Extension / Package Contract Work) do not apply and can be skipped.
186
+ - `operations/node_modules/@elevasis/sdk/reference/rules/task-tracking.md` -- task doc format, status values, auto-save behavior, and the canonical `resume_context` rule
187
+ - `operations/node_modules/@elevasis/sdk/reference/rules/ui.md` -- shell composition, gating call sites, and route ownership detail for Task Class 1
188
+ - `operations/node_modules/@elevasis/sdk/reference/rules/operations.md` -- resource authoring and deployment detail for Task Class 2
189
+ - `operations/node_modules/@elevasis/sdk/reference/rules/organization-os.md` -- Organization Model field/constant surface and published subpaths for Task Class 3
190
+ - `operations/node_modules/@elevasis/sdk/reference/rules/active-change-index.md` -- which areas are under active architecture work
287
191
 
288
- **Primary entrypoint:** For operations-only projects, the project's own `CLAUDE.md` and its Navigation table are the canonical first-read. This rule provides task-routing context but its full surface map is irrelevant for that project type.
192
+ ## References
289
193
 
290
- **Signal:** The `CLAUDE.md` of an operations-only project includes `Project type: operations-only` in its `## Project` section. When you see this signal, skip all template surfaces that don't exist and go directly to the operations task class.
194
+ - `operations/node_modules/@elevasis/sdk/reference/scaffold/index.mdx` -- scaffold entry point; links every recipe, UI pattern, contract, and generated registry
195
+ - `operations/node_modules/@elevasis/sdk/reference/scaffold/ui/feature-flags-and-gating.md` -- `AccessGuard` and `useAccess` usage, structured action keys, and how System lifecycle maps to an access answer
196
+ - `operations/node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md` -- `NavItem`, `SystemModule`, and the other published TypeScript shapes
197
+ - `operations/node_modules/@elevasis/sdk/reference/packages/ui/src/` -- mirrored `@elevasis/ui` source when an exact hook or prop signature is needed
198
+ - `.claude/Overview.md` -- project-local skill and command inventory, kept current by sync
@@ -9,19 +9,26 @@ paths:
9
9
 
10
10
  # Deployment
11
11
 
12
+ This rule is the single owner of the check-before-deploy command table. `platform.md` and `operations.md` point here instead of restating it -- do not copy the table back into them.
13
+
12
14
  ## Always Check Before Deploy
13
15
 
14
- ```bash
15
- pnpm -C operations run check # Validate resource definitions
16
- pnpm -C operations run check-types # TypeScript type-check
17
- pnpm -C operations run deploy # Deploy (target depends on environment -- see below)
18
- ```
16
+ | Command | Purpose |
17
+ | ------------------------------------ | ---------------------------------------------------------------------------- |
18
+ | `pnpm -C operations run check` | Validate resource definitions |
19
+ | `pnpm -C operations run check-types` | TypeScript type-check |
20
+ | `pnpm -C operations run deploy` | Deploy -- **targets production by default**; see the next section before use |
21
+ | `pnpm -C operations run deploy:prod` | Deploy to production explicitly (`elevasis-sdk deploy --prod`) |
22
+
23
+ **Always use the explicit `run` form.** `pnpm -C operations deploy` (no `run`) is parsed as pnpm's builtin `deploy` command, which prunes and copies a package into a target directory rather than running the project's `deploy` script. That is a real trap, not a style preference -- `run` is the form that cannot misfire. These four names are the actual scripts declared in `operations/package.json`.
19
24
 
20
25
  `check` catches duplicate resource IDs, OM descriptor/code mismatches, invalid step chains, broken relationships, and schema serialization issues. Same validation runs during deploy -- if `check` passes, deploy validation will pass.
21
26
 
22
27
  ## Dev vs Prod (SAFETY-CRITICAL: plain `deploy` targets PRODUCTION by default)
23
28
 
24
- Plain `pnpm -C operations run deploy` runs `elevasis-sdk deploy` with no flags. There is no dev-safe default baked into the command name. The API URL resolution (`packages/sdk/src/cli/config.ts`, `resolveApiUrl`) checks, in order:
29
+ **Plain `pnpm -C operations run deploy` targets production (`https://api.elevasis.io`) unless `NODE_ENV=development` is exported in your shell. There is no dev-safe default.**
30
+
31
+ It runs `elevasis-sdk deploy` with no flags, and no dev-safe default is baked into the command name. The API URL resolution checks, in order:
25
32
 
26
33
  1. `--api-url <url>` CLI flag -- explicit override, always wins
27
34
  2. `--prod` CLI flag -- forces `https://api.elevasis.io`
@@ -36,17 +43,17 @@ Plain `pnpm -C operations run deploy` runs `elevasis-sdk deploy` with no flags.
36
43
 
37
44
  Do not assume plain `deploy` is a dev-safe command. Most tenant shells do not export `NODE_ENV=development`, so plain `deploy` hits production. Before running it, confirm the target: check `echo $NODE_ENV` / `$env:NODE_ENV`, or pass `--api-url` explicitly if you need to target a specific environment. If this tenant project has a checked-in `OPERATIONS.md` at the project root, check it first -- it records tenant-specific deploy-target facts that override this generic guidance.
38
45
 
39
- The API key follows a related but distinct rule (`resolveApiKey`): with `--prod`, or whenever `NODE_ENV !== 'development'`, only `ELEVASIS_PLATFORM_KEY` is used. Only when `NODE_ENV === 'development'` (and `--prod` is not passed) does the CLI prefer `ELEVASIS_PLATFORM_KEY_DEV`, falling back to `ELEVASIS_PLATFORM_KEY` if the dev key is unset.
46
+ The API key follows a related but distinct rule: with `--prod`, or whenever `NODE_ENV !== 'development'`, only `ELEVASIS_PLATFORM_KEY` is used. Only when `NODE_ENV === 'development'` (and `--prod` is not passed) does the CLI prefer `ELEVASIS_PLATFORM_KEY_DEV`, falling back to `ELEVASIS_PLATFORM_KEY` if the dev key is unset.
40
47
 
41
48
  Always verify the actual deploy target before treating a deploy as safe-to-repeat, verify with `elevasis-sdk exec`, then deploy to prod deliberately (`deploy:prod` or `--prod`).
42
49
 
43
50
  ## Version Bumping
44
51
 
45
- Deploy accepts `--major`, `--minor`, `--patch` flags to bump the deployment version. The bumped version is written back to `src/index.ts`. Bump on contract changes (input/output schema modifications).
52
+ Deploy accepts `--major`, `--minor`, `--patch` flags to bump the deployment version. The bumped version is written back to `operations/src/index.ts`. Bump on contract changes (input/output schema modifications).
46
53
 
47
54
  ## What Gets Deployed
48
55
 
49
- 1. **Bundle:** esbuild compiles `src/index.ts` + all dependencies into a single self-contained CJS file. No `node_modules` needed at runtime.
56
+ 1. **Bundle:** esbuild compiles `operations/src/index.ts` + all dependencies into a single self-contained CJS file. No `node_modules` needed at runtime.
50
57
  2. **Metadata:** Resource definitions, OM Resources descriptor bindings, Zod schemas (converted to JSON Schema), relationships, triggers.
51
58
 
52
59
  ## Environment
@@ -65,9 +72,25 @@ Deploy accepts `--major`, `--minor`, `--patch` flags to bump the deployment vers
65
72
  | `Missing OM Resource descriptor` | Add the descriptor to `core/config/organization-model.ts` under the id-keyed `resources` map |
66
73
  | `Step references non-existent next step` | Fix the `next:` field in the step chain |
67
74
  | `Schema serialization failed` | Simplify the Zod schema (warning, still deploys) |
68
- | `No default export found` | `src/index.ts` must `export default` a `DeploymentSpec` |
75
+ | `No default export found` | `operations/src/index.ts` must `export default` a `DeploymentSpec` |
69
76
  | `Documentation file exceeds 100KB` | Split the `.md` file |
70
77
 
71
78
  ## Deployment Replaces Previous
72
79
 
73
80
  Only one deployment can be `active` at a time. Deploying again automatically marks the previous deployment as `stopped`. Resources become executable immediately after deploy succeeds.
81
+
82
+ ## Related Rules
83
+
84
+ Sibling rule bodies live at `operations/node_modules/@elevasis/sdk/reference/rules/`.
85
+
86
+ - **platform.md** -- SDK authoring invariants every deployable resource must satisfy before `check` will pass
87
+ - **operations.md** -- the `operations/` surface: adding a workflow, the resource registry, rule upkeep
88
+ - **organization-model.md** -- OM Resource descriptors that deploy validation requires
89
+ - **execution.md** -- running and verifying a resource after it deploys
90
+
91
+ ## References
92
+
93
+ - `operations/package.json` -- the actual `check`, `check-types`, `deploy`, and `deploy:prod` scripts this table wraps
94
+ - `operations/node_modules/@elevasis/sdk/reference/sdk/deployment/index.mdx` -- full deploy pipeline: validation stages, bundling, API URL and key resolution, deployment lifecycle
95
+ - `operations/node_modules/@elevasis/sdk/reference/sdk/cli.mdx` -- every `elevasis-sdk` command and flag
96
+ - `operations/node_modules/@elevasis/sdk/reference/sdk/troubleshooting.mdx` -- diagnosing deploy and execution failures
@@ -25,6 +25,8 @@ throw new ExecutionError('Payment processing failed', {
25
25
 
26
26
  **`PlatformToolError`** -- thrown by `platform.call()` and typed adapters.
27
27
 
28
+ <!-- doc-snippet:skip: illustrative excerpt with `...` elisions, not a standalone compilable file -->
29
+
28
30
  ```typescript
29
31
  import { PlatformToolError } from '@elevasis/sdk'
30
32
 
@@ -57,3 +59,27 @@ The platform does NOT automatically retry failed steps. Your handler is responsi
57
59
  | `timeout_error` | Yes | Integration call timed out |
58
60
  | `credentials_invalid` | No | Credential not found or expired |
59
61
  | `validation_error` | No | Invalid parameters passed to tool |
62
+
63
+ ## CLI Transport Failures
64
+
65
+ These are errors in the CLI you type commands into, not in your handler code. They are worth knowing because the natural reaction to one of them is the wrong reaction.
66
+
67
+ **A 502, 503, or 504 does not come from the platform API.** It comes from a hop in front of it that ended your connection while the API was still working, so **the request you sent may have completed in full.** This is measured, not theoretical: a session turn returned 502 to the CLI after 300 seconds and completed successfully server-side at 319.8 seconds, with a model reply written and no error of any kind. The only thing that failed was the connection carrying the answer back.
68
+
69
+ **Look for the result before re-running the command.** Use `elevasis-sdk executions <resourceId>` to check whether the work landed. Re-running blind on a gateway failure executes it a second time.
70
+
71
+ **Every CLI request is bounded by a timeout, defaulting to 2 hours.** The limit is deliberately high because it matches the server's own socket budget on long routes -- the goal is to bound an indefinite hang, not to police how long your work may take. Anything shorter would make the CLI give up on executions the API is still legitimately serving. Override with `ELEVASIS_CLI_TIMEOUT_MS`.
72
+
73
+ "Timed out", "never reached the API", and "the API rejected this" are three distinct messages. If automation branches on CLI stderr, match on the current text rather than on `API request failed`.
74
+
75
+ ## Related Rules
76
+
77
+ - `operations/node_modules/@elevasis/sdk/reference/rules/observability.md` -- logging errors so they surface in execution output
78
+ - `operations/node_modules/@elevasis/sdk/reference/rules/execution.md` -- timeouts and cancellation, which fail steps without throwing
79
+ - `operations/node_modules/@elevasis/sdk/reference/rules/operations.md` -- workflow and step authoring conventions
80
+
81
+ ## References
82
+
83
+ - `operations/node_modules/@elevasis/sdk/reference/sdk/platform-tools/adapters-integration.mdx` -- which adapter calls raise `PlatformToolError`
84
+ - `operations/node_modules/@elevasis/sdk/reference/sdk/troubleshooting.mdx` -- diagnosing failed executions
85
+ - `operations/node_modules/@elevasis/sdk/reference/scaffold/operations/workflow-recipes.md` -- handler patterns including retry loops
@@ -41,3 +41,16 @@ No developer action needed for multi-tenancy -- the platform handles it.
41
41
  ## Cancellation
42
42
 
43
43
  The platform can cancel in-flight executions. The worker terminates immediately with no cleanup handler.
44
+
45
+ ## Related Rules
46
+
47
+ - `operations/node_modules/@elevasis/sdk/reference/rules/error-handling.md` -- error classes and retry decisions
48
+ - `operations/node_modules/@elevasis/sdk/reference/rules/observability.md` -- logging and inspecting a running execution
49
+ - `operations/node_modules/@elevasis/sdk/reference/rules/deployment.md` -- how the bundle workers run from gets built and shipped
50
+ - `operations/node_modules/@elevasis/sdk/reference/rules/operations.md` -- workflow and agent authoring conventions
51
+
52
+ ## References
53
+
54
+ - `operations/node_modules/@elevasis/sdk/reference/sdk/runtime.mdx` -- worker runtime model in full
55
+ - `operations/node_modules/@elevasis/sdk/reference/sdk/deployment/execution-reference.mdx` -- execution lifecycle and states
56
+ - `operations/node_modules/@elevasis/sdk/reference/sdk/resources/patterns.mdx` -- splitting long work across steps
@@ -14,7 +14,7 @@ paths:
14
14
  - `ElevasisUIProvider` in `ui/src/main.tsx` auto-composes shared UI, auth, and API surface -- route files do not wire providers manually
15
15
  - `useApiClient()` from `@elevasis/ui/api` for authenticated API calls, passing `API_URL` from `@/lib/constants/api` -- never raw `fetch` with auth headers. There is no `ui/src/lib/hooks/` directory; see `ui.md` "API and Streaming"
16
16
  - `routeTree.gen.ts` is auto-generated on `pnpm dev` -- never edit manually
17
- - Auth protection: wrap page content with `ProtectedRoute` from `@elevasis/ui/auth`. Admin pages nest `AdminGuard` inside `ProtectedRoute`
17
+ - Auth protection: wrap page content with `ProtectedRoute` from `@elevasis/ui/auth`. Gate further with `AccessGuard accessKey={...}` nested inside `ProtectedRoute` -- a System path for system gating, or an `AccessKeys` constant (e.g. `AccessKeys.platformAdmin`) for permission-backed gating. `FeatureGuard`, `SystemGuard`, `SurfaceGuard`, and `AdminGuard` are retired -- do not reintroduce them
18
18
  - Never fork `@elevasis/ui` components -- if a published component needs a tweak, that missing capability is a bug in `@elevasis/ui`
19
19
 
20
20
  ## Silent-Break Gotchas
@@ -36,10 +36,17 @@ paths:
36
36
 
37
37
  When building pages that display external data, use published `@elevasis/ui` components before building custom UI. Use Mantine components and CSS variables exclusively -- no inline hex colors, no custom design tokens. Match existing page density and spacing.
38
38
 
39
- ## Detailed Reference
39
+ ## Related Rules
40
+
41
+ - **ui.md** -- shell composition, route structure, auth flow, API access, and template customization points
42
+ - **shared-types.md** -- what belongs in `core/types` and the import boundary `ui/src` must respect
43
+ - **organization-model.md** -- System paths and lifecycle values that `AccessGuard accessKey` resolves against
44
+ - **organization-os.md** -- Systems, navigation surfaces, and the `SystemModule` manifest contract
45
+
46
+ ## References
40
47
 
41
48
  - `operations/node_modules/@elevasis/sdk/reference/scaffold/ui/recipes.md` -- add a page, add a nav item, theme tokens, feature-scoped components, route patterns (static, nested, dynamic)
42
- - `operations/node_modules/@elevasis/sdk/reference/scaffold/ui/feature-flags-and-gating.md` -- `systemKey` / `SystemGuard` / `AdminGuard` model
49
+ - `operations/node_modules/@elevasis/sdk/reference/scaffold/ui/feature-flags-and-gating.md` -- System lifecycle gating, `AccessGuard` / `useAccess` / `AccessKeys`, and the structured `{ systemPath, action }` key shape
43
50
  - `operations/node_modules/@elevasis/sdk/reference/scaffold/ui/customization.md` -- sidebar composition via manifest overrides
44
51
  - `operations/node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md` -- TypeScript shapes (`SystemModule`, `NavItem`, `OrganizationModel`)
45
52
  - `ui/src/config/theme.ts` -- theme configuration and CSS variable definitions
@@ -29,6 +29,14 @@ pnpm elevasis-sdk execution <resourceId> <executionId>
29
29
  pnpm elevasis-sdk executions <resourceId>
30
30
  ```
31
31
 
32
- ## Detailed Reference
32
+ ## Related Rules
33
+
34
+ - `operations/node_modules/@elevasis/sdk/reference/rules/error-handling.md` -- error classes, retry decisions, error visibility
35
+ - `operations/node_modules/@elevasis/sdk/reference/rules/execution.md` -- worker lifecycle, timeouts, cancellation
36
+ - `operations/node_modules/@elevasis/sdk/reference/rules/task-tracking.md` -- recording what an execution produced against a task
37
+
38
+ ## References
33
39
 
34
40
  - `operations/node_modules/@elevasis/sdk/reference/scaffold/operations/workflow-recipes.md` -- full logging patterns and handler examples
41
+ - `operations/node_modules/@elevasis/sdk/reference/sdk/deployment/execution-reference.mdx` -- execution and step record shapes
42
+ - `operations/node_modules/@elevasis/sdk/reference/sdk/cli.mdx` -- `execution` / `executions` command reference