@elevasis/sdk 1.20.2 → 1.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/dist/cli.cjs +4220 -1583
  2. package/dist/index.d.ts +1035 -481
  3. package/dist/index.js +7381 -4187
  4. package/dist/node/index.d.ts +1 -3
  5. package/dist/node/index.js +40 -49
  6. package/dist/test-utils/index.d.ts +699 -123
  7. package/dist/test-utils/index.js +3826 -630
  8. package/dist/worker/index.js +3616 -442
  9. package/package.json +3 -3
  10. package/reference/_navigation.md +9 -7
  11. package/reference/_reference-manifest.json +1 -1
  12. package/reference/claude-config/hooks/post-edit-validate.mjs +98 -98
  13. package/reference/claude-config/hooks/scaffold-registry-reminder.mjs +188 -188
  14. package/reference/claude-config/hooks/tool-failure-recovery.mjs +73 -73
  15. package/reference/claude-config/registries/graph-skills.json +4 -4
  16. package/reference/claude-config/registries/knowledge-flags.json +0 -2
  17. package/reference/claude-config/rules/active-change-index.md +80 -80
  18. package/reference/claude-config/rules/agent-start-here.md +277 -273
  19. package/reference/claude-config/rules/deployment.md +57 -57
  20. package/reference/claude-config/rules/error-handling.md +56 -56
  21. package/reference/claude-config/rules/execution.md +40 -40
  22. package/reference/claude-config/rules/frontend.md +4 -4
  23. package/reference/claude-config/rules/observability.md +31 -31
  24. package/reference/claude-config/rules/operations.md +29 -17
  25. package/reference/claude-config/rules/organization-model.md +108 -40
  26. package/reference/claude-config/rules/organization-os.md +115 -113
  27. package/reference/claude-config/rules/package-taxonomy.md +33 -33
  28. package/reference/claude-config/rules/platform.md +42 -42
  29. package/reference/claude-config/rules/shared-types.md +49 -46
  30. package/reference/claude-config/rules/task-tracking.md +47 -47
  31. package/reference/claude-config/rules/ui.md +200 -200
  32. package/reference/claude-config/rules/vibe.md +235 -231
  33. package/reference/claude-config/scripts/statusline-command.js +18 -18
  34. package/reference/claude-config/settings.json +34 -34
  35. package/reference/claude-config/skills/deploy/{SKILL.md → skill.md} +156 -156
  36. package/reference/claude-config/skills/dsp/SKILL.md +66 -66
  37. package/reference/claude-config/skills/elevasis/SKILL.md +235 -235
  38. package/reference/claude-config/skills/explore/SKILL.md +6 -6
  39. package/reference/claude-config/skills/git-sync/SKILL.md +126 -126
  40. package/reference/claude-config/skills/knowledge/SKILL.md +330 -271
  41. package/reference/claude-config/skills/knowledge/operations/codify-level-a.md +100 -100
  42. package/reference/claude-config/skills/knowledge/operations/codify-level-b.md +159 -158
  43. package/reference/claude-config/skills/knowledge/operations/customers.md +109 -109
  44. package/reference/claude-config/skills/knowledge/operations/features.md +76 -113
  45. package/reference/claude-config/skills/knowledge/operations/goals.md +118 -118
  46. package/reference/claude-config/skills/knowledge/operations/identity.md +93 -93
  47. package/reference/claude-config/skills/knowledge/operations/labels.md +94 -89
  48. package/reference/claude-config/skills/knowledge/operations/offerings.md +109 -109
  49. package/reference/claude-config/skills/knowledge/operations/roles.md +99 -99
  50. package/reference/claude-config/skills/knowledge/operations/techStack.md +30 -30
  51. package/reference/claude-config/skills/project/SKILL.md +1088 -1088
  52. package/reference/claude-config/skills/run-ui/SKILL.md +73 -73
  53. package/reference/claude-config/skills/save/SKILL.md +3 -3
  54. package/reference/claude-config/skills/setup/SKILL.md +275 -275
  55. package/reference/claude-config/skills/status/SKILL.md +59 -59
  56. package/reference/claude-config/skills/submit-request/SKILL.md +180 -180
  57. package/reference/claude-config/skills/sync/SKILL.md +47 -47
  58. package/reference/claude-config/skills/tutorial/SKILL.md +259 -259
  59. package/reference/claude-config/skills/tutorial/progress-template.md +74 -74
  60. package/reference/claude-config/skills/tutorial/technical.md +1303 -1306
  61. package/reference/claude-config/skills/tutorial/vibe-coder.md +890 -890
  62. package/reference/claude-config/sync-notes/2026-04-22-git-sync-and-sync-notes.md +27 -27
  63. package/reference/claude-config/sync-notes/2026-04-22-lead-gen-deliverability-removal.md +30 -30
  64. package/reference/claude-config/sync-notes/2026-04-24-test-utils-and-template-tests.md +73 -73
  65. package/reference/claude-config/sync-notes/2026-04-24-ui-consolidation-and-sdk-cli-train.md +86 -86
  66. package/reference/claude-config/sync-notes/2026-04-25-auth-role-system-and-settings-roles.md +55 -55
  67. package/reference/claude-config/sync-notes/2026-04-27-crm-hitl-action-layer-cutover.md +97 -97
  68. package/reference/claude-config/sync-notes/2026-04-27-lead-gen-substrate-train.md +112 -112
  69. package/reference/claude-config/sync-notes/2026-04-29-crm-state-and-lead-gen-processing-status.md +93 -93
  70. package/reference/claude-config/sync-notes/2026-05-02-crm-ownership-next-action.md +58 -58
  71. package/reference/claude-config/sync-notes/2026-05-02-template-hardcode-workos-config.md +56 -56
  72. package/reference/claude-config/sync-notes/2026-05-04-elevasis-workspace.md +71 -71
  73. package/reference/claude-config/sync-notes/2026-05-04-knowledge-bundle.md +83 -83
  74. package/reference/claude-config/sync-notes/2026-05-04-template-skills-run-ui-and-tutorial.md +59 -59
  75. package/reference/claude-config/sync-notes/2026-05-05-list-builder.md +42 -42
  76. package/reference/claude-config/sync-notes/2026-05-06-crm-spine.md +60 -60
  77. package/reference/claude-config/sync-notes/2026-05-06-sdk-changes-release-train.md +37 -37
  78. package/reference/claude-config/sync-notes/2026-05-07-sdk-changes-release-train.md +34 -34
  79. package/reference/claude-config/sync-notes/2026-05-08-resource-governance-scaffold-guidance.md +38 -38
  80. package/reference/claude-config/sync-notes/2026-05-09-clients-domain.md +32 -32
  81. package/reference/claude-config/sync-notes/2026-05-09-command-system.md +33 -33
  82. package/reference/claude-config/sync-notes/2026-05-09-resource-governance-and-misc.md +69 -69
  83. package/reference/claude-config/sync-notes/2026-05-12-sdk-ready-release-train.md +30 -0
  84. package/reference/claude-config/sync-notes/2026-05-14-organization-model-ontology-refactor.md +42 -0
  85. package/reference/claude-config/sync-notes/README.md +43 -43
  86. package/reference/cli.mdx +808 -668
  87. package/reference/concepts.mdx +146 -146
  88. package/reference/deployment/api.mdx +297 -297
  89. package/reference/deployment/command-center.mdx +209 -209
  90. package/reference/deployment/index.mdx +195 -195
  91. package/reference/deployment/provided-features.mdx +107 -93
  92. package/reference/deployment/ui-execution.mdx +250 -250
  93. package/reference/examples/organization-model.ts +147 -84
  94. package/reference/framework/agent.mdx +156 -156
  95. package/reference/framework/index.mdx +195 -195
  96. package/reference/framework/interaction-guidance.mdx +182 -182
  97. package/reference/framework/memory.mdx +326 -326
  98. package/reference/framework/project-structure.mdx +282 -282
  99. package/reference/framework/tutorial-system.mdx +135 -135
  100. package/reference/getting-started.mdx +142 -142
  101. package/reference/index.mdx +106 -106
  102. package/reference/packages/core/src/README.md +14 -14
  103. package/reference/packages/core/src/business/README.md +2 -2
  104. package/reference/packages/core/src/knowledge/README.md +33 -32
  105. package/reference/packages/core/src/organization-model/README.md +149 -109
  106. package/reference/packages/core/src/test-utils/README.md +37 -37
  107. package/reference/packages/ui/src/api/README.md +18 -18
  108. package/reference/packages/ui/src/app/README.md +24 -24
  109. package/reference/packages/ui/src/auth/README.md +18 -18
  110. package/reference/packages/ui/src/components/README.md +24 -24
  111. package/reference/packages/ui/src/execution/README.md +16 -16
  112. package/reference/packages/ui/src/features/README.md +28 -28
  113. package/reference/packages/ui/src/graph/README.md +16 -16
  114. package/reference/packages/ui/src/hooks/README.md +23 -23
  115. package/reference/packages/ui/src/initialization/README.md +19 -19
  116. package/reference/packages/ui/src/knowledge/README.md +31 -31
  117. package/reference/packages/ui/src/organization/README.md +18 -18
  118. package/reference/packages/ui/src/profile/README.md +19 -19
  119. package/reference/packages/ui/src/provider/README.md +32 -32
  120. package/reference/packages/ui/src/router/README.md +18 -18
  121. package/reference/packages/ui/src/sse/README.md +13 -13
  122. package/reference/packages/ui/src/test-utils/README.md +7 -7
  123. package/reference/packages/ui/src/theme/README.md +23 -23
  124. package/reference/packages/ui/src/theme/presets/README.md +19 -19
  125. package/reference/packages/ui/src/types/README.md +16 -16
  126. package/reference/packages/ui/src/utils/README.md +18 -18
  127. package/reference/packages/ui/src/zustand/README.md +18 -18
  128. package/reference/platform-tools/adapters-integration.mdx +301 -301
  129. package/reference/platform-tools/adapters-platform.mdx +553 -553
  130. package/reference/platform-tools/index.mdx +217 -217
  131. package/reference/platform-tools/type-safety.mdx +82 -82
  132. package/reference/resources/index.mdx +349 -349
  133. package/reference/resources/patterns.mdx +449 -449
  134. package/reference/resources/types.mdx +116 -116
  135. package/reference/roadmap.mdx +165 -165
  136. package/reference/runtime.mdx +173 -173
  137. package/reference/scaffold/core/organization-graph.mdx +110 -89
  138. package/reference/scaffold/core/organization-model.mdx +226 -171
  139. package/reference/scaffold/index.mdx +67 -67
  140. package/reference/scaffold/operations/propagation-pipeline.md +77 -77
  141. package/reference/scaffold/operations/scaffold-maintenance.md +10 -10
  142. package/reference/scaffold/operations/workflow-recipes.md +138 -138
  143. package/reference/scaffold/recipes/add-a-feature.md +310 -88
  144. package/reference/scaffold/recipes/add-a-resource.md +137 -117
  145. package/reference/scaffold/recipes/customize-crm-actions.md +439 -439
  146. package/reference/scaffold/recipes/customize-knowledge-browser.md +384 -0
  147. package/reference/scaffold/recipes/customize-organization-model.md +281 -118
  148. package/reference/scaffold/recipes/extend-a-base-entity.md +8 -8
  149. package/reference/scaffold/recipes/extend-crm.md +40 -39
  150. package/reference/scaffold/recipes/extend-lead-gen.md +400 -401
  151. package/reference/scaffold/recipes/gate-by-feature-or-admin.md +118 -114
  152. package/reference/scaffold/recipes/index.md +47 -46
  153. package/reference/scaffold/recipes/query-the-knowledge-graph.md +227 -0
  154. package/reference/scaffold/reference/contracts.md +2389 -2121
  155. package/reference/scaffold/reference/feature-registry.md +9 -20
  156. package/reference/scaffold/reference/glossary.md +76 -76
  157. package/reference/scaffold/ui/composition-extensibility.mdx +233 -233
  158. package/reference/scaffold/ui/customization.md +243 -243
  159. package/reference/scaffold/ui/feature-flags-and-gating.md +46 -46
  160. package/reference/scaffold/ui/feature-shell.mdx +72 -72
  161. package/reference/scaffold/ui/recipes.md +221 -213
  162. package/reference/spine/spine-primer.md +96 -96
  163. package/reference/templates/index.mdx +47 -47
  164. package/reference/troubleshooting.mdx +223 -223
@@ -1,282 +1,282 @@
1
- ---
2
- title: Project Structure
3
- description: Each file scaffolded by elevasis-sdk init and its purpose in the development workflow
4
- loadWhen: "Understanding scaffolded files or project layout"
5
- ---
6
-
7
- `elevasis-sdk init` creates a complete workspace structure. This page explains what each file does and when you will interact with it.
8
-
9
- The current full-stack scaffold uses a workspace layout with `ui/`, `operations/`, `core/`, and a root `docs/` directory. When older examples refer to `src/shared/`, read that as the current `core/` package for cross-runtime types, schemas, and organization-model configuration.
10
-
11
- ---
12
-
13
- ## Source Files
14
-
15
- ### `operations/src/index.ts`
16
-
17
- The registry entry point for your workspace. This file imports OM resource governance from `core/config/organization-model.ts`, aggregates executable resources from domain barrel files, and re-exports them as a `DeploymentSpec` default export. It does not contain workflow logic itself -- its sole job is assembly:
18
-
19
- ```ts
20
- import type { DeploymentSpec } from '@elevasis/sdk'
21
- import { resourceGovernanceModel } from '@core/config/organization-model'
22
- import * as example from './example/index.js'
23
- import * as emailNotification from './email-notification/exports.js'
24
-
25
- const org: DeploymentSpec = {
26
- version: '0.1.0',
27
- organizationModel: resourceGovernanceModel,
28
- workflows: [...example.workflows, ...emailNotification.workflows],
29
- agents: [...example.agents, ...emailNotification.agents]
30
- }
31
- export default org
32
- ```
33
-
34
- Each domain directory exports `workflows` and `agents` arrays via an `index.ts` barrel. When you add a new domain, import it here and spread its arrays.
35
-
36
- ### `operations/src/email-notification/index.ts`
37
-
38
- A multi-step workflow demonstrating real platform API usage. Sends an email notification using the `notifications` adapter and chains steps with `StepType.LINEAR`. Shows the pattern for workflows that use platform tool adapters and pass data between steps.
39
-
40
- ### `operations/src/example/echo.ts`
41
-
42
- The starter workflow, scaffolded to demonstrate the per-file pattern: one workflow per file with its own Zod input/output schemas, config object, contract, and step handler. Replace this domain with your own when you're ready.
43
-
44
- ### `core/`
45
-
46
- Cross-runtime types, schemas, constants, and organization-model configuration shared between the UI and operations packages. Put contracts here when both runtimes need the same validation or labels without depending on app-specific code. Resource descriptors live in `core/config/organization-model.ts`.
47
-
48
- ### `operations/elevasis.config.ts`
49
-
50
- Project-level configuration. The scaffolded file includes commented-out options (`defaultStatus`, `dev.port`):
51
-
52
- ```ts
53
- import type { ElevasConfig } from '@elevasis/sdk'
54
-
55
- export default {
56
- // defaultStatus: 'dev', // Default status for new resources ('dev' | 'prod')
57
- // dev: { port: 5170 }, // Local API port (internal development only)
58
- } satisfies ElevasConfig
59
- ```
60
-
61
- ---
62
-
63
- ## Documentation
64
-
65
- ### `docs/index.md`
66
-
67
- The entry point for your workspace's documentation. Documentation files in `docs/` are deployed alongside your code during `elevasis-sdk deploy` and rendered in the Elevasis platform UI.
68
-
69
- Use MDX frontmatter to set page metadata:
70
-
71
- ```yaml
72
- ---
73
- title: Overview
74
- description: Documentation for this project
75
- order: 0
76
- ---
77
- ```
78
-
79
- Add more pages by creating additional `.mdx` files in `docs/`. Nested directories create sections: `docs/guides/setup.mdx` becomes a `guides/setup` page under your deployment's documentation.
80
-
81
- ### `docs/project-map.mdx`
82
-
83
- Auto-generated by `elevasis-sdk deploy` on every deploy and by `/meta fix` step 8. Contains a full project snapshot: organization, SDK version, template version, last deploy date, source domains, resource tables (workflows and agents), documentation index, SDK reference summary, commands/rules/skills, memory system listing, and configuration state. The agent reads this file at session start for project orientation.
84
-
85
- This file is fully auto-generated -- do not edit manually. Changes are overwritten on the next deploy.
86
-
87
- ### `docs/priorities.mdx`
88
-
89
- Created by the agent during your first goal discussion. Records current goals, priorities, and next steps for the workspace. Updated as goals change across sessions.
90
-
91
- This file is NOT scaffolded by default. The agent creates it the first time you discuss project goals or priorities in a session.
92
-
93
- ### `docs/in-progress/`
94
-
95
- Work-in-progress task documents managed by `/work`. Each file represents an active work item with objective, plan, progress markers, and resume context. This is separate from the Projects data model exposed through `elevasis-sdk project:*`. When all steps are complete, the agent suggests finalizing the task, which moves finished items to their permanent location in `docs/`.
96
-
97
- This directory is NOT deployed -- it is filtered out during the doc scan in `elevasis-sdk deploy`.
98
-
99
- ---
100
-
101
- ## Progressive Disclosure Directories
102
-
103
- The following directories are included in the scaffold:
104
-
105
- | Directory | Created by | When |
106
- | ------------------------------------ | --------------- | ------------------------------------------------------------------ |
107
- | `operations/src/example/` | Scaffold | Always -- echo starter workflow lives here (replace with your own) |
108
- | `operations/src/email-notification/` | Scaffold | Always -- multi-step notification workflow example |
109
- | `core/` | Scaffold | Always -- cross-runtime contracts, schemas, and organization model |
110
- | `ui/` | Scaffold | Always -- React frontend application |
111
- | `docs/` | Scaffold | Always |
112
- | `docs/in-progress/` | Agent | When you create a task doc for in-progress work |
113
- | `docs/resources.md` | `/deploy` skill | Auto-generated on every deploy |
114
- | `data/` | Agent | When you connect a database |
115
- | `scripts/` | Agent | When you need local scripts not deployed to the platform |
116
- | `operations/src/lib/` | Agent | When shared code exists between two or more workflows |
117
-
118
- This structure keeps the initial workspace minimal and adds directories only when they earn their place.
119
-
120
- ### `operations/src/lib/`
121
-
122
- Shared code directory for utilities used by multiple workflows within the operations package. In the current workspace scaffold, prefer the top-level `core/` package for cross-runtime contracts. Included in the esbuild bundle alongside workflow code.
123
-
124
- ### `data/`
125
-
126
- Created by the agent when you connect a database. Contains `schema.ts` which documents your database schema as TypeScript types. The agent reads this file to understand your data model when writing workflow steps that call the Supabase tool. Not deployed -- it is local documentation for the agent.
127
-
128
- ### `scripts/`
129
-
130
- Local utility scripts for tasks that do not run on the platform: database seeds, data migrations, one-off transformations, local testing helpers. Created on demand when you need a local script. Not deployed, not bundled.
131
-
132
- ---
133
-
134
- ## `elevasis-sdk deploy` Scope
135
-
136
- `elevasis-sdk deploy` touches only two directories:
137
-
138
- | Directory | Action | Deployed? |
139
- | ------------------- | ------------------------------------------------------------------------------------ | --------- |
140
- | `operations/src/` | Bundle into `dist/bundle.js` via esbuild (includes `operations/src/lib/` if present) | Yes |
141
- | `docs/` | Scan `.md` and `.mdx` files, upload as documentation | Yes |
142
- | `docs/in-progress/` | Ignored -- work-in-progress, not deployed | No |
143
- | `data/` | Ignored -- local documentation for the agent | No |
144
- | `scripts/` | Ignored -- local scripts, not deployed | No |
145
- | `.claude/` | Ignored -- local development only | No |
146
- | `ui/` | Ignored -- frontend application, deployed separately | No |
147
-
148
- ---
149
-
150
- ## Configuration Files
151
-
152
- ### `.env`
153
-
154
- Contains your `ELEVASIS_PLATFORM_KEY`. This file is gitignored. Never commit it.
155
-
156
- ### `.npmrc`
157
-
158
- Sets `auto-install-peers = true`. The SDK uses Zod as a peer dependency, so this ensures Zod installs automatically.
159
-
160
- ### `tsconfig.json`
161
-
162
- App-focused TypeScript configuration. It does not include `declaration` or `declarationMap` settings because your project is a deployable application, not a library.
163
-
164
- ### `.gitignore`
165
-
166
- Pre-configured to exclude:
167
-
168
- - `node_modules/` -- installed packages
169
- - `.env` -- API key
170
- - `dist/` -- generated by deploy, never commit
171
- - `__elevasis_worker.ts` -- temporary file generated during deployment
172
- - `.claude/settings.local.json` -- local Claude Code overrides
173
- - `.claude/memory/` -- your personal cross-session project memory (profile, errors, decisions)
174
-
175
- ---
176
-
177
- ## Claude Code Integration
178
-
179
- The `.claude/` directory and `CLAUDE.md` give Claude Code full awareness of the SDK, CLI, and your project structure from the first session.
180
-
181
- ### `CLAUDE.md`
182
-
183
- The most important file for AI-assisted development. It provides Claude Code with:
184
-
185
- - **Project orientation** -- what an Elevasis SDK project is and how it works
186
- - **Project structure** -- which files contain resources, documentation, and configuration
187
- - **SDK patterns** -- working code examples for descriptor-backed resource definitions, Zod schemas, and the `DeploymentSpec` export
188
- - **CLI reference** -- all commands with flags (`check`, `deploy`, `exec`, `resources`, `executions`, `execution`, `deployments`, `env list/set/remove`)
189
- - **Development rules** -- conventions the agent should enforce (source in `src/`, docs in `docs/`, use `@elevasis/sdk` types only)
190
-
191
- Do not remove or heavily edit `CLAUDE.md`. It is the primary context source that makes the slash commands work well.
192
-
193
- ### `.claude/settings.json`
194
-
195
- Configures Claude Code for the workspace: registers a PostToolUse formatting/type-check hook (runs after Write, Edit, and MultiEdit) and a PostToolUseFailure error recovery hook (runs after Bash failures).
196
-
197
- ### `.claude/memory/`
198
-
199
- Created when you run `/meta init` in Claude Code. The agent asks six onboarding questions about your organization, project goals, integrations, and experience level. Answers are stored here as markdown files and used to personalize subsequent sessions.
200
-
201
- ```
202
- .claude/memory/
203
- ├── index.md # Root index linking all memory topics
204
- ├── profile/ # Developer profile (created by /meta init)
205
- │ ├── index.md
206
- │ ├── identity.md # Organization, goals, integrations
207
- │ ├── skills.md # Skill dimensions and Growth Log
208
- │ └── preferences.md # Verbosity and guidance style
209
- ├── deployment-state.md # Latest deployment outcomes
210
- ├── decisions.md # Architecture decisions recorded over time
211
- └── errors/ # Error patterns and resolutions
212
- ```
213
-
214
- This directory is gitignored -- it is personal to you and not shared with collaborators. All cross-session knowledge (profile, errors, deployment state, decisions) lives here as plain markdown.
215
-
216
- ---
217
-
218
- ## Slash Commands
219
-
220
- The `.claude/skills/` directory contains skills covering the core development loop:
221
-
222
- - **`/setup`** -- First-time project setup: placeholder replacement, deps, verification
223
- - **`/deploy`** -- Full deploy pipeline: test, build, commit, push
224
- - **`/elevasis`** -- SDK operations: check, deploy, exec
225
- - **`/work`** -- Task tracking across sessions: auto-detects intent (create, save, resume); suggests complete
226
- - **`/status`** -- Quick project health check
227
- - **`/save`** -- Auto-manage docs from conversation context
228
- - **`/explore`** -- Codebase exploration anchored to docs
229
- - **`/continue`** -- Resume in-progress work from docs
230
- - **`/project`** -- Routes project management to the canonical `elevasis-sdk project:*` commands
231
- - **`/dsp`** -- Parallel agent dispatch for implementation tasks
232
- - **`/sync`** -- Pull latest, wipe caches, fresh reinstall
233
-
234
- Boundary summary:
235
-
236
- - `/project` updates shared project records
237
- - `/work` manages docs-backed work tracking
238
- - `/adev` handles implementation and execution work
239
-
240
- For detailed command documentation, see [Agent System](agent).
241
-
242
- ---
243
-
244
- ## File Classification
245
-
246
- Not all scaffolded files participate in template updates. Files fall into two categories:
247
-
248
- **SCAFFOLD_FILES total: 32**
249
-
250
- **INIT_ONLY** -- Written once during initial scaffold, never overwritten by updates:
251
-
252
- - `package.json`, `pnpm-workspace.yaml`, `tsconfig.json`
253
- - `.env`, `.npmrc`
254
- - `operations/src/index.ts`, `operations/src/email-notification/index.ts`, `operations/src/email-notification/exports.ts`, `operations/src/example/echo.ts`, `operations/src/example/index.ts`, `core/`
255
- - `docs/index.md`, `docs/in-progress/.gitkeep`
256
-
257
- **MANAGED** -- Written during initial scaffold and updated when the template evolves:
258
-
259
- - `operations/elevasis.config.ts`, `.gitignore`, `CLAUDE.md`, `.claude/settings.json`
260
- - Two hooks: `.claude/hooks/post-edit-validate.mjs`, `.claude/hooks/tool-failure-recovery.mjs`
261
- - Skills: `.claude/skills/work/SKILL.md`, `.claude/skills/elevasis/SKILL.md`, `.claude/skills/deploy/skill.md`, `.claude/skills/setup/SKILL.md`
262
- - Rule files: `.claude/rules/task-tracking.md`, `.claude/rules/platform.md`, `.claude/rules/error-handling.md`, `.claude/rules/docs.md`, `.claude/rules/execution.md`, `.claude/rules/observability.md`
263
- - One script: `.claude/scripts/statusline-command.js`
264
-
265
- ---
266
-
267
- ## File Reference
268
-
269
- | File | When You Edit It |
270
- | ------------------------------- | ------------------------------------------------------------------- |
271
- | `operations/src/index.ts` | Adding or removing resources |
272
- | `operations/src/<domain>/*.ts` | Writing and modifying workflow logic (organized by business domain) |
273
- | `docs/index.md` | Updating project documentation |
274
- | `docs/resources.md` | Never -- auto-generated by `/deploy` and `/elevasis deploy` |
275
- | `operations/elevasis.config.ts` | Changing project-level settings |
276
- | `.env` | Adding environment variables |
277
- | `CLAUDE.md` | Rarely -- only to add project-specific context |
278
- | `.claude/skills/*/SKILL.md` | Rarely -- skills work well as scaffolded |
279
-
280
- ---
281
-
282
- **Last Updated:** 2026-04-17
1
+ ---
2
+ title: Project Structure
3
+ description: Each file scaffolded by elevasis-sdk init and its purpose in the development workflow
4
+ loadWhen: "Understanding scaffolded files or project layout"
5
+ ---
6
+
7
+ `elevasis-sdk init` creates a complete workspace structure. This page explains what each file does and when you will interact with it.
8
+
9
+ The current full-stack scaffold uses a workspace layout with `ui/`, `operations/`, `core/`, and a root `docs/` directory. When older examples refer to `src/shared/`, read that as the current `core/` package for cross-runtime types, schemas, and organization-model configuration.
10
+
11
+ ---
12
+
13
+ ## Source Files
14
+
15
+ ### `operations/src/index.ts`
16
+
17
+ The registry entry point for your workspace. This file imports OM resource governance from `core/config/organization-model.ts`, aggregates executable resources from domain barrel files, and re-exports them as a `DeploymentSpec` default export. It does not contain workflow logic itself -- its sole job is assembly:
18
+
19
+ ```ts
20
+ import type { DeploymentSpec } from '@elevasis/sdk'
21
+ import { resourceGovernanceModel } from '@core/config/organization-model'
22
+ import * as example from './example/index.js'
23
+ import * as emailNotification from './email-notification/exports.js'
24
+
25
+ const org: DeploymentSpec = {
26
+ version: '0.1.0',
27
+ organizationModel: resourceGovernanceModel,
28
+ workflows: [...example.workflows, ...emailNotification.workflows],
29
+ agents: [...example.agents, ...emailNotification.agents]
30
+ }
31
+ export default org
32
+ ```
33
+
34
+ Each domain directory exports `workflows` and `agents` arrays via an `index.ts` barrel. When you add a new domain, import it here and spread its arrays.
35
+
36
+ ### `operations/src/email-notification/index.ts`
37
+
38
+ A multi-step workflow demonstrating real platform API usage. Sends an email notification using the `notifications` adapter and chains steps with `StepType.LINEAR`. Shows the pattern for workflows that use platform tool adapters and pass data between steps.
39
+
40
+ ### `operations/src/example/echo.ts`
41
+
42
+ The starter workflow, scaffolded to demonstrate the per-file pattern: one workflow per file with its own Zod input/output schemas, config object, contract, and step handler. Replace this domain with your own when you're ready.
43
+
44
+ ### `core/`
45
+
46
+ Cross-runtime types, schemas, constants, and organization-model configuration shared between the UI and operations packages. Put contracts here when both runtimes need the same validation or labels without depending on app-specific code. Resource descriptors live in `core/config/organization-model.ts`.
47
+
48
+ ### `operations/elevasis.config.ts`
49
+
50
+ Project-level configuration. The scaffolded file includes commented-out options (`defaultStatus`, `dev.port`):
51
+
52
+ ```ts
53
+ import type { ElevasConfig } from '@elevasis/sdk'
54
+
55
+ export default {
56
+ // defaultStatus: 'dev', // Default status for new resources ('dev' | 'prod')
57
+ // dev: { port: 5170 }, // Local API port (internal development only)
58
+ } satisfies ElevasConfig
59
+ ```
60
+
61
+ ---
62
+
63
+ ## Documentation
64
+
65
+ ### `docs/index.md`
66
+
67
+ The entry point for your workspace's documentation. Documentation files in `docs/` are deployed alongside your code during `elevasis-sdk deploy` and rendered in the Elevasis platform UI.
68
+
69
+ Use MDX frontmatter to set page metadata:
70
+
71
+ ```yaml
72
+ ---
73
+ title: Overview
74
+ description: Documentation for this project
75
+ order: 0
76
+ ---
77
+ ```
78
+
79
+ Add more pages by creating additional `.mdx` files in `docs/`. Nested directories create sections: `docs/guides/setup.mdx` becomes a `guides/setup` page under your deployment's documentation.
80
+
81
+ ### `docs/project-map.mdx`
82
+
83
+ Auto-generated by `elevasis-sdk deploy` on every deploy and by `/meta fix` step 8. Contains a full project snapshot: organization, SDK version, template version, last deploy date, source domains, resource tables (workflows and agents), documentation index, SDK reference summary, commands/rules/skills, memory system listing, and configuration state. The agent reads this file at session start for project orientation.
84
+
85
+ This file is fully auto-generated -- do not edit manually. Changes are overwritten on the next deploy.
86
+
87
+ ### `docs/priorities.mdx`
88
+
89
+ Created by the agent during your first goal discussion. Records current goals, priorities, and next steps for the workspace. Updated as goals change across sessions.
90
+
91
+ This file is NOT scaffolded by default. The agent creates it the first time you discuss project goals or priorities in a session.
92
+
93
+ ### `docs/in-progress/`
94
+
95
+ Work-in-progress task documents managed by `/work`. Each file represents an active work item with objective, plan, progress markers, and resume context. This is separate from the Projects data model exposed through `elevasis-sdk project:*`. When all steps are complete, the agent suggests finalizing the task, which moves finished items to their permanent location in `docs/`.
96
+
97
+ This directory is NOT deployed -- it is filtered out during the doc scan in `elevasis-sdk deploy`.
98
+
99
+ ---
100
+
101
+ ## Progressive Disclosure Directories
102
+
103
+ The following directories are included in the scaffold:
104
+
105
+ | Directory | Created by | When |
106
+ | ------------------------------------ | --------------- | ------------------------------------------------------------------ |
107
+ | `operations/src/example/` | Scaffold | Always -- echo starter workflow lives here (replace with your own) |
108
+ | `operations/src/email-notification/` | Scaffold | Always -- multi-step notification workflow example |
109
+ | `core/` | Scaffold | Always -- cross-runtime contracts, schemas, and organization model |
110
+ | `ui/` | Scaffold | Always -- React frontend application |
111
+ | `docs/` | Scaffold | Always |
112
+ | `docs/in-progress/` | Agent | When you create a task doc for in-progress work |
113
+ | `docs/resources.md` | `/deploy` skill | Auto-generated on every deploy |
114
+ | `data/` | Agent | When you connect a database |
115
+ | `scripts/` | Agent | When you need local scripts not deployed to the platform |
116
+ | `operations/src/lib/` | Agent | When shared code exists between two or more workflows |
117
+
118
+ This structure keeps the initial workspace minimal and adds directories only when they earn their place.
119
+
120
+ ### `operations/src/lib/`
121
+
122
+ Shared code directory for utilities used by multiple workflows within the operations package. In the current workspace scaffold, prefer the top-level `core/` package for cross-runtime contracts. Included in the esbuild bundle alongside workflow code.
123
+
124
+ ### `data/`
125
+
126
+ Created by the agent when you connect a database. Contains `schema.ts` which documents your database schema as TypeScript types. The agent reads this file to understand your data model when writing workflow steps that call the Supabase tool. Not deployed -- it is local documentation for the agent.
127
+
128
+ ### `scripts/`
129
+
130
+ Local utility scripts for tasks that do not run on the platform: database seeds, data migrations, one-off transformations, local testing helpers. Created on demand when you need a local script. Not deployed, not bundled.
131
+
132
+ ---
133
+
134
+ ## `elevasis-sdk deploy` Scope
135
+
136
+ `elevasis-sdk deploy` touches only two directories:
137
+
138
+ | Directory | Action | Deployed? |
139
+ | ------------------- | ------------------------------------------------------------------------------------ | --------- |
140
+ | `operations/src/` | Bundle into `dist/bundle.js` via esbuild (includes `operations/src/lib/` if present) | Yes |
141
+ | `docs/` | Scan `.md` and `.mdx` files, upload as documentation | Yes |
142
+ | `docs/in-progress/` | Ignored -- work-in-progress, not deployed | No |
143
+ | `data/` | Ignored -- local documentation for the agent | No |
144
+ | `scripts/` | Ignored -- local scripts, not deployed | No |
145
+ | `.claude/` | Ignored -- local development only | No |
146
+ | `ui/` | Ignored -- frontend application, deployed separately | No |
147
+
148
+ ---
149
+
150
+ ## Configuration Files
151
+
152
+ ### `.env`
153
+
154
+ Contains your `ELEVASIS_PLATFORM_KEY`. This file is gitignored. Never commit it.
155
+
156
+ ### `.npmrc`
157
+
158
+ Sets `auto-install-peers = true`. The SDK uses Zod as a peer dependency, so this ensures Zod installs automatically.
159
+
160
+ ### `tsconfig.json`
161
+
162
+ App-focused TypeScript configuration. It does not include `declaration` or `declarationMap` settings because your project is a deployable application, not a library.
163
+
164
+ ### `.gitignore`
165
+
166
+ Pre-configured to exclude:
167
+
168
+ - `node_modules/` -- installed packages
169
+ - `.env` -- API key
170
+ - `dist/` -- generated by deploy, never commit
171
+ - `__elevasis_worker.ts` -- temporary file generated during deployment
172
+ - `.claude/settings.local.json` -- local Claude Code overrides
173
+ - `.claude/memory/` -- your personal cross-session project memory (profile, errors, decisions)
174
+
175
+ ---
176
+
177
+ ## Claude Code Integration
178
+
179
+ The `.claude/` directory and `CLAUDE.md` give Claude Code full awareness of the SDK, CLI, and your project structure from the first session.
180
+
181
+ ### `CLAUDE.md`
182
+
183
+ The most important file for AI-assisted development. It provides Claude Code with:
184
+
185
+ - **Project orientation** -- what an Elevasis SDK project is and how it works
186
+ - **Project structure** -- which files contain resources, documentation, and configuration
187
+ - **SDK patterns** -- working code examples for descriptor-backed resource definitions, Zod schemas, and the `DeploymentSpec` export
188
+ - **CLI reference** -- all commands with flags (`check`, `deploy`, `exec`, `resources`, `executions`, `execution`, `deployments`, `env list/set/remove`)
189
+ - **Development rules** -- conventions the agent should enforce (source in `src/`, docs in `docs/`, use `@elevasis/sdk` types only)
190
+
191
+ Do not remove or heavily edit `CLAUDE.md`. It is the primary context source that makes the slash commands work well.
192
+
193
+ ### `.claude/settings.json`
194
+
195
+ Configures Claude Code for the workspace: registers a PostToolUse formatting/type-check hook (runs after Write, Edit, and MultiEdit) and a PostToolUseFailure error recovery hook (runs after Bash failures).
196
+
197
+ ### `.claude/memory/`
198
+
199
+ Created when you run `/meta init` in Claude Code. The agent asks six onboarding questions about your organization, project goals, integrations, and experience level. Answers are stored here as markdown files and used to personalize subsequent sessions.
200
+
201
+ ```
202
+ .claude/memory/
203
+ ├── index.md # Root index linking all memory topics
204
+ ├── profile/ # Developer profile (created by /meta init)
205
+ │ ├── index.md
206
+ │ ├── identity.md # Organization, goals, integrations
207
+ │ ├── skills.md # Skill dimensions and Growth Log
208
+ │ └── preferences.md # Verbosity and guidance style
209
+ ├── deployment-state.md # Latest deployment outcomes
210
+ ├── decisions.md # Architecture decisions recorded over time
211
+ └── errors/ # Error patterns and resolutions
212
+ ```
213
+
214
+ This directory is gitignored -- it is personal to you and not shared with collaborators. All cross-session knowledge (profile, errors, deployment state, decisions) lives here as plain markdown.
215
+
216
+ ---
217
+
218
+ ## Slash Commands
219
+
220
+ The `.claude/skills/` directory contains skills covering the core development loop:
221
+
222
+ - **`/setup`** -- First-time project setup: placeholder replacement, deps, verification
223
+ - **`/deploy`** -- Full deploy pipeline: test, build, commit, push
224
+ - **`/elevasis`** -- SDK operations: check, deploy, exec
225
+ - **`/work`** -- Task tracking across sessions: auto-detects intent (create, save, resume); suggests complete
226
+ - **`/status`** -- Quick project health check
227
+ - **`/save`** -- Auto-manage docs from conversation context
228
+ - **`/explore`** -- Codebase exploration anchored to docs
229
+ - **`/continue`** -- Resume in-progress work from docs
230
+ - **`/project`** -- Routes project management to the canonical `elevasis-sdk project:*` commands
231
+ - **`/dsp`** -- Parallel agent dispatch for implementation tasks
232
+ - **`/sync`** -- Pull latest, wipe caches, fresh reinstall
233
+
234
+ Boundary summary:
235
+
236
+ - `/project` updates shared project records
237
+ - `/work` manages docs-backed work tracking
238
+ - `/adev` handles implementation and execution work
239
+
240
+ For detailed command documentation, see [Agent System](agent).
241
+
242
+ ---
243
+
244
+ ## File Classification
245
+
246
+ Not all scaffolded files participate in template updates. Files fall into two categories:
247
+
248
+ **SCAFFOLD_FILES total: 32**
249
+
250
+ **INIT_ONLY** -- Written once during initial scaffold, never overwritten by updates:
251
+
252
+ - `package.json`, `pnpm-workspace.yaml`, `tsconfig.json`
253
+ - `.env`, `.npmrc`
254
+ - `operations/src/index.ts`, `operations/src/email-notification/index.ts`, `operations/src/email-notification/exports.ts`, `operations/src/example/echo.ts`, `operations/src/example/index.ts`, `core/`
255
+ - `docs/index.md`, `docs/in-progress/.gitkeep`
256
+
257
+ **MANAGED** -- Written during initial scaffold and updated when the template evolves:
258
+
259
+ - `operations/elevasis.config.ts`, `.gitignore`, `CLAUDE.md`, `.claude/settings.json`
260
+ - Two hooks: `.claude/hooks/post-edit-validate.mjs`, `.claude/hooks/tool-failure-recovery.mjs`
261
+ - Skills: `.claude/skills/work/SKILL.md`, `.claude/skills/elevasis/SKILL.md`, `.claude/skills/deploy/skill.md`, `.claude/skills/setup/SKILL.md`
262
+ - Rule files: `.claude/rules/task-tracking.md`, `.claude/rules/platform.md`, `.claude/rules/error-handling.md`, `.claude/rules/docs.md`, `.claude/rules/execution.md`, `.claude/rules/observability.md`
263
+ - One script: `.claude/scripts/statusline-command.js`
264
+
265
+ ---
266
+
267
+ ## File Reference
268
+
269
+ | File | When You Edit It |
270
+ | ------------------------------- | ------------------------------------------------------------------- |
271
+ | `operations/src/index.ts` | Adding or removing resources |
272
+ | `operations/src/<domain>/*.ts` | Writing and modifying workflow logic (organized by business domain) |
273
+ | `docs/index.md` | Updating project documentation |
274
+ | `docs/resources.md` | Never -- auto-generated by `/deploy` and `/elevasis deploy` |
275
+ | `operations/elevasis.config.ts` | Changing project-level settings |
276
+ | `.env` | Adding environment variables |
277
+ | `CLAUDE.md` | Rarely -- only to add project-specific context |
278
+ | `.claude/skills/*/SKILL.md` | Rarely -- skills work well as scaffolded |
279
+
280
+ ---
281
+
282
+ **Last Updated:** 2026-04-17