@elevasis/sdk 1.21.0 → 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 (160) hide show
  1. package/dist/cli.cjs +951 -171
  2. package/dist/index.d.ts +632 -341
  3. package/dist/index.js +3102 -142
  4. package/dist/node/index.d.ts +1 -0
  5. package/dist/node/index.js +19 -1
  6. package/dist/test-utils/index.d.ts +313 -4
  7. package/dist/test-utils/index.js +3246 -281
  8. package/dist/worker/index.js +3041 -80
  9. package/package.json +3 -3
  10. package/reference/claude-config/hooks/post-edit-validate.mjs +98 -98
  11. package/reference/claude-config/hooks/scaffold-registry-reminder.mjs +188 -188
  12. package/reference/claude-config/hooks/tool-failure-recovery.mjs +73 -73
  13. package/reference/claude-config/registries/graph-skills.json +4 -4
  14. package/reference/claude-config/registries/knowledge-flags.json +0 -2
  15. package/reference/claude-config/rules/active-change-index.md +80 -80
  16. package/reference/claude-config/rules/agent-start-here.md +277 -277
  17. package/reference/claude-config/rules/deployment.md +57 -57
  18. package/reference/claude-config/rules/error-handling.md +56 -56
  19. package/reference/claude-config/rules/execution.md +40 -40
  20. package/reference/claude-config/rules/frontend.md +4 -4
  21. package/reference/claude-config/rules/observability.md +31 -31
  22. package/reference/claude-config/rules/operations.md +29 -17
  23. package/reference/claude-config/rules/organization-model.md +110 -84
  24. package/reference/claude-config/rules/organization-os.md +115 -113
  25. package/reference/claude-config/rules/package-taxonomy.md +33 -33
  26. package/reference/claude-config/rules/platform.md +42 -42
  27. package/reference/claude-config/rules/shared-types.md +49 -46
  28. package/reference/claude-config/rules/task-tracking.md +47 -47
  29. package/reference/claude-config/rules/ui.md +200 -200
  30. package/reference/claude-config/rules/vibe.md +235 -235
  31. package/reference/claude-config/scripts/statusline-command.js +18 -18
  32. package/reference/claude-config/settings.json +34 -34
  33. package/reference/claude-config/skills/deploy/{SKILL.md → skill.md} +156 -156
  34. package/reference/claude-config/skills/dsp/SKILL.md +66 -66
  35. package/reference/claude-config/skills/elevasis/SKILL.md +235 -235
  36. package/reference/claude-config/skills/explore/SKILL.md +6 -6
  37. package/reference/claude-config/skills/git-sync/SKILL.md +126 -126
  38. package/reference/claude-config/skills/knowledge/SKILL.md +314 -299
  39. package/reference/claude-config/skills/knowledge/operations/codify-level-a.md +100 -100
  40. package/reference/claude-config/skills/knowledge/operations/codify-level-b.md +159 -159
  41. package/reference/claude-config/skills/knowledge/operations/customers.md +109 -109
  42. package/reference/claude-config/skills/knowledge/operations/features.md +76 -76
  43. package/reference/claude-config/skills/knowledge/operations/goals.md +118 -118
  44. package/reference/claude-config/skills/knowledge/operations/identity.md +93 -93
  45. package/reference/claude-config/skills/knowledge/operations/labels.md +94 -94
  46. package/reference/claude-config/skills/knowledge/operations/offerings.md +109 -109
  47. package/reference/claude-config/skills/knowledge/operations/roles.md +99 -99
  48. package/reference/claude-config/skills/knowledge/operations/techStack.md +30 -30
  49. package/reference/claude-config/skills/project/SKILL.md +1088 -1088
  50. package/reference/claude-config/skills/run-ui/SKILL.md +73 -73
  51. package/reference/claude-config/skills/save/SKILL.md +3 -3
  52. package/reference/claude-config/skills/setup/SKILL.md +275 -275
  53. package/reference/claude-config/skills/status/SKILL.md +59 -59
  54. package/reference/claude-config/skills/submit-request/SKILL.md +180 -180
  55. package/reference/claude-config/skills/sync/SKILL.md +47 -47
  56. package/reference/claude-config/skills/tutorial/SKILL.md +259 -259
  57. package/reference/claude-config/skills/tutorial/progress-template.md +74 -74
  58. package/reference/claude-config/skills/tutorial/technical.md +1303 -1303
  59. package/reference/claude-config/skills/tutorial/vibe-coder.md +890 -890
  60. package/reference/claude-config/sync-notes/2026-04-22-git-sync-and-sync-notes.md +27 -27
  61. package/reference/claude-config/sync-notes/2026-04-22-lead-gen-deliverability-removal.md +30 -30
  62. package/reference/claude-config/sync-notes/2026-04-24-test-utils-and-template-tests.md +73 -73
  63. package/reference/claude-config/sync-notes/2026-04-24-ui-consolidation-and-sdk-cli-train.md +86 -86
  64. package/reference/claude-config/sync-notes/2026-04-25-auth-role-system-and-settings-roles.md +55 -55
  65. package/reference/claude-config/sync-notes/2026-04-27-crm-hitl-action-layer-cutover.md +97 -97
  66. package/reference/claude-config/sync-notes/2026-04-27-lead-gen-substrate-train.md +112 -112
  67. package/reference/claude-config/sync-notes/2026-04-29-crm-state-and-lead-gen-processing-status.md +93 -93
  68. package/reference/claude-config/sync-notes/2026-05-02-crm-ownership-next-action.md +58 -58
  69. package/reference/claude-config/sync-notes/2026-05-02-template-hardcode-workos-config.md +56 -56
  70. package/reference/claude-config/sync-notes/2026-05-04-elevasis-workspace.md +71 -71
  71. package/reference/claude-config/sync-notes/2026-05-04-knowledge-bundle.md +83 -83
  72. package/reference/claude-config/sync-notes/2026-05-04-template-skills-run-ui-and-tutorial.md +59 -59
  73. package/reference/claude-config/sync-notes/2026-05-05-list-builder.md +42 -42
  74. package/reference/claude-config/sync-notes/2026-05-06-crm-spine.md +60 -60
  75. package/reference/claude-config/sync-notes/2026-05-06-sdk-changes-release-train.md +37 -37
  76. package/reference/claude-config/sync-notes/2026-05-07-sdk-changes-release-train.md +34 -34
  77. package/reference/claude-config/sync-notes/2026-05-08-resource-governance-scaffold-guidance.md +38 -38
  78. package/reference/claude-config/sync-notes/2026-05-09-clients-domain.md +32 -32
  79. package/reference/claude-config/sync-notes/2026-05-09-command-system.md +33 -33
  80. package/reference/claude-config/sync-notes/2026-05-09-resource-governance-and-misc.md +69 -69
  81. package/reference/claude-config/sync-notes/2026-05-12-sdk-ready-release-train.md +30 -30
  82. package/reference/claude-config/sync-notes/2026-05-14-organization-model-ontology-refactor.md +42 -0
  83. package/reference/claude-config/sync-notes/README.md +43 -43
  84. package/reference/cli.mdx +808 -808
  85. package/reference/concepts.mdx +146 -146
  86. package/reference/deployment/api.mdx +297 -297
  87. package/reference/deployment/command-center.mdx +209 -209
  88. package/reference/deployment/index.mdx +195 -195
  89. package/reference/deployment/provided-features.mdx +107 -107
  90. package/reference/deployment/ui-execution.mdx +250 -250
  91. package/reference/examples/organization-model.ts +146 -83
  92. package/reference/framework/agent.mdx +156 -156
  93. package/reference/framework/index.mdx +195 -195
  94. package/reference/framework/interaction-guidance.mdx +182 -182
  95. package/reference/framework/memory.mdx +326 -326
  96. package/reference/framework/project-structure.mdx +282 -282
  97. package/reference/framework/tutorial-system.mdx +135 -135
  98. package/reference/getting-started.mdx +142 -142
  99. package/reference/index.mdx +106 -106
  100. package/reference/packages/core/src/README.md +14 -14
  101. package/reference/packages/core/src/business/README.md +2 -2
  102. package/reference/packages/core/src/knowledge/README.md +32 -32
  103. package/reference/packages/core/src/organization-model/README.md +149 -149
  104. package/reference/packages/core/src/test-utils/README.md +37 -37
  105. package/reference/packages/ui/src/api/README.md +18 -18
  106. package/reference/packages/ui/src/app/README.md +24 -24
  107. package/reference/packages/ui/src/auth/README.md +18 -18
  108. package/reference/packages/ui/src/components/README.md +24 -24
  109. package/reference/packages/ui/src/execution/README.md +16 -16
  110. package/reference/packages/ui/src/features/README.md +28 -28
  111. package/reference/packages/ui/src/graph/README.md +16 -16
  112. package/reference/packages/ui/src/hooks/README.md +23 -23
  113. package/reference/packages/ui/src/initialization/README.md +19 -19
  114. package/reference/packages/ui/src/knowledge/README.md +31 -31
  115. package/reference/packages/ui/src/organization/README.md +18 -18
  116. package/reference/packages/ui/src/profile/README.md +19 -19
  117. package/reference/packages/ui/src/provider/README.md +32 -32
  118. package/reference/packages/ui/src/router/README.md +18 -18
  119. package/reference/packages/ui/src/sse/README.md +13 -13
  120. package/reference/packages/ui/src/test-utils/README.md +7 -7
  121. package/reference/packages/ui/src/theme/README.md +23 -23
  122. package/reference/packages/ui/src/theme/presets/README.md +19 -19
  123. package/reference/packages/ui/src/types/README.md +16 -16
  124. package/reference/packages/ui/src/utils/README.md +18 -18
  125. package/reference/packages/ui/src/zustand/README.md +18 -18
  126. package/reference/platform-tools/adapters-integration.mdx +301 -301
  127. package/reference/platform-tools/adapters-platform.mdx +553 -553
  128. package/reference/platform-tools/index.mdx +217 -217
  129. package/reference/platform-tools/type-safety.mdx +82 -82
  130. package/reference/resources/index.mdx +349 -349
  131. package/reference/resources/patterns.mdx +449 -449
  132. package/reference/resources/types.mdx +116 -116
  133. package/reference/roadmap.mdx +165 -165
  134. package/reference/runtime.mdx +173 -173
  135. package/reference/scaffold/core/organization-graph.mdx +110 -90
  136. package/reference/scaffold/core/organization-model.mdx +226 -219
  137. package/reference/scaffold/index.mdx +67 -67
  138. package/reference/scaffold/operations/propagation-pipeline.md +77 -77
  139. package/reference/scaffold/operations/scaffold-maintenance.md +12 -12
  140. package/reference/scaffold/operations/workflow-recipes.md +138 -138
  141. package/reference/scaffold/recipes/add-a-feature.md +308 -88
  142. package/reference/scaffold/recipes/add-a-resource.md +134 -110
  143. package/reference/scaffold/recipes/customize-knowledge-browser.md +5 -5
  144. package/reference/scaffold/recipes/customize-organization-model.md +273 -138
  145. package/reference/scaffold/recipes/extend-a-base-entity.md +8 -8
  146. package/reference/scaffold/recipes/extend-crm.md +3 -3
  147. package/reference/scaffold/recipes/extend-lead-gen.md +400 -400
  148. package/reference/scaffold/recipes/gate-by-feature-or-admin.md +118 -118
  149. package/reference/scaffold/recipes/index.md +46 -46
  150. package/reference/scaffold/recipes/query-the-knowledge-graph.md +197 -170
  151. package/reference/scaffold/reference/contracts.md +2101 -2096
  152. package/reference/scaffold/reference/glossary.md +76 -76
  153. package/reference/scaffold/ui/composition-extensibility.mdx +233 -233
  154. package/reference/scaffold/ui/customization.md +243 -243
  155. package/reference/scaffold/ui/feature-flags-and-gating.md +46 -46
  156. package/reference/scaffold/ui/feature-shell.mdx +72 -72
  157. package/reference/scaffold/ui/recipes.md +221 -214
  158. package/reference/spine/spine-primer.md +96 -96
  159. package/reference/templates/index.mdx +47 -47
  160. package/reference/troubleshooting.mdx +223 -223
@@ -1,277 +1,277 @@
1
- ---
2
- description: Canonical first-read for agents entering the template scaffold -- project continuity, task-class routing, and boundary resolution
3
- ---
4
-
5
- # Agent Start Here
6
-
7
- Read this file first when entering a freshly scaffolded project.
8
-
9
- ## Project Profile
10
-
11
- Before doing anything else, check for `.claude/memory/profile.md`. It is created by `/tutorial` on first invocation and persists across sessions.
12
-
13
- 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.
14
-
15
- Apply the tone block to ALL agent output for the rest of the session, not just inside `/tutorial`:
16
-
17
- - **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`.
18
- - **technical track:** code-first, current command surface, real file paths. The user reads diffs and stacktraces; do not over-explain.
19
-
20
- 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.
21
-
22
- ## First Action: Check Active Projects
23
-
24
- 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.
25
-
26
- 1. **Portfolio snapshot.** Run this first to see what is active or blocked:
27
-
28
- ```bash
29
- pnpm elevasis-sdk project:list --status active --pretty
30
- pnpm elevasis-sdk project:list --status blocked --pretty
31
- ```
32
-
33
- 2. **Resume-style asks.** If the user says "continue", "pick up", references a client name, or names a task/milestone, resolve it via:
34
-
35
- ```bash
36
- pnpm elevasis-sdk project:work <query>
37
- ```
38
-
39
- `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).
40
-
41
- 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.
42
-
43
- ### Resume Context Source of Truth
44
-
45
- `resume_context` lives in the `prj_tasks` table in the database, not in task-doc frontmatter. There is one source of truth:
46
-
47
- - **Humans write** via the inline resume-context editor on the Project Detail page in Command Center.
48
- - **Agents and the CLI write** via `pnpm elevasis-sdk project:task:save <task-id> --current-state ... --next-steps ... --files-modified ...`.
49
- - **Readers** consume it via `project:work <query>` or `project:task:resume <id>`.
50
-
51
- Do not write resume state into markdown frontmatter. Task-doc frontmatter is limited to `title`, `description`, and `status`.
52
-
53
- ### Session-Start Dashboard
54
-
55
- The session-start dashboard directive lives in `CLAUDE.md`. If you see it there, follow it on the first response of a session. This file (`agent-start-here` rule) is the drill-down reference layer; `CLAUDE.md` owns session bootstrap.
56
-
57
- ## Template Surfaces
58
-
59
- 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:
60
-
61
- - `ui/` -- React frontend app and shell composition
62
- - `operations/` -- Elevasis SDK resources deployed to the platform
63
- - `core/` -- runtime-agnostic shared contracts and organization model adaptation
64
- - `.claude/` -- local agent rules, skills, and hooks
65
- - `client-workspace/` -- optional separate knowledge workspace for richer team knowledge management
66
- - `node_modules/@elevasis/sdk/reference/scaffold/` -- SDK reference scaffold: canonical recipes, UI patterns, gating model, contracts, and glossary. Entry point: `index.mdx`.
67
-
68
- ## Discovery Order
69
-
70
- Use this order unless a more specific doc tells you otherwise:
71
-
72
- 1. Complete the "First Action: Check Active Projects" flow above.
73
- 2. Read `CLAUDE.md` for project rules, command surface, and navigation pointers.
74
- 3. Read this rule and classify the task using the Task Classes below.
75
- 4. Read `identity.clientBrief` from the OrganizationModel (`core/config/organization-model.ts`) for organization context and naming.
76
- 5. Read the relevant structural map:
77
- - Glob `node_modules/@elevasis/sdk/reference/` for published package surfaces
78
- - 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
79
- 6. For feature integration, resource authoring, or UI customization tasks, read `node_modules/@elevasis/sdk/reference/scaffold/index.mdx` to find the canonical recipe or reference doc.
80
- 7. Drill into the co-located local explainer for the abstraction boundary you are changing.
81
- 8. Check the `.claude/rules/active-change-index.md` rule before trusting stable assumptions in areas that are under active architecture work.
82
-
83
- ## SDK Reference Scaffold
84
-
85
- Universal scaffold documentation (recipes, patterns, architecture, reference) has been centralized in the SDK reference. After `pnpm install`, the entry point is:
86
-
87
- `node_modules/@elevasis/sdk/reference/scaffold/index.mdx`
88
-
89
- This index links to all scaffold docs including pathway recipes, UI patterns, core architecture, and auto-generated contracts/feature registry.
90
-
91
- For task classes that involve feature integration, resource authoring, or UI customization, start with the scaffold index rather than local docs.
92
-
93
- ## Task Classes
94
-
95
- Classify the request, then follow the load/inspect/verify sequence for that class.
96
-
97
- ### 1. UI / Shell Work
98
-
99
- Examples: add a page, change sidebar behavior, adjust feature visibility, update dashboard labels.
100
-
101
- Load first:
102
-
103
- - `node_modules/@elevasis/sdk/reference/scaffold/index.mdx` (scaffold index -- UI recipes, feature flags, customization)
104
- - `.claude/rules/ui.md`
105
- - `ui/src/routes/README.md`
106
- - `core/config/README.md`
107
- - `node_modules/@elevasis/sdk/reference/scaffold/ui/recipes.md` -- specifically recipe 6 when building a "run this resource" surface
108
- - `node_modules/@elevasis/sdk/reference/scaffold/recipes/extend-crm.md` -- when building or extending CRM pages, sidebars, hooks, workflows, or deal data surfaces
109
- - `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
110
- - `node_modules/@elevasis/sdk/reference/scaffold/recipes/customize-crm-actions.md` -- when changing CRM deal action buttons or adding a workflow-backed deal action
111
-
112
- Then inspect:
113
-
114
- - `ui/src/routes/__root.tsx`
115
- - `ui/src/config/*`
116
- - relevant `ui/src/routes/*`
117
- - relevant `ui/src/features/*`
118
- - `core/config/organization-model.ts`
119
-
120
- Verify with:
121
-
122
- - route and manifest source
123
- - any relevant package README from `packages/ui`
124
-
125
- ### 2. Workflow / Agent / Operations Work
126
-
127
- Examples: add a workflow, update an agent, change resource registration, understand deployable resources.
128
-
129
- Load first:
130
-
131
- - `node_modules/@elevasis/sdk/reference/scaffold/index.mdx` (scaffold index -- workflow recipes, resource authoring)
132
- - `.claude/rules/operations.md`
133
- - `operations/src/README.md`
134
-
135
- Then inspect:
136
-
137
- - `operations/src/index.ts`
138
- - relevant `operations/src/<feature>/*`
139
- - `core/types/index.ts` -- workflow input/output Zod schemas
140
- - `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.
141
- - `operations/elevasis.config.ts`
142
-
143
- Verify with:
144
-
145
- - 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
146
- - local SDK guidance in `.claude/skills/elevasis/SKILL.md`
147
-
148
- ### 3. Organization Model / Feature Access Work
149
-
150
- Examples: rename a feature area, change quick access surfaces, map new business terms into the shell, adjust feature gating.
151
-
152
- Load first:
153
-
154
- - `node_modules/@elevasis/sdk/reference/scaffold/index.mdx` (scaffold index -- contracts, gating patterns, glossary)
155
- - `core/config/README.md`
156
- - `node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md`
157
- - typed feature/surface constants from `@elevasis/core/organization-model` -- `CRM_FEATURE_ID`, `LEAD_GEN_FEATURE_ID`, `PROJECTS_FEATURE_ID`, `OPERATIONS_FEATURE_ID`, `MONITORING_FEATURE_ID`, `SETTINGS_FEATURE_ID`, `SEO_FEATURE_ID`, `CRM_PIPELINE_SURFACE_ID`, `LEAD_GEN_LISTS_SURFACE_ID`, `PROJECTS_INDEX_SURFACE_ID`, `OPERATIONS_ORGANIZATION_GRAPH_SURFACE_ID`. Use these typed constants instead of magic strings when overriding feature/surface IDs.
158
- - `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.
159
- - `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.
160
- - `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.
161
- - `node_modules/@elevasis/sdk/reference/scaffold/ui/feature-flags-and-gating.md`
162
-
163
- Then inspect:
164
-
165
- - `core/config/organization-model.ts`
166
- - `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.
167
- - `ui/src/routes/__root.tsx`
168
- - `ui/src/lib/hooks/useFeatureAccess.ts`
169
- - relevant nav config files
170
-
171
- Verify with:
172
-
173
- - published package docs for `@elevasis/core/organization-model`
174
- - current scaffold routes and manifests
175
-
176
- ### 4. Debugging / Impact Analysis
177
-
178
- Examples: why is this automation disconnected, what does this workflow affect, what should I inspect before changing this resource.
179
-
180
- Load first:
181
-
182
- - `operations/src/README.md`
183
- - `.claude/rules/active-change-index.md`
184
- - 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
185
- - 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`.
186
-
187
- Then inspect:
188
-
189
- - `operations/src/index.ts`
190
- - resource definitions
191
- - related UI route and feature files
192
- - related core contracts
193
- - pending HITL items via `elevasis-sdk queue:get <id>` before selecting or expiring an action
194
- - recurring automation via `elevasis-sdk schedule:get <id>` before pausing, resuming, or cancelling it
195
-
196
- Verify with:
197
-
198
- - resource registration and relationship declarations
199
- - generated maps
200
- - package and source ownership boundaries
201
- - `queue:*` or `schedule:*` CLI output when runtime state is part of the question
202
-
203
- ### 5. Platform Extension / Package Contract Work
204
-
205
- Examples: extend a published package contract, understand how a scaffold surface maps to `@elevasis/ui`, update a package-facing reference doc.
206
-
207
- Load first:
208
-
209
- - `.claude/rules/active-change-index.md`
210
- - Glob `node_modules/@elevasis/sdk/reference/` for the current SDK package surface
211
- - package README found via that glob
212
-
213
- Then inspect:
214
-
215
- - package source entrypoints
216
- - package reference manifests
217
- - scaffold files that consume that contract
218
-
219
- Verify with:
220
-
221
- - published package docs
222
- - source exports
223
- - scaffold consumption points
224
-
225
- ## Boundary Resolution
226
-
227
- Once the request is classified, determine which boundary owns the change:
228
-
229
- - **Core boundary** -- semantics, aliases, labels, shared schemas
230
- - **UI shell boundary** -- provider composition, manifests, navigation, route ownership
231
- - **Operations boundary** -- deployable resource registration, workflow/agent contracts, topology
232
- - **Package boundary** -- public exports, shared platform behavior, reusable contracts
233
-
234
- If a task spans boundaries, start at the semantic boundary, then move to runtime composition, then to registration/deployment.
235
-
236
- ## Main Boundaries
237
-
238
- ### `core/config/organization-model.ts`
239
-
240
- 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.
241
-
242
- ### `ui/src/routes/__root.tsx`
243
-
244
- 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.
245
-
246
- ### `operations/src/index.ts`
247
-
248
- The deployment aggregation point. Start here for what resources are registered and deployed as part of the scaffold.
249
-
250
- ## Source of Truth
251
-
252
- Trust these in order:
253
-
254
- 1. Source code and published package docs
255
- 2. Co-located boundary docs
256
- 3. Generated structural maps
257
- 4. Hand-authored template guidance
258
- 5. In-progress architecture docs when `.claude/rules/active-change-index.md` says the area is actively evolving
259
-
260
- If a hand-authored doc conflicts with source or published package docs, trust source and flag the doc drift.
261
-
262
- ## Common Traps
263
-
264
- - Do not assume feature directories are exhaustive without also checking `operations/src/index.ts` and `core/config/organization-model.ts` directly.
265
- - Do not assume placeholder knowledge is sufficient for real client context. Read `identity.clientBrief` from the OrganizationModel (`core/config/organization-model.ts`).
266
- - Do not trust stable docs blindly when `.claude/rules/active-change-index.md` flags related in-progress architecture work.
267
- - Do not write `resume_context` into task-doc frontmatter. DB is canonical; write via `project:task:save` or the inline editor in Command Center.
268
-
269
- ## Operations-Only Projects
270
-
271
- 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.
272
-
273
- **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.
274
-
275
- **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.
276
-
277
- **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.
1
+ ---
2
+ description: Canonical first-read for agents entering the template scaffold -- project continuity, task-class routing, and boundary resolution
3
+ ---
4
+
5
+ # Agent Start Here
6
+
7
+ Read this file first when entering a freshly scaffolded project.
8
+
9
+ ## Project Profile
10
+
11
+ Before doing anything else, check for `.claude/memory/profile.md`. It is created by `/tutorial` on first invocation and persists across sessions.
12
+
13
+ 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.
14
+
15
+ Apply the tone block to ALL agent output for the rest of the session, not just inside `/tutorial`:
16
+
17
+ - **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`.
18
+ - **technical track:** code-first, current command surface, real file paths. The user reads diffs and stacktraces; do not over-explain.
19
+
20
+ 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.
21
+
22
+ ## First Action: Check Active Projects
23
+
24
+ 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.
25
+
26
+ 1. **Portfolio snapshot.** Run this first to see what is active or blocked:
27
+
28
+ ```bash
29
+ pnpm elevasis-sdk project:list --status active --pretty
30
+ pnpm elevasis-sdk project:list --status blocked --pretty
31
+ ```
32
+
33
+ 2. **Resume-style asks.** If the user says "continue", "pick up", references a client name, or names a task/milestone, resolve it via:
34
+
35
+ ```bash
36
+ pnpm elevasis-sdk project:work <query>
37
+ ```
38
+
39
+ `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).
40
+
41
+ 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.
42
+
43
+ ### Resume Context Source of Truth
44
+
45
+ `resume_context` lives in the `prj_tasks` table in the database, not in task-doc frontmatter. There is one source of truth:
46
+
47
+ - **Humans write** via the inline resume-context editor on the Project Detail page in Command Center.
48
+ - **Agents and the CLI write** via `pnpm elevasis-sdk project:task:save <task-id> --current-state ... --next-steps ... --files-modified ...`.
49
+ - **Readers** consume it via `project:work <query>` or `project:task:resume <id>`.
50
+
51
+ Do not write resume state into markdown frontmatter. Task-doc frontmatter is limited to `title`, `description`, and `status`.
52
+
53
+ ### Session-Start Dashboard
54
+
55
+ The session-start dashboard directive lives in `CLAUDE.md`. If you see it there, follow it on the first response of a session. This file (`agent-start-here` rule) is the drill-down reference layer; `CLAUDE.md` owns session bootstrap.
56
+
57
+ ## Template Surfaces
58
+
59
+ 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:
60
+
61
+ - `ui/` -- React frontend app and shell composition
62
+ - `operations/` -- Elevasis SDK resources deployed to the platform
63
+ - `core/` -- runtime-agnostic shared contracts and organization model adaptation
64
+ - `.claude/` -- local agent rules, skills, and hooks
65
+ - `client-workspace/` -- optional separate knowledge workspace for richer team knowledge management
66
+ - `node_modules/@elevasis/sdk/reference/scaffold/` -- SDK reference scaffold: canonical recipes, UI patterns, gating model, contracts, and glossary. Entry point: `index.mdx`.
67
+
68
+ ## Discovery Order
69
+
70
+ Use this order unless a more specific doc tells you otherwise:
71
+
72
+ 1. Complete the "First Action: Check Active Projects" flow above.
73
+ 2. Read `CLAUDE.md` for project rules, command surface, and navigation pointers.
74
+ 3. Read this rule and classify the task using the Task Classes below.
75
+ 4. Read `identity.clientBrief` from the OrganizationModel (`core/config/organization-model.ts`) for organization context and naming.
76
+ 5. Read the relevant structural map:
77
+ - Glob `node_modules/@elevasis/sdk/reference/` for published package surfaces
78
+ - 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
79
+ 6. For feature integration, resource authoring, or UI customization tasks, read `node_modules/@elevasis/sdk/reference/scaffold/index.mdx` to find the canonical recipe or reference doc.
80
+ 7. Drill into the co-located local explainer for the abstraction boundary you are changing.
81
+ 8. Check the `.claude/rules/active-change-index.md` rule before trusting stable assumptions in areas that are under active architecture work.
82
+
83
+ ## SDK Reference Scaffold
84
+
85
+ Universal scaffold documentation (recipes, patterns, architecture, reference) has been centralized in the SDK reference. After `pnpm install`, the entry point is:
86
+
87
+ `node_modules/@elevasis/sdk/reference/scaffold/index.mdx`
88
+
89
+ This index links to all scaffold docs including pathway recipes, UI patterns, core architecture, and auto-generated contracts/feature registry.
90
+
91
+ For task classes that involve feature integration, resource authoring, or UI customization, start with the scaffold index rather than local docs.
92
+
93
+ ## Task Classes
94
+
95
+ Classify the request, then follow the load/inspect/verify sequence for that class.
96
+
97
+ ### 1. UI / Shell Work
98
+
99
+ Examples: add a page, change sidebar behavior, adjust feature visibility, update dashboard labels.
100
+
101
+ Load first:
102
+
103
+ - `node_modules/@elevasis/sdk/reference/scaffold/index.mdx` (scaffold index -- UI recipes, feature flags, customization)
104
+ - `.claude/rules/ui.md`
105
+ - `ui/src/routes/README.md`
106
+ - `core/config/README.md`
107
+ - `node_modules/@elevasis/sdk/reference/scaffold/ui/recipes.md` -- specifically recipe 6 when building a "run this resource" surface
108
+ - `node_modules/@elevasis/sdk/reference/scaffold/recipes/extend-crm.md` -- when building or extending CRM pages, sidebars, hooks, workflows, or deal data surfaces
109
+ - `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
110
+ - `node_modules/@elevasis/sdk/reference/scaffold/recipes/customize-crm-actions.md` -- when changing CRM deal action buttons or adding a workflow-backed deal action
111
+
112
+ Then inspect:
113
+
114
+ - `ui/src/routes/__root.tsx`
115
+ - `ui/src/config/*`
116
+ - relevant `ui/src/routes/*`
117
+ - relevant `ui/src/features/*`
118
+ - `core/config/organization-model.ts`
119
+
120
+ Verify with:
121
+
122
+ - route and manifest source
123
+ - any relevant package README from `packages/ui`
124
+
125
+ ### 2. Workflow / Agent / Operations Work
126
+
127
+ Examples: add a workflow, update an agent, change resource registration, understand deployable resources.
128
+
129
+ Load first:
130
+
131
+ - `node_modules/@elevasis/sdk/reference/scaffold/index.mdx` (scaffold index -- workflow recipes, resource authoring)
132
+ - `.claude/rules/operations.md`
133
+ - `operations/src/README.md`
134
+
135
+ Then inspect:
136
+
137
+ - `operations/src/index.ts`
138
+ - relevant `operations/src/<feature>/*`
139
+ - `core/types/index.ts` -- workflow input/output Zod schemas
140
+ - `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.
141
+ - `operations/elevasis.config.ts`
142
+
143
+ Verify with:
144
+
145
+ - 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
146
+ - local SDK guidance in `.claude/skills/elevasis/SKILL.md`
147
+
148
+ ### 3. Organization Model / Feature Access Work
149
+
150
+ Examples: rename a feature area, change quick access surfaces, map new business terms into the shell, adjust feature gating.
151
+
152
+ Load first:
153
+
154
+ - `node_modules/@elevasis/sdk/reference/scaffold/index.mdx` (scaffold index -- contracts, gating patterns, glossary)
155
+ - `core/config/README.md`
156
+ - `node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md`
157
+ - typed feature/surface constants from `@elevasis/core/organization-model` -- `CRM_FEATURE_ID`, `LEAD_GEN_FEATURE_ID`, `PROJECTS_FEATURE_ID`, `OPERATIONS_FEATURE_ID`, `MONITORING_FEATURE_ID`, `SETTINGS_FEATURE_ID`, `SEO_FEATURE_ID`, `CRM_PIPELINE_SURFACE_ID`, `LEAD_GEN_LISTS_SURFACE_ID`, `PROJECTS_INDEX_SURFACE_ID`, `OPERATIONS_ORGANIZATION_GRAPH_SURFACE_ID`. Use these typed constants instead of magic strings when overriding feature/surface IDs.
158
+ - `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.
159
+ - `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.
160
+ - `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.
161
+ - `node_modules/@elevasis/sdk/reference/scaffold/ui/feature-flags-and-gating.md`
162
+
163
+ Then inspect:
164
+
165
+ - `core/config/organization-model.ts`
166
+ - `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.
167
+ - `ui/src/routes/__root.tsx`
168
+ - `ui/src/lib/hooks/useFeatureAccess.ts`
169
+ - relevant nav config files
170
+
171
+ Verify with:
172
+
173
+ - published package docs for `@elevasis/core/organization-model`
174
+ - current scaffold routes and manifests
175
+
176
+ ### 4. Debugging / Impact Analysis
177
+
178
+ Examples: why is this automation disconnected, what does this workflow affect, what should I inspect before changing this resource.
179
+
180
+ Load first:
181
+
182
+ - `operations/src/README.md`
183
+ - `.claude/rules/active-change-index.md`
184
+ - 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
185
+ - 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`.
186
+
187
+ Then inspect:
188
+
189
+ - `operations/src/index.ts`
190
+ - resource definitions
191
+ - related UI route and feature files
192
+ - related core contracts
193
+ - pending HITL items via `elevasis-sdk queue:get <id>` before selecting or expiring an action
194
+ - recurring automation via `elevasis-sdk schedule:get <id>` before pausing, resuming, or cancelling it
195
+
196
+ Verify with:
197
+
198
+ - resource registration and relationship declarations
199
+ - generated maps
200
+ - package and source ownership boundaries
201
+ - `queue:*` or `schedule:*` CLI output when runtime state is part of the question
202
+
203
+ ### 5. Platform Extension / Package Contract Work
204
+
205
+ Examples: extend a published package contract, understand how a scaffold surface maps to `@elevasis/ui`, update a package-facing reference doc.
206
+
207
+ Load first:
208
+
209
+ - `.claude/rules/active-change-index.md`
210
+ - Glob `node_modules/@elevasis/sdk/reference/` for the current SDK package surface
211
+ - package README found via that glob
212
+
213
+ Then inspect:
214
+
215
+ - package source entrypoints
216
+ - package reference manifests
217
+ - scaffold files that consume that contract
218
+
219
+ Verify with:
220
+
221
+ - published package docs
222
+ - source exports
223
+ - scaffold consumption points
224
+
225
+ ## Boundary Resolution
226
+
227
+ Once the request is classified, determine which boundary owns the change:
228
+
229
+ - **Core boundary** -- semantics, aliases, labels, shared schemas
230
+ - **UI shell boundary** -- provider composition, manifests, navigation, route ownership
231
+ - **Operations boundary** -- deployable resource registration, workflow/agent contracts, topology
232
+ - **Package boundary** -- public exports, shared platform behavior, reusable contracts
233
+
234
+ If a task spans boundaries, start at the semantic boundary, then move to runtime composition, then to registration/deployment.
235
+
236
+ ## Main Boundaries
237
+
238
+ ### `core/config/organization-model.ts`
239
+
240
+ 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.
241
+
242
+ ### `ui/src/routes/__root.tsx`
243
+
244
+ 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.
245
+
246
+ ### `operations/src/index.ts`
247
+
248
+ The deployment aggregation point. Start here for what resources are registered and deployed as part of the scaffold.
249
+
250
+ ## Source of Truth
251
+
252
+ Trust these in order:
253
+
254
+ 1. Source code and published package docs
255
+ 2. Co-located boundary docs
256
+ 3. Generated structural maps
257
+ 4. Hand-authored template guidance
258
+ 5. In-progress architecture docs when `.claude/rules/active-change-index.md` says the area is actively evolving
259
+
260
+ If a hand-authored doc conflicts with source or published package docs, trust source and flag the doc drift.
261
+
262
+ ## Common Traps
263
+
264
+ - Do not assume feature directories are exhaustive without also checking `operations/src/index.ts` and `core/config/organization-model.ts` directly.
265
+ - Do not assume placeholder knowledge is sufficient for real client context. Read `identity.clientBrief` from the OrganizationModel (`core/config/organization-model.ts`).
266
+ - Do not trust stable docs blindly when `.claude/rules/active-change-index.md` flags related in-progress architecture work.
267
+ - Do not write `resume_context` into task-doc frontmatter. DB is canonical; write via `project:task:save` or the inline editor in Command Center.
268
+
269
+ ## Operations-Only Projects
270
+
271
+ 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.
272
+
273
+ **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.
274
+
275
+ **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.
276
+
277
+ **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.