@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,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