@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,109 +1,109 @@
1
- # Customers domain
2
-
3
- The `customers` domain describes who the organization serves — distinct buyer archetypes modeled
4
- after the Value Proposition Canvas (BMC / VPC). Each segment captures jobs-to-be-done, pains,
5
- gains, firmographics, and a value proposition. Agents use these segments for targeting, outreach
6
- context, and personalization.
7
-
8
- ## Schema
9
-
10
- Source: `packages/core/src/organization-model/domains/customers.ts`
11
-
12
- ```typescript
13
- CustomersDomainSchema = z.object({
14
- segments: z.array(CustomerSegmentSchema).default([])
15
- })
16
-
17
- CustomerSegmentSchema = z.object({
18
- id: z.string().trim().min(1).max(100), // stable ID, e.g. "segment-smb-agencies"
19
- name: z.string().trim().max(200).default(''), // display name
20
- description: z.string().trim().max(2000).default(''), // who this segment is
21
- jobsToBeDone: z.string().trim().max(2000).default(''), // the goal they hire you to accomplish
22
- pains: z.array(z.string().trim().max(500)).default([]),
23
- gains: z.array(z.string().trim().max(500)).default([]),
24
- firmographics: FirmographicsSchema.default({}), // industry, companySize, region
25
- valueProp: z.string().trim().max(2000).default('') // why your offering fits this segment
26
- })
27
-
28
- FirmographicsSchema = z.object({
29
- industry: z.string().trim().max(200).optional(), // e.g. "Marketing Agency"
30
- companySize: z.string().trim().max(100).optional(), // e.g. "11–50"
31
- region: z.string().trim().max(200).optional() // e.g. "North America"
32
- })
33
- ```
34
-
35
- ## Field reference
36
-
37
- | Field | Type | Max | Notes |
38
- | --------------- | -------- | ---- | ------------------------------------------------------------ |
39
- | `id` | string | 100 | Stable key, min 1 char; e.g. `"segment-smb-agencies"` |
40
- | `name` | string | 200 | Display name |
41
- | `description` | string | 2000 | Who this segment is in one or two sentences |
42
- | `jobsToBeDone` | string | 2000 | The goal they hire you to accomplish, in their terms |
43
- | `pains` | string[] | 500 | Each item: a frustration or obstacle |
44
- | `gains` | string[] | 500 | Each item: an outcome or benefit they hope for |
45
- | `firmographics` | object | -- | Optional industry, companySize, region filters for targeting |
46
- | `valueProp` | string | 2000 | Why your offering uniquely addresses this segment's needs |
47
-
48
- ## Validation rules
49
-
50
- - `id` is the stable key used by `offerings.products[].targetSegmentIds` references; once set,
51
- changing the `id` of a segment breaks any offering that references it
52
- - `firmographics` is optional; all three sub-fields (`industry`, `companySize`, `region`) are
53
- individually optional
54
- - `pains` and `gains` default to empty arrays; agents should treat an empty array as unconfigured
55
- - There is no uniqueness constraint enforced by the schema on `id`, but agents must treat it as
56
- unique and surface duplicates if found
57
- - Cross-reference: if a segment is removed, any `offerings.products[].targetSegmentIds` that
58
- reference its `id` become dangling references; surface a warning before removing
59
-
60
- ## Examples
61
-
62
- ```typescript
63
- customers: {
64
- segments: [
65
- {
66
- id: "segment-smb-agencies",
67
- name: "SMB Marketing Agencies",
68
- description: "Owner-operated agencies with 1–15 employees running campaign delivery for SMB clients.",
69
- jobsToBeDone: "Deliver consistent client results without adding headcount.",
70
- pains: [
71
- "Manual campaign QA eats time",
72
- "Client reporting takes hours each week",
73
- "Hard to scale without hiring"
74
- ],
75
- gains: [
76
- "More client capacity without more staff",
77
- "Predictable delivery timelines"
78
- ],
79
- firmographics: {
80
- industry: "Marketing Agency",
81
- companySize: "1–15",
82
- region: "North America"
83
- },
84
- valueProp: "Automates the repetitive delivery and reporting work so agencies can take on more clients."
85
- }
86
- ]
87
- }
88
- ```
89
-
90
- ## Where it lives in the adapter
91
-
92
- `core/config/organization-model.ts` under the `customers` key of
93
- `defineOrganizationModel({...})`.
94
-
95
- To read current segments: open the adapter file and inspect the `customers.segments` array, or
96
- use `pnpm exec elevasis-sdk knowledge:cat customers` (external project).
97
-
98
- ## Write path
99
-
100
- To add, edit, or remove a segment, the `/knowledge` skill runs the codify ceremony
101
- (`operations/codify-level-a.md`): snapshot → propose → confirm → write → typecheck → Zod parse →
102
- rollback on failure. Only the `segments` array is written; no other keys in the adapter are
103
- touched. When adding, append to the array. When editing, replace the matching entry by `id`.
104
- When removing, filter it out — and surface any dangling `targetSegmentIds` references first.
105
-
106
- ---
107
-
108
- **Read via `/knowledge`** — natural-language queries like "who are our customer segments?" or
109
- "what pains does the agency segment have?" route to this domain via the skill's intent classifier.
1
+ # Customers domain
2
+
3
+ The `customers` domain describes who the organization serves — distinct buyer archetypes modeled
4
+ after the Value Proposition Canvas (BMC / VPC). Each segment captures jobs-to-be-done, pains,
5
+ gains, firmographics, and a value proposition. Agents use these segments for targeting, outreach
6
+ context, and personalization.
7
+
8
+ ## Schema
9
+
10
+ Source: `packages/core/src/organization-model/domains/customers.ts`
11
+
12
+ ```typescript
13
+ CustomersDomainSchema = z.object({
14
+ segments: z.array(CustomerSegmentSchema).default([])
15
+ })
16
+
17
+ CustomerSegmentSchema = z.object({
18
+ id: z.string().trim().min(1).max(100), // stable ID, e.g. "segment-smb-agencies"
19
+ name: z.string().trim().max(200).default(''), // display name
20
+ description: z.string().trim().max(2000).default(''), // who this segment is
21
+ jobsToBeDone: z.string().trim().max(2000).default(''), // the goal they hire you to accomplish
22
+ pains: z.array(z.string().trim().max(500)).default([]),
23
+ gains: z.array(z.string().trim().max(500)).default([]),
24
+ firmographics: FirmographicsSchema.default({}), // industry, companySize, region
25
+ valueProp: z.string().trim().max(2000).default('') // why your offering fits this segment
26
+ })
27
+
28
+ FirmographicsSchema = z.object({
29
+ industry: z.string().trim().max(200).optional(), // e.g. "Marketing Agency"
30
+ companySize: z.string().trim().max(100).optional(), // e.g. "11–50"
31
+ region: z.string().trim().max(200).optional() // e.g. "North America"
32
+ })
33
+ ```
34
+
35
+ ## Field reference
36
+
37
+ | Field | Type | Max | Notes |
38
+ | --------------- | -------- | ---- | ------------------------------------------------------------ |
39
+ | `id` | string | 100 | Stable key, min 1 char; e.g. `"segment-smb-agencies"` |
40
+ | `name` | string | 200 | Display name |
41
+ | `description` | string | 2000 | Who this segment is in one or two sentences |
42
+ | `jobsToBeDone` | string | 2000 | The goal they hire you to accomplish, in their terms |
43
+ | `pains` | string[] | 500 | Each item: a frustration or obstacle |
44
+ | `gains` | string[] | 500 | Each item: an outcome or benefit they hope for |
45
+ | `firmographics` | object | -- | Optional industry, companySize, region filters for targeting |
46
+ | `valueProp` | string | 2000 | Why your offering uniquely addresses this segment's needs |
47
+
48
+ ## Validation rules
49
+
50
+ - `id` is the stable key used by `offerings.products[].targetSegmentIds` references; once set,
51
+ changing the `id` of a segment breaks any offering that references it
52
+ - `firmographics` is optional; all three sub-fields (`industry`, `companySize`, `region`) are
53
+ individually optional
54
+ - `pains` and `gains` default to empty arrays; agents should treat an empty array as unconfigured
55
+ - There is no uniqueness constraint enforced by the schema on `id`, but agents must treat it as
56
+ unique and surface duplicates if found
57
+ - Cross-reference: if a segment is removed, any `offerings.products[].targetSegmentIds` that
58
+ reference its `id` become dangling references; surface a warning before removing
59
+
60
+ ## Examples
61
+
62
+ ```typescript
63
+ customers: {
64
+ segments: [
65
+ {
66
+ id: "segment-smb-agencies",
67
+ name: "SMB Marketing Agencies",
68
+ description: "Owner-operated agencies with 1–15 employees running campaign delivery for SMB clients.",
69
+ jobsToBeDone: "Deliver consistent client results without adding headcount.",
70
+ pains: [
71
+ "Manual campaign QA eats time",
72
+ "Client reporting takes hours each week",
73
+ "Hard to scale without hiring"
74
+ ],
75
+ gains: [
76
+ "More client capacity without more staff",
77
+ "Predictable delivery timelines"
78
+ ],
79
+ firmographics: {
80
+ industry: "Marketing Agency",
81
+ companySize: "1–15",
82
+ region: "North America"
83
+ },
84
+ valueProp: "Automates the repetitive delivery and reporting work so agencies can take on more clients."
85
+ }
86
+ ]
87
+ }
88
+ ```
89
+
90
+ ## Where it lives in the adapter
91
+
92
+ `core/config/organization-model.ts` under the `customers` key of
93
+ `defineOrganizationModel({...})`.
94
+
95
+ To read current segments: open the adapter file and inspect the `customers.segments` array, or
96
+ use `pnpm exec elevasis-sdk knowledge:cat customers` (external project).
97
+
98
+ ## Write path
99
+
100
+ To add, edit, or remove a segment, the `/knowledge` skill runs the codify ceremony
101
+ (`operations/codify-level-a.md`): snapshot → propose → confirm → write → typecheck → Zod parse →
102
+ rollback on failure. Only the `segments` array is written; no other keys in the adapter are
103
+ touched. When adding, append to the array. When editing, replace the matching entry by `id`.
104
+ When removing, filter it out — and surface any dangling `targetSegmentIds` references first.
105
+
106
+ ---
107
+
108
+ **Read via `/knowledge`** — natural-language queries like "who are our customer segments?" or
109
+ "what pains does the agency segment have?" route to this domain via the skill's intent classifier.
@@ -1,113 +1,76 @@
1
- # Features domain
2
-
3
- The `features` domain controls top-level capability switches in the platform. Each entry in the
4
- `features` array of the OrganizationModel governs whether a feature's nav items, routes, and
5
- surfaces render. Disabling a feature hides it without removing it from the model; enabling makes
6
- it visible. Custom features extend the platform's defaults via a TypeScript extension file.
7
-
8
- ## Schema
9
-
10
- Source: `@elevasis/core/organization-model` (published types) or
11
- `node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md` (generated shapes).
12
-
13
- ```typescript
14
- FeatureSchema = z.object({
15
- id: ModelIdSchema, // lowercase, e.g. "crm", "lead-gen", "seo"
16
- label: LabelSchema, // display label
17
- description: DescriptionSchema.optional(),
18
- enabled: z.boolean().default(true),
19
- color: ColorTokenSchema.optional(),
20
- icon: IconNameSchema.optional(),
21
- entityIds: ReferenceIdsSchema,
22
- surfaceIds: ReferenceIdsSchema,
23
- resourceIds: ReferenceIdsSchema,
24
- capabilityIds: ReferenceIdsSchema,
25
- })
26
- ```
27
-
28
- Lives at: `core/config/organization-model.ts` under the `features` array of
29
- `defineOrganizationModel({...})`. The `features` array replaces entirely (no per-element merge), so
30
- the adapter must redeclare every feature it wants to override.
31
-
32
- ## Platform default feature IDs
33
-
34
- `crm`, `lead-gen`, `projects`, `operations`, `monitoring`, `settings`, `seo`
35
-
36
- Source of truth: `node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md`. Use the
37
- typed feature constants from `@elevasis/core/organization-model` (`CRM_FEATURE_ID`,
38
- `LEAD_GEN_FEATURE_ID`, etc.) instead of magic strings when overriding.
39
-
40
- ## Levels
41
-
42
- Two levels of feature change, both gated by the codify ceremony:
43
-
44
- - **Level A (config-only edit)** -- toggle `enabled`, adjust label/color/icon, or override
45
- metadata on a feature that already exists in the platform defaults. No new TypeScript files. See
46
- `operations/codify-level-a.md`.
47
-
48
- - **Level B (new extension file)** -- introduce a custom feature ID that does not exist in the
49
- platform defaults. Requires a new file under `core/config/extensions/` plus wiring it into the
50
- adapter. Level B is reserved for explicit user requests. See `operations/codify-level-b.md`.
51
-
52
- ## Validation rules
53
-
54
- - `id` is lowercase, hyphens only (e.g. `client-portal`); enforces `ModelIdSchema`.
55
- - `label` is non-empty, max 120 characters.
56
- - The `features` array replaces entirely on override -- entries omitted from the adapter are
57
- dropped, even if they appear in the platform defaults.
58
- - A new custom feature ID must not collide with any platform default ID.
59
-
60
- ## Realistic examples
61
-
62
- Toggle a default feature off:
63
-
64
- ```typescript
65
- defineOrganizationModel({
66
- features: [
67
- // ... redeclare every default feature you want to keep ...
68
- { id: SEO_FEATURE_ID, label: 'SEO', enabled: false, /* ... */ },
69
- ],
70
- })
71
- ```
72
-
73
- Add a custom feature (Level B):
74
-
75
- ```typescript
76
- // core/config/extensions/client-portal.ts
77
- export const clientPortalFeature = {
78
- id: 'client-portal',
79
- label: 'Client Portal',
80
- description: 'Self-serve project status for clients',
81
- enabled: true,
82
- entityIds: ['project', 'deliverable'],
83
- surfaceIds: ['client-portal-dashboard'],
84
- resourceIds: [],
85
- capabilityIds: [],
86
- }
87
-
88
- // core/config/organization-model.ts
89
- import { clientPortalFeature } from './extensions/client-portal'
90
- defineOrganizationModel({
91
- features: [
92
- /* ... defaults you want to keep ... */
93
- clientPortalFeature,
94
- ],
95
- })
96
- ```
97
-
98
- ## Validation gate
99
-
100
- Every change must pass before codify completes:
101
-
102
- 1. `pnpm -C operations check-types` -- TypeScript compilation succeeds.
103
- 2. `resolveOrganizationModel()` and `OrganizationModelSchema.parse()` succeed on the merged result.
104
-
105
- On failure, the codify ceremony rolls back. See `operations/codify-level-a.md` and
106
- `operations/codify-level-b.md` for the rollback procedure.
107
-
108
- ---
109
-
110
- > **Read via `/knowledge`** -- natural-language queries like "what features are enabled?" or
111
- > "is the SEO feature on?" route to this domain via the skill's intent classifier. To enable,
112
- > disable, or add a custom feature, the `/knowledge` skill triggers the codify ceremony when
113
- > intent classifies as Toggle or Codify.
1
+ # Features Compatibility Notes
2
+
3
+ `features` is legacy organization-model wording. Current Organization OS vocabulary is
4
+ System/Action oriented:
5
+
6
+ - **Systems** describe availability, routing, ownership, navigation grouping, and knowledge
7
+ mounts.
8
+ - **Actions** describe invokable operations such as workflows, agents, commands, and UI-triggered
9
+ tasks.
10
+
11
+ Use this file only when older prompts, browser copy text, SDK references, or scaffold recipes still
12
+ say "feature". For current tenant organization-model work, route the user to Systems and Actions
13
+ wording and use `/by-system/<id>` knowledge paths.
14
+
15
+ ## Compatibility Mapping
16
+
17
+ | Legacy wording | Current wording |
18
+ | ---------------------------------- | ---------------------------------------------------- |
19
+ | Feature toggle | System availability or routing toggle |
20
+ | Feature ID | System ID when discussing Organization OS |
21
+ | Add a custom feature | Add or extend a System, then define any Actions |
22
+ | Feature governs X | System governs X |
23
+ | `/knowledge read-folder feature:x` | `/knowledge read-folder system:x` |
24
+ | `/by-feature/x` | `/by-system/x` |
25
+
26
+ `by-feature` may still exist as a legacy compatibility axis in older tools. Do not introduce new
27
+ guidance that depends on it; prefer `by-system` everywhere.
28
+
29
+ ## What To Do With Toggle Requests
30
+
31
+ For natural-language requests like "turn on lead gen", "disable SEO", or "enable CRM":
32
+
33
+ 1. Treat the request as a System availability/routing change.
34
+ 2. Read `core/config/organization-model.ts` and find the matching System entry or platform
35
+ default constant exposed by `@elevasis/core/organization-model`.
36
+ 3. Propose the exact availability/routing change in plain language.
37
+ 4. After confirmation, run the Level A codify ceremony in `operations/codify-level-a.md`.
38
+
39
+ Do not create new extension files for a simple on/off change.
40
+
41
+ ## When Level B Applies
42
+
43
+ Level B applies only when the user explicitly asks for a new structural concept that cannot be
44
+ represented as an existing System or Action configuration. In current vocabulary this usually
45
+ means adding a project-owned extension under `core/config/extensions/` and wiring it into the
46
+ organization model.
47
+
48
+ Older references may call this "adding a custom feature"; translate it to "add or extend a
49
+ System and define any Actions it owns" before invoking `operations/codify-level-b.md`.
50
+
51
+ ## UI Package Exception
52
+
53
+ Keep the word `features` only for legacy frontend source paths that still use that directory
54
+ name, such as `ui/src/features/`. Current published shell APIs are System-oriented:
55
+ `SystemShell`, `SystemModule`, and `ElevasisSystemsProvider`.
56
+
57
+ ## Read Examples
58
+
59
+ Use current system paths:
60
+
61
+ ```bash
62
+ pnpm exec elevasis-sdk knowledge:ls /by-system/<id> --ids-only
63
+ pnpm exec elevasis-sdk knowledge:cat <node-id>
64
+ ```
65
+
66
+ Legacy browser output:
67
+
68
+ ```text
69
+ /knowledge read-folder feature:<id>
70
+ ```
71
+
72
+ Resolve as:
73
+
74
+ ```bash
75
+ pnpm exec elevasis-sdk knowledge:ls /by-system/<id> --ids-only
76
+ ```
@@ -1,118 +1,118 @@
1
- # Goals domain
2
-
3
- The `goals` domain captures what the organization is working toward — time-bounded goals with
4
- measurable outcomes. The schema shape is OKR-inspired (objectives + key results) but all
5
- user-facing language must say "goals" and "measurable outcomes". Never say "OKR", "objective",
6
- or "key result" to the user.
7
-
8
- Agents use this domain for quarterly planning, priority routing, and understanding which outcomes
9
- matter most right now.
10
-
11
- ## Schema
12
-
13
- Source: `packages/core/src/organization-model/domains/goals.ts`
14
-
15
- ```typescript
16
- GoalsDomainSchema = z.object({
17
- objectives: z.array(ObjectiveSchema).default([])
18
- })
19
-
20
- ObjectiveSchema = z.object({
21
- id: z.string().trim().min(1).max(100), // stable ID, e.g. "goal-grow-arr-q1-2026"
22
- description: z.string().trim().min(1).max(1000), // plain-language goal statement
23
- periodStart: z.string().regex(ISO_DATE), // YYYY-MM-DD — must be before periodEnd
24
- periodEnd: z.string().regex(ISO_DATE), // YYYY-MM-DD — enforced in superRefine
25
- keyResults: z.array(KeyResultSchema).default([]) // measurable outcomes under this goal
26
- })
27
-
28
- KeyResultSchema = z.object({
29
- id: z.string().trim().min(1).max(100), // e.g. "kr-revenue-q1"
30
- description: z.string().trim().min(1).max(500), // e.g. "Increase trial-to-paid conversion"
31
- targetMetric: z.string().trim().min(1).max(200), // what is being measured, e.g. "monthly revenue"
32
- currentValue: z.number().default(0), // current tracked value
33
- targetValue: z.number().optional() // target to hit (omit if directional)
34
- })
35
- ```
36
-
37
- ## Field reference
38
-
39
- | Field | Type | Notes |
40
- | ------------- | ------------- | ---------------------------------------------------------- |
41
- | `id` | string (100) | Stable key; e.g. `"goal-grow-arr-q1-2026"` |
42
- | `description` | string (1000) | Plain-language goal statement; min 1 char required |
43
- | `periodStart` | string | ISO date `YYYY-MM-DD`; must be strictly before `periodEnd` |
44
- | `periodEnd` | string | ISO date `YYYY-MM-DD`; enforced by `superRefine` |
45
- | `keyResults` | array | Measurable outcomes under this goal; defaults to `[]` |
46
-
47
- Key result fields:
48
-
49
- | Field | Type | Notes |
50
- | -------------- | ------------ | --------------------------------------------------- |
51
- | `id` | string (100) | Stable key; e.g. `"kr-revenue-q1"` |
52
- | `description` | string (500) | What is being tracked; min 1 char required |
53
- | `targetMetric` | string (200) | The metric name; e.g. `"monthly recurring revenue"` |
54
- | `currentValue` | number | Current value; defaults to `0` |
55
- | `targetValue` | number | Optional target; omit if the outcome is directional |
56
-
57
- ## Validation rules
58
-
59
- - `periodEnd` must be strictly after `periodStart`; enforced at parse time by
60
- `OrganizationModelSchema.superRefine()`; setting equal dates is also invalid
61
- - Both `periodStart` and `periodEnd` must match `YYYY-MM-DD` ISO date format exactly
62
- - The internal field name for the goals array is `objectives` (not `goals`) — this is a
63
- schema-level name, not user-facing vocabulary; always say "goals" to users
64
- - The internal field name for measurable outcomes is `keyResults` (not `outcomes`) — same
65
- convention applies; say "measurable outcomes" to users
66
- - `targetValue` is optional for directional goals where there is no specific number target
67
-
68
- ## Examples
69
-
70
- ```typescript
71
- goals: {
72
- objectives: [
73
- {
74
- id: "goal-arr-q1-2026",
75
- description: "Reach $50K MRR by end of Q1 2026",
76
- periodStart: "2026-01-01",
77
- periodEnd: "2026-03-31",
78
- keyResults: [
79
- {
80
- id: "kr-mrr-q1",
81
- description: "Grow monthly recurring revenue",
82
- targetMetric: "monthly recurring revenue (MRR)",
83
- currentValue: 32000,
84
- targetValue: 50000
85
- },
86
- {
87
- id: "kr-churn-q1",
88
- description: "Reduce monthly churn rate",
89
- targetMetric: "monthly churn rate (%)",
90
- currentValue: 4.2,
91
- targetValue: 2.5
92
- }
93
- ]
94
- }
95
- ]
96
- }
97
- ```
98
-
99
- ## Where it lives in the adapter
100
-
101
- `core/config/organization-model.ts` under the `goals` key of
102
- `defineOrganizationModel({...})`.
103
-
104
- To read current goals: open the adapter file and inspect the `goals.objectives` array, or use
105
- `pnpm exec elevasis-sdk knowledge:cat goals` (external project).
106
-
107
- ## Write path
108
-
109
- To add, edit, remove, or update progress on a goal, the `/knowledge` skill runs the codify
110
- ceremony (`operations/codify-level-a.md`): snapshot → propose → confirm → write → typecheck →
111
- Zod parse → rollback on failure. Only the `objectives` array is written; no other keys in the
112
- adapter are touched. For progress-only updates (changing `currentValue` on an existing outcome),
113
- a targeted edit is preferred over rewriting the entire goals block.
114
-
115
- ---
116
-
117
- **Read via `/knowledge`** — natural-language queries like "what are our goals this quarter?" or
118
- "what's the current MRR against target?" route to this domain via the skill's intent classifier.
1
+ # Goals domain
2
+
3
+ The `goals` domain captures what the organization is working toward — time-bounded goals with
4
+ measurable outcomes. The schema shape is OKR-inspired (objectives + key results) but all
5
+ user-facing language must say "goals" and "measurable outcomes". Never say "OKR", "objective",
6
+ or "key result" to the user.
7
+
8
+ Agents use this domain for quarterly planning, priority routing, and understanding which outcomes
9
+ matter most right now.
10
+
11
+ ## Schema
12
+
13
+ Source: `packages/core/src/organization-model/domains/goals.ts`
14
+
15
+ ```typescript
16
+ GoalsDomainSchema = z.object({
17
+ objectives: z.array(ObjectiveSchema).default([])
18
+ })
19
+
20
+ ObjectiveSchema = z.object({
21
+ id: z.string().trim().min(1).max(100), // stable ID, e.g. "goal-grow-arr-q1-2026"
22
+ description: z.string().trim().min(1).max(1000), // plain-language goal statement
23
+ periodStart: z.string().regex(ISO_DATE), // YYYY-MM-DD — must be before periodEnd
24
+ periodEnd: z.string().regex(ISO_DATE), // YYYY-MM-DD — enforced in superRefine
25
+ keyResults: z.array(KeyResultSchema).default([]) // measurable outcomes under this goal
26
+ })
27
+
28
+ KeyResultSchema = z.object({
29
+ id: z.string().trim().min(1).max(100), // e.g. "kr-revenue-q1"
30
+ description: z.string().trim().min(1).max(500), // e.g. "Increase trial-to-paid conversion"
31
+ targetMetric: z.string().trim().min(1).max(200), // what is being measured, e.g. "monthly revenue"
32
+ currentValue: z.number().default(0), // current tracked value
33
+ targetValue: z.number().optional() // target to hit (omit if directional)
34
+ })
35
+ ```
36
+
37
+ ## Field reference
38
+
39
+ | Field | Type | Notes |
40
+ | ------------- | ------------- | ---------------------------------------------------------- |
41
+ | `id` | string (100) | Stable key; e.g. `"goal-grow-arr-q1-2026"` |
42
+ | `description` | string (1000) | Plain-language goal statement; min 1 char required |
43
+ | `periodStart` | string | ISO date `YYYY-MM-DD`; must be strictly before `periodEnd` |
44
+ | `periodEnd` | string | ISO date `YYYY-MM-DD`; enforced by `superRefine` |
45
+ | `keyResults` | array | Measurable outcomes under this goal; defaults to `[]` |
46
+
47
+ Key result fields:
48
+
49
+ | Field | Type | Notes |
50
+ | -------------- | ------------ | --------------------------------------------------- |
51
+ | `id` | string (100) | Stable key; e.g. `"kr-revenue-q1"` |
52
+ | `description` | string (500) | What is being tracked; min 1 char required |
53
+ | `targetMetric` | string (200) | The metric name; e.g. `"monthly recurring revenue"` |
54
+ | `currentValue` | number | Current value; defaults to `0` |
55
+ | `targetValue` | number | Optional target; omit if the outcome is directional |
56
+
57
+ ## Validation rules
58
+
59
+ - `periodEnd` must be strictly after `periodStart`; enforced at parse time by
60
+ `OrganizationModelSchema.superRefine()`; setting equal dates is also invalid
61
+ - Both `periodStart` and `periodEnd` must match `YYYY-MM-DD` ISO date format exactly
62
+ - The internal field name for the goals array is `objectives` (not `goals`) — this is a
63
+ schema-level name, not user-facing vocabulary; always say "goals" to users
64
+ - The internal field name for measurable outcomes is `keyResults` (not `outcomes`) — same
65
+ convention applies; say "measurable outcomes" to users
66
+ - `targetValue` is optional for directional goals where there is no specific number target
67
+
68
+ ## Examples
69
+
70
+ ```typescript
71
+ goals: {
72
+ objectives: [
73
+ {
74
+ id: "goal-arr-q1-2026",
75
+ description: "Reach $50K MRR by end of Q1 2026",
76
+ periodStart: "2026-01-01",
77
+ periodEnd: "2026-03-31",
78
+ keyResults: [
79
+ {
80
+ id: "kr-mrr-q1",
81
+ description: "Grow monthly recurring revenue",
82
+ targetMetric: "monthly recurring revenue (MRR)",
83
+ currentValue: 32000,
84
+ targetValue: 50000
85
+ },
86
+ {
87
+ id: "kr-churn-q1",
88
+ description: "Reduce monthly churn rate",
89
+ targetMetric: "monthly churn rate (%)",
90
+ currentValue: 4.2,
91
+ targetValue: 2.5
92
+ }
93
+ ]
94
+ }
95
+ ]
96
+ }
97
+ ```
98
+
99
+ ## Where it lives in the adapter
100
+
101
+ `core/config/organization-model.ts` under the `goals` key of
102
+ `defineOrganizationModel({...})`.
103
+
104
+ To read current goals: open the adapter file and inspect the `goals.objectives` array, or use
105
+ `pnpm exec elevasis-sdk knowledge:cat goals` (external project).
106
+
107
+ ## Write path
108
+
109
+ To add, edit, remove, or update progress on a goal, the `/knowledge` skill runs the codify
110
+ ceremony (`operations/codify-level-a.md`): snapshot → propose → confirm → write → typecheck →
111
+ Zod parse → rollback on failure. Only the `objectives` array is written; no other keys in the
112
+ adapter are touched. For progress-only updates (changing `currentValue` on an existing outcome),
113
+ a targeted edit is preferred over rewriting the entire goals block.
114
+
115
+ ---
116
+
117
+ **Read via `/knowledge`** — natural-language queries like "what are our goals this quarter?" or
118
+ "what's the current MRR against target?" route to this domain via the skill's intent classifier.