@elevasis/sdk 1.6.0 → 1.8.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 (53) hide show
  1. package/dist/cli.cjs +527 -4564
  2. package/dist/index.d.ts +72 -16
  3. package/package.json +2 -2
  4. package/reference/claude-config/hooks/post-edit-validate.mjs +0 -11
  5. package/reference/claude-config/hooks/scaffold-registry-reminder.mjs +188 -0
  6. package/reference/claude-config/logs/pre-edit-vibe-gate.log +40 -0
  7. package/reference/claude-config/logs/scaffold-registry-reminder.log +17 -0
  8. package/reference/claude-config/rules/active-change-index.md +80 -0
  9. package/reference/claude-config/rules/agent-start-here.md +254 -0
  10. package/reference/claude-config/rules/deployment.md +0 -1
  11. package/reference/claude-config/rules/observability.md +2 -2
  12. package/reference/claude-config/rules/operations.md +64 -0
  13. package/reference/claude-config/rules/organization-model.md +44 -0
  14. package/reference/claude-config/rules/organization-os.md +56 -11
  15. package/reference/claude-config/rules/task-tracking.md +4 -4
  16. package/reference/claude-config/rules/ui.md +202 -0
  17. package/reference/claude-config/rules/vibe.md +202 -0
  18. package/reference/claude-config/settings.json +4 -0
  19. package/reference/claude-config/skills/configure/SKILL.md +98 -0
  20. package/reference/claude-config/skills/configure/operations/codify-level-a.md +100 -0
  21. package/reference/claude-config/skills/configure/operations/codify-level-b.md +158 -0
  22. package/reference/claude-config/skills/configure/operations/customers.md +150 -0
  23. package/reference/claude-config/skills/configure/operations/features.md +161 -0
  24. package/reference/claude-config/skills/configure/operations/goals.md +147 -0
  25. package/reference/claude-config/skills/configure/operations/identity.md +133 -0
  26. package/reference/claude-config/skills/configure/operations/labels.md +128 -0
  27. package/reference/claude-config/skills/configure/operations/offerings.md +159 -0
  28. package/reference/claude-config/skills/configure/operations/roles.md +153 -0
  29. package/reference/claude-config/skills/configure/operations/techStack.md +139 -0
  30. package/reference/claude-config/skills/deploy/SKILL.md +3 -13
  31. package/reference/claude-config/skills/dsp/SKILL.md +2 -2
  32. package/reference/claude-config/skills/elevasis/SKILL.md +0 -4
  33. package/reference/claude-config/skills/explore/SKILL.md +5 -5
  34. package/reference/claude-config/skills/project/SKILL.md +1 -1
  35. package/reference/claude-config/skills/save/SKILL.md +5 -19
  36. package/reference/claude-config/skills/setup/SKILL.md +105 -40
  37. package/reference/claude-config/skills/status/SKILL.md +2 -3
  38. package/reference/claude-config/skills/submit-request/SKILL.md +1 -1
  39. package/reference/deployment/command-center.mdx +0 -17
  40. package/reference/framework/project-structure.mdx +1 -5
  41. package/reference/packages/core/src/organization-model/README.md +16 -12
  42. package/reference/packages/ui/src/hooks/README.md +1 -2
  43. package/reference/scaffold/core/organization-graph.mdx +1 -0
  44. package/reference/scaffold/core/organization-model.mdx +84 -19
  45. package/reference/scaffold/operations/propagation-pipeline.md +10 -11
  46. package/reference/scaffold/operations/scaffold-maintenance.md +1 -4
  47. package/reference/scaffold/recipes/add-a-feature.md +1 -1
  48. package/reference/scaffold/recipes/add-a-resource.md +3 -12
  49. package/reference/scaffold/recipes/customize-organization-model.md +5 -5
  50. package/reference/scaffold/recipes/gate-by-feature-or-admin.md +3 -3
  51. package/reference/scaffold/reference/contracts.md +115 -7
  52. package/reference/scaffold/reference/glossary.md +25 -4
  53. package/reference/claude-config/rules/docs.md +0 -26
@@ -0,0 +1,254 @@
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
+ ## First Action: Check Active Projects
10
+
11
+ 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.
12
+
13
+ 1. **Portfolio snapshot.** Run this first to see what is active or blocked:
14
+
15
+ ```bash
16
+ pnpm elevasis-sdk project:list --status active --pretty
17
+ pnpm elevasis-sdk project:list --status blocked --pretty
18
+ ```
19
+
20
+ 2. **Resume-style asks.** If the user says "continue", "pick up", references a client name, or names a task/milestone, resolve it via:
21
+
22
+ ```bash
23
+ pnpm elevasis-sdk project:work <query>
24
+ ```
25
+
26
+ `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).
27
+
28
+ 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.
29
+
30
+ ### Resume Context Source of Truth
31
+
32
+ `resume_context` lives in the `prj_tasks` table in the database, not in task-doc frontmatter. There is one source of truth:
33
+
34
+ - **Humans write** via the inline resume-context editor on the Project Detail page in Command Center.
35
+ - **Agents and the CLI write** via `pnpm elevasis-sdk project:task:save <task-id> --current-state ... --next-steps ... --files-modified ...`.
36
+ - **Readers** consume it via `project:work <query>` or `project:task:resume <id>`.
37
+
38
+ Do not write resume state into markdown frontmatter. Task-doc frontmatter is limited to `title`, `description`, and `status`.
39
+
40
+ ### Session-Start Dashboard
41
+
42
+ 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.
43
+
44
+ ## Template Surfaces
45
+
46
+ 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:
47
+
48
+ - `ui/` -- React frontend app and shell composition
49
+ - `operations/` -- Elevasis SDK resources deployed to the platform
50
+ - `foundations/` -- runtime-agnostic shared contracts and organization model adaptation
51
+ - `.claude/` -- local agent rules, skills, and hooks
52
+ - `client-workspace/` -- optional separate knowledge workspace for richer team knowledge management
53
+ - `node_modules/@elevasis/sdk/reference/scaffold/` -- SDK reference scaffold: canonical recipes, UI patterns, gating model, contracts, and glossary. Entry point: `index.mdx`.
54
+
55
+ ## Discovery Order
56
+
57
+ Use this order unless a more specific doc tells you otherwise:
58
+
59
+ 1. Complete the "First Action: Check Active Projects" flow above.
60
+ 2. Read `CLAUDE.md` for project rules, command surface, and navigation pointers.
61
+ 3. Read this rule and classify the task using the Task Classes below.
62
+ 4. Read `identity.clientBrief` from the OrganizationModel (`operations/foundations/config/organization-model.ts`) for organization context and naming.
63
+ 5. Read the relevant structural map:
64
+ - Glob `node_modules/@elevasis/sdk/reference/` for published package surfaces
65
+ - Glob `operations/resources/**` for source, or run `pnpm elevasis-sdk project:list --pretty` for live DB state
66
+ 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.
67
+ 7. Drill into the co-located local explainer for the abstraction boundary you are changing.
68
+ 8. Check the `.claude/rules/active-change-index.md` rule before trusting stable assumptions in areas that are under active architecture work.
69
+
70
+ ## SDK Reference Scaffold
71
+
72
+ Universal scaffold documentation (recipes, patterns, architecture, reference) has been centralized in the SDK reference. After `pnpm install`, the entry point is:
73
+
74
+ `node_modules/@elevasis/sdk/reference/scaffold/index.mdx`
75
+
76
+ This index links to all scaffold docs including pathway recipes, UI patterns, core architecture, and auto-generated contracts/feature registry.
77
+
78
+ For task classes that involve feature integration, resource authoring, or UI customization, start with the scaffold index rather than local docs.
79
+
80
+ ## Task Classes
81
+
82
+ Classify the request, then follow the load/inspect/verify sequence for that class.
83
+
84
+ ### 1. UI / Shell Work
85
+
86
+ Examples: add a page, change sidebar behavior, adjust feature visibility, update dashboard labels.
87
+
88
+ Load first:
89
+
90
+ - `node_modules/@elevasis/sdk/reference/scaffold/index.mdx` (scaffold index -- UI recipes, feature flags, customization)
91
+ - `.claude/rules/ui.md`
92
+ - `ui/src/routes/README.md`
93
+ - `foundations/config/README.md`
94
+ - `node_modules/@elevasis/sdk/reference/scaffold/ui/recipes.md` -- specifically recipe 6 when building a "run this resource" surface
95
+
96
+ Then inspect:
97
+
98
+ - `ui/src/routes/__root.tsx`
99
+ - `ui/src/config/*`
100
+ - relevant `ui/src/routes/*`
101
+ - relevant `ui/src/features/*`
102
+ - `foundations/config/organization-model.ts`
103
+
104
+ Verify with:
105
+
106
+ - route and manifest source
107
+ - any relevant package README from `packages/ui`
108
+
109
+ ### 2. Workflow / Agent / Operations Work
110
+
111
+ Examples: add a workflow, update an agent, change resource registration, understand deployable resources.
112
+
113
+ Load first:
114
+
115
+ - `node_modules/@elevasis/sdk/reference/scaffold/index.mdx` (scaffold index -- workflow recipes, resource authoring)
116
+ - `.claude/rules/operations.md`
117
+ - `operations/src/README.md`
118
+
119
+ Then inspect:
120
+
121
+ - `operations/src/index.ts`
122
+ - relevant `operations/src/<feature>/*`
123
+ - `foundations/types/index.ts` -- workflow input/output Zod schemas
124
+ - `foundations/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.
125
+ - `operations/elevasis.config.ts`
126
+
127
+ Verify with:
128
+
129
+ - Glob `operations/resources/**` for local source files, or run `pnpm elevasis-sdk project:list --pretty` for live DB state
130
+ - local SDK guidance in `.claude/skills/elevasis/SKILL.md`
131
+
132
+ ### 3. Organization Model / Feature Access Work
133
+
134
+ Examples: rename a feature area, change quick access surfaces, map new business terms into the shell, adjust feature gating.
135
+
136
+ Load first:
137
+
138
+ - `node_modules/@elevasis/sdk/reference/scaffold/index.mdx` (scaffold index -- contracts, gating patterns, glossary)
139
+ - `foundations/config/README.md`
140
+ - `node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md`
141
+ - 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.
142
+ - `node_modules/@elevasis/sdk/reference/scaffold/ui/feature-flags-and-gating.md`
143
+
144
+ Then inspect:
145
+
146
+ - `foundations/config/organization-model.ts`
147
+ - `foundations/config/organization-model.examples.ts` -- 5 reference patterns: branding override, CRM pipeline stage customization, lead-gen lifecycle customization, resource mapping registration, custom feature declaration. Not imported anywhere -- pure reference. Start here for the override pattern when extending the org model.
148
+ - `ui/src/routes/__root.tsx`
149
+ - `ui/src/lib/hooks/useFeatureAccess.ts`
150
+ - relevant nav config files
151
+
152
+ Verify with:
153
+
154
+ - published package docs for `@elevasis/core/organization-model`
155
+ - current scaffold routes and manifests
156
+
157
+ ### 4. Debugging / Impact Analysis
158
+
159
+ Examples: why is this automation disconnected, what does this workflow affect, what should I inspect before changing this resource.
160
+
161
+ Load first:
162
+
163
+ - `operations/src/README.md`
164
+ - `.claude/rules/active-change-index.md`
165
+ - Glob `operations/resources/**` for source, or run `pnpm elevasis-sdk project:list --pretty` for live DB state
166
+
167
+ Then inspect:
168
+
169
+ - `operations/src/index.ts`
170
+ - resource definitions
171
+ - related UI route and feature files
172
+ - related foundations contracts
173
+
174
+ Verify with:
175
+
176
+ - resource registration and relationship declarations
177
+ - generated maps
178
+ - package and source ownership boundaries
179
+
180
+ ### 5. Platform Extension / Package Contract Work
181
+
182
+ Examples: extend a published package contract, understand how a scaffold surface maps to `@elevasis/ui`, update a package-facing reference doc.
183
+
184
+ Load first:
185
+
186
+ - `.claude/rules/active-change-index.md`
187
+ - Glob `node_modules/@elevasis/sdk/reference/` for the current SDK package surface
188
+ - package README found via that glob
189
+
190
+ Then inspect:
191
+
192
+ - package source entrypoints
193
+ - package reference manifests
194
+ - scaffold files that consume that contract
195
+
196
+ Verify with:
197
+
198
+ - published package docs
199
+ - source exports
200
+ - scaffold consumption points
201
+
202
+ ## Boundary Resolution
203
+
204
+ Once the request is classified, determine which boundary owns the change:
205
+
206
+ - **Foundations boundary** -- semantics, aliases, labels, shared schemas
207
+ - **UI shell boundary** -- provider composition, manifests, navigation, route ownership
208
+ - **Operations boundary** -- deployable resource registration, workflow/agent contracts, topology
209
+ - **Package boundary** -- public exports, shared platform behavior, reusable contracts
210
+
211
+ If a task spans boundaries, start at the semantic boundary, then move to runtime composition, then to registration/deployment.
212
+
213
+ ## Main Boundaries
214
+
215
+ ### `foundations/config/organization-model.ts`
216
+
217
+ 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.
218
+
219
+ ### `ui/src/routes/__root.tsx`
220
+
221
+ 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.
222
+
223
+ ### `operations/src/index.ts`
224
+
225
+ The deployment aggregation point. Start here for what resources are registered and deployed as part of the scaffold.
226
+
227
+ ## Source of Truth
228
+
229
+ Trust these in order:
230
+
231
+ 1. Source code and published package docs
232
+ 2. Co-located boundary docs
233
+ 3. Generated structural maps
234
+ 4. Hand-authored template guidance
235
+ 5. In-progress architecture docs when `.claude/rules/active-change-index.md` says the area is actively evolving
236
+
237
+ If a hand-authored doc conflicts with source or published package docs, trust source and flag the doc drift.
238
+
239
+ ## Common Traps
240
+
241
+ - Do not assume `operations/resources/**` is exhaustive without also checking `operations/src/index.ts` directly.
242
+ - Do not assume placeholder knowledge is sufficient for real client context. Read `identity.clientBrief` from the OrganizationModel (`operations/foundations/config/organization-model.ts`).
243
+ - Do not trust stable docs blindly when `.claude/rules/active-change-index.md` flags related in-progress architecture work.
244
+ - Do not write `resume_context` into task-doc frontmatter. DB is canonical; write via `project:task:save` or the inline editor in Command Center.
245
+
246
+ ## Operations-Only Projects
247
+
248
+ Some projects derived from this template are operations-only. They have `operations/` (or a top-level `src/`) but NO `ui/`, NO `foundations/config/organization-model.ts`, and NO frontend. Finding none of these is not missing scaffolding -- it is by design.
249
+
250
+ **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.
251
+
252
+ **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.
253
+
254
+ **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.
@@ -33,7 +33,6 @@ Deploy accepts `--major`, `--minor`, `--patch` flags to bump the deployment vers
33
33
 
34
34
  1. **Bundle:** esbuild compiles `src/index.ts` + all dependencies into a single self-contained CJS file. No `node_modules` needed at runtime.
35
35
  2. **Metadata:** Resource definitions, Zod schemas (converted to JSON Schema), relationships, triggers.
36
- 3. **Docs:** All `.md` and `.mdx` files in `docs/` (max 100KB per file, 1MB total). The SDK scans the directory configured as `docsDir` in `elevasis.config.ts` (defaults to `docs/`, set to `../docs/` in this template). Two auto-generated files are regenerated by `/deploy` and `/elevasis deploy` before upload: `docs/index.md` (navigation hub) and `docs/resources.md` (platform resource inventory).
37
36
 
38
37
  ## Environment
39
38
 
@@ -22,8 +22,8 @@ paths:
22
22
  ## Inspecting Executions
23
23
 
24
24
  ```bash
25
- pnpm exec elevasis-sdk execution <resourceId> <executionId>
26
- pnpm exec elevasis-sdk executions <resourceId>
25
+ pnpm elevasis-sdk execution <resourceId> <executionId>
26
+ pnpm elevasis-sdk executions <resourceId>
27
27
  ```
28
28
 
29
29
  ## Detailed Reference
@@ -0,0 +1,64 @@
1
+ ---
2
+ description: Platform workflows, agents, resource definitions, and deployment for the operations/ surface
3
+ paths:
4
+ - operations/**
5
+ ---
6
+
7
+ # Operations
8
+
9
+ **Status:** Stable
10
+
11
+ ## Overview
12
+
13
+ The `operations/` directory contains platform resources and deployment metadata that deploy to the Elevasis platform. It is a standalone TypeScript project with its own `package.json`, `tsconfig.json`, and dependencies.
14
+
15
+ **Discovering deployed resources:** Glob `operations/resources/**` for local source files, or run `pnpm elevasis-sdk project:list --pretty` against the live DB for the deployed surface. No static resource map exists -- the file system and CLI are authoritative.
16
+
17
+ ## Echo Workflow (Starter Example)
18
+
19
+ **Location:** `operations/src/example/echo.ts`
20
+
21
+ The echo workflow accepts a message string and returns it unchanged. Its purpose is the wiring, not the logic: input and output schemas are defined in `foundations/types/index.ts` and imported by both the workflow and the frontend.
22
+
23
+ ```
24
+ foundations/types/index.ts -- defines echoInputSchema, echoOutputSchema
25
+ operations/src/example/echo.ts -- imports schemas for workflow contract
26
+ ui/src/routes/ -- imports schemas for form validation and display
27
+ ```
28
+
29
+ The workflow is registered in `operations/src/index.ts` as part of the `example` group and deployed with `pnpm -C operations deploy`.
30
+
31
+ ## Adding a New Workflow
32
+
33
+ 1. **Define the contract in `foundations/`** -- Add Zod schemas and inferred types to `foundations/types/index.ts` (or a new file under `foundations/types/`).
34
+
35
+ 2. **Implement the workflow in `operations/src/`** -- Create a new directory under `operations/src/` for the feature. Export the workflow from its `index.ts` and register it in `operations/src/index.ts`.
36
+
37
+ 3. **Add the UI in `ui/src/routes/`** -- Create a new route file. Use TanStack Query to call the workflow execution endpoint. Import schemas from `@foundation/types` for validation and type inference.
38
+
39
+ 4. **Deploy and verify:**
40
+
41
+ ```bash
42
+ pnpm -C operations check # validate resource definitions
43
+ pnpm -C operations deploy # deploy to dev
44
+ ```
45
+
46
+ ## Resource Registry
47
+
48
+ `operations/src/index.ts` default-exports a `DeploymentSpec` with `version`, `workflows`, `agents`, and optional topology-oriented metadata such as `triggers`, `integrations`, `relationships`, `humanCheckpoints`, and `externalResources`. Each feature group exports `workflows` and `agents` arrays from its own `index.ts`, spread into the top-level spec.
49
+
50
+ When you need breadth first, read:
51
+
52
+ - `operations/src/README.md` for the source boundary and drill-down guidance
53
+ - Glob `operations/resources/**` or run `pnpm elevasis-sdk project:list --pretty` for the live deployed surface
54
+
55
+ ## Commands
56
+
57
+ | Command | Purpose |
58
+ | -------------------------------- | ----------------------------- |
59
+ | `pnpm -C operations check` | Validate resource definitions |
60
+ | `pnpm -C operations check-types` | TypeScript type-check |
61
+ | `pnpm -C operations deploy` | Deploy to dev |
62
+ | `pnpm -C operations deploy:prod` | Deploy to production |
63
+
64
+ Always run `check` before `deploy`.
@@ -0,0 +1,44 @@
1
+ ---
2
+ description: Edits to the canonical organization model go through /configure
3
+ paths:
4
+ - operations/foundations/config/organization-model.ts
5
+ - operations/foundations/config/organization-model.override.ts
6
+ - operations/foundations/config/extensions/**/*.ts
7
+ ---
8
+
9
+ # Organization Model Edit Guide
10
+
11
+ `foundations/config/organization-model.ts` is the single source of truth for this
12
+ project's organizational identity -- it encodes customers, offerings, roles, goals,
13
+ features, statuses, and resource mappings that agents, workflows, and the UI shell all
14
+ consume at runtime.
15
+
16
+ ## Preferred Entry Point: `/configure`
17
+
18
+ Direct edits to `organization-model.ts` are discouraged. Instead, use `/configure` (or
19
+ `/configure <domain>`) to run the read → propose → confirm → write → validate ceremony:
20
+
21
+ 1. The skill reads the current model so proposals start from ground truth.
22
+ 2. It drafts only the specific block being changed, leaving everything else intact.
23
+ 3. The user confirms before any file is written.
24
+ 4. After writing, `pnpm -C operations check-types` runs and `OrganizationModelSchema.parse()`
25
+ is verified. On failure the file is rolled back automatically.
26
+
27
+ Use `/configure <domain>` for targeted edits: `identity`, `customers`, `offerings`,
28
+ `roles`, `goals`, `techStack`, `features`, or `labels`.
29
+
30
+ ## Runtime Validation
31
+
32
+ The model is validated at startup via `resolveOrganizationModel()` followed by
33
+ `OrganizationModelSchema.parse()`. Cross-reference checks (segment ID refs in offerings,
34
+ role reporting lines, period ordering in goals) are runtime-only and not caught by tsc
35
+ alone -- always let the ceremony run both checks before treating a change as complete.
36
+
37
+ ## Extension Files
38
+
39
+ New Zod extension files under `foundations/config/extensions/` are Level B codify
40
+ operations. Route these through `/configure <domain>` as well -- the skill gates Level B
41
+ to explicit user confirmation before scaffolding a new `.ts` file.
42
+
43
+ This is a soft guide, not a hard block. The ceremony exists to prevent silent schema
44
+ drift and to keep the model's editorial history visible.
@@ -5,12 +5,34 @@ Organization OS is the semantic contract layer defining how organizations, featu
5
5
  ## Key Files in This Project
6
6
 
7
7
  - `foundations/config/organization-model.ts` -- project-specific org model definition (calls `defineOrganizationModel` + `resolveOrganizationModel`)
8
- - `foundations/config/organization-model.examples.ts` -- 5 reference patterns: branding, CRM stages, lead-gen stages, resource mappings, custom features. Pure reference -- not imported anywhere. Read this when customizing the org model.
8
+ - `foundations/config/organization-model.examples.ts` -- reference patterns for all 14 domains: branding, identity, customers, offerings, roles, goals, sales stages, prospecting stages, resource mappings with techStack, custom features, statuses, and open-placement navigation groups. Pure reference -- not imported anywhere. Read this when customizing the org model.
9
9
  - `foundations/types/entities.ts` -- typed entity contracts (Project, Deal, etc.). Extends `BaseProject`, `BaseDeal` from `@elevasis/core/entities` with project-specific metadata. Read this when authoring workflows that operate on these entities.
10
10
  - `ui/src/routes/__root.tsx` -- wires `ElevasisFeaturesProvider` with `canonicalOrganizationModel`
11
11
  - `ui/src/app-config.ts` -- references the org model
12
12
  - `operations/src/index.ts` -- `DeploymentSpec` registry for workflows and agents
13
13
 
14
+ ## Domain Overview
15
+
16
+ As of the 2026-04-20 expansion, `OrganizationModel` contains 14 top-level domains:
17
+
18
+ **Platform configuration:** `features`, `branding`, `navigation`, `sales` (formerly `crm`), `prospecting` (formerly `leadGen`), `projects` (formerly `delivery`), `resourceMappings`
19
+
20
+ **Organizational reality:** `identity`, `customers`, `offerings`, `roles`, `goals`
21
+
22
+ **Vibe layer:** `statuses`, `operations`
23
+
24
+ The `resourceMappings` entries may carry an optional `techStack` extension (`platform`, `purpose`, `credentialStatus`, `isSystemOfRecord`) without introducing a new top-level domain.
25
+
26
+ ### Domain Rename Note
27
+
28
+ Three field names changed in the 2026-04-20 expansion. Feature ID constants and consumer-facing feature IDs are unchanged:
29
+
30
+ | Old field | New field | Feature ID (unchanged) | Constant (unchanged) |
31
+ | ---------- | ------------- | ---------------------- | --------------------- |
32
+ | `crm` | `sales` | `'crm'` | `CRM_FEATURE_ID` |
33
+ | `leadGen` | `prospecting` | `'lead-gen'` | `LEAD_GEN_FEATURE_ID` |
34
+ | `delivery` | `projects` | `'projects'` | `PROJECTS_FEATURE_ID` |
35
+
14
36
  ## Reference Documentation
15
37
 
16
38
  Full Organization OS documentation ships with the SDK and is available locally after `pnpm install`:
@@ -20,7 +42,7 @@ Full Organization OS documentation ships with the SDK and is available locally a
20
42
  All paths under `node_modules/@elevasis/sdk/reference/scaffold/`:
21
43
 
22
44
  - `node_modules/@elevasis/sdk/reference/scaffold/index.mdx` -- scaffold root and navigation
23
- - `node_modules/@elevasis/sdk/reference/scaffold/core/organization-model.mdx` -- semantic contract, schema, authoring helpers
45
+ - `node_modules/@elevasis/sdk/reference/scaffold/core/organization-model.mdx` -- semantic contract, all 14 domains, adapter authoring, validation gate, `/configure` entry point
24
46
  - `node_modules/@elevasis/sdk/reference/scaffold/core/organization-graph.mdx` -- graph derivation, node/edge taxonomy, lenses
25
47
  - `node_modules/@elevasis/sdk/reference/scaffold/ui/feature-shell.mdx` -- FeatureModule manifest, provider runtime
26
48
  - `node_modules/@elevasis/sdk/reference/scaffold/ui/composition-extensibility.mdx` -- layout primitives, router abstraction
@@ -39,24 +61,47 @@ All paths under `node_modules/@elevasis/sdk/reference/scaffold/`:
39
61
 
40
62
  ### Local Project Docs
41
63
 
42
- - `docs/platform-navigation-map.md` -- auto-generated cross-package reference map
43
- - `docs/resources.md` -- auto-generated project resource topology
44
- - `docs/agent-start-here.md` -- canonical first-read for agents (includes task-class routing)
64
+ - `.claude/rules/agent-start-here.md` -- canonical first-read for agents (includes task-class routing)
45
65
 
46
66
  ## Published Subpaths and Constants
47
67
 
48
68
  - `@elevasis/core/organization-model` -- the curated organization-model barrel. Exports `defineOrganizationModel`, `resolveOrganizationModel`, `OrganizationModelSchema`, `DEFAULT_ORGANIZATION_MODEL`, organization-model types, and typed feature/surface constants.
49
69
  - Feature IDs: `CRM_FEATURE_ID`, `LEAD_GEN_FEATURE_ID`, `PROJECTS_FEATURE_ID`, `OPERATIONS_FEATURE_ID`, `MONITORING_FEATURE_ID`, `SETTINGS_FEATURE_ID`, `SEO_FEATURE_ID`
50
70
  - Headline surface IDs: `CRM_PIPELINE_SURFACE_ID`, `LEAD_GEN_LISTS_SURFACE_ID`, `PROJECTS_INDEX_SURFACE_ID`, `OPERATIONS_ORGANIZATION_GRAPH_SURFACE_ID`
51
- - Use these constants instead of magic strings when overriding the org model.
71
+ - Reality domain types: `OrganizationModelIdentity`, `OrganizationModelCustomers`, `OrganizationModelCustomerSegment`, `OrganizationModelOfferings`, `OrganizationModelProduct`, `OrganizationModelRoles`, `OrganizationModelRole`, `OrganizationModelGoals`, `OrganizationModelObjective`, `OrganizationModelKeyResult`
72
+ - Vibe domain types: `OrganizationModelStatuses`, `OrganizationModelOperations`
73
+ - TechStack: `TechStackEntrySchema`, `OrganizationModelTechStackEntry`
74
+ - Use constants instead of magic strings when overriding the org model.
52
75
  - `@elevasis/core/entities` -- entity contracts barrel. Exports `BaseProject`, `BaseProjectSchema`, `BaseProjectInput` and the equivalents for `Milestone`, `Task`, `Deal`, `Company`, `Contact`. Each base interface is generic over a `\<TMeta>` extension slot. Extend these in `foundations/types/entities.ts` to add project-specific fields.
53
76
 
54
77
  ## When Working with Organization OS
55
78
 
56
- - **Adding a feature:** Follow `node_modules/@elevasis/sdk/reference/scaffold/recipes/add-a-feature.md`
57
- - **Adding a resource:** Follow `node_modules/@elevasis/sdk/reference/scaffold/recipes/add-a-resource.md`
58
- - **Changing org model:** Start with `foundations/config/organization-model.examples.ts` for reference patterns, then edit `foundations/config/organization-model.ts`. Use the typed feature/surface constants from `@elevasis/core/organization-model` rather than magic strings. Verify the org-os wiring (provider chain, CSS imports, feature shell).
79
+ - **Changing org model (structural reality):** Use `/configure` as the entry point. Direct edits to `foundations/config/organization-model.ts` are discouraged -- `/configure` runs the read → propose → confirm → write → validate ceremony. Run `/configure` for the full layered flow or `/configure \<domain>` for a targeted domain.
80
+ - **Adding a feature:** Follow `node_modules/@elevasis/sdk/reference/scaffold/recipes/add-a-feature.md`. For toggling an existing feature, use `/configure features`.
81
+ - **Adding a resource:** Follow `node_modules/@elevasis/sdk/reference/scaffold/recipes/add-a-resource.md`.
59
82
  - **Extending entities:** Start with `foundations/types/entities.ts` for the demo extension pattern. Base shapes come from `@elevasis/core/entities`.
60
83
  - **Authoring a workflow that takes a Project/Deal/etc.:** Reference entity types from `foundations/types/entities.ts` in the input schema -- do not redeclare them.
61
- - **Understanding contracts:** Check `node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md` for current type shapes
62
- - **Debugging sync issues:** Check `node_modules/@elevasis/sdk/reference/scaffold/operations/propagation-pipeline.md` for the verification pipeline
84
+ - **Understanding contracts:** Check `node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md` for current type shapes.
85
+ - **Debugging sync issues:** Check `node_modules/@elevasis/sdk/reference/scaffold/operations/propagation-pipeline.md` for the verification pipeline.
86
+
87
+ ## `/configure` -- Org Model QA Entry Point
88
+
89
+ `/configure` is the recurring, safe-to-re-run org model editor for this project. It is a skill (not a command) at `.claude/skills/configure/SKILL.md`.
90
+
91
+ **Usage:**
92
+
93
+ - `/configure` -- layered flow: identity → customers → offerings → roles → goals → techStack
94
+ - `/configure identity` -- legal identity, mission/vision, industry, geography, timezone
95
+ - `/configure customers` -- customer segments with jobs-to-be-done, pains, gains, firmographics
96
+ - `/configure offerings` -- products and services with pricing model and segment references
97
+ - `/configure roles` -- role chart with responsibilities, reporting lines, and holders
98
+ - `/configure goals` -- organizational goals with period and measurable outcomes
99
+ - `/configure techStack` -- external-SaaS integration metadata on resource mappings
100
+ - `/configure features` -- enable, disable, or add features
101
+ - `/configure labels` -- edit display labels on enum entries (statuses, stages)
102
+
103
+ Every write is gated: `resolveOrganizationModel()` must succeed (Zod cross-refs pass) and `pnpm -C operations check-types` must pass. On failure the change is rolled back.
104
+
105
+ **Distinction from `/setup`:** `/setup` is first-time bootstrap only. After bootstrap it delegates here. `/configure` is idempotent and safe to re-run at any time.
106
+
107
+ The ambient vibe layer (`.claude/rules/vibe.md`) automatically detects Codify intent in plain language and delegates to `/configure`. Power users can invoke `/configure` directly to bypass the ambient layer entirely.
@@ -30,7 +30,7 @@ The agent auto-saves progress (no user action needed) when:
30
30
  - Significant progress has been made (2+ steps completed without saving)
31
31
  - Before a context reset
32
32
 
33
- Auto-save updates the task doc's Progress and Resume Context sections silently, then briefly confirms. The canonical persistence path is `pnpm exec elevasis-sdk project:task:save` -- the CLI writes through to `prj_tasks.resume_context` (JSONB) so another agent can resume without re-deriving intent.
33
+ Auto-save updates the task doc's Progress and Resume Context sections silently, then briefly confirms. The canonical persistence path is `pnpm elevasis-sdk project:task:save` -- the CLI writes through to `prj_tasks.resume_context` (JSONB) so another agent can resume without re-deriving intent.
34
34
 
35
35
  ## Completion Suggestions
36
36
 
@@ -40,8 +40,8 @@ When all plan steps are marked COMPLETE, **suggest** completing the task -- neve
40
40
 
41
41
  Project tasks for this template live in the `prj_tasks` Supabase table, not in repo-local files. Operate on them via the SDK CLI:
42
42
 
43
- - `pnpm exec elevasis-sdk project:work` -- entrypoint for task work (resume / new intent detection)
44
- - `pnpm exec elevasis-sdk project:list` -- portfolio / task listing
45
- - `pnpm exec elevasis-sdk project:task:save` -- persist progress + `resume_context` to the DB
43
+ - `pnpm elevasis-sdk project:work` -- entrypoint for task work (resume / new intent detection)
44
+ - `pnpm elevasis-sdk project:list` -- portfolio / task listing
45
+ - `pnpm elevasis-sdk project:task:save` -- persist progress + `resume_context` to the DB
46
46
 
47
47
  The monorepo-side `/work` slash command still exists for monorepo task docs under `apps/docs/content/docs/in-progress/**`; that flow is unchanged. What went away is the external template's own `/work` skill and its `docs/in-progress/` directory -- external projects now route through the DB-backed `project:*` surface above.