@elevasis/sdk 1.21.0 → 1.22.1

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 +1239 -173
  2. package/dist/index.d.ts +1752 -464
  3. package/dist/index.js +3477 -143
  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 +1188 -127
  7. package/dist/test-utils/index.js +3359 -152
  8. package/dist/worker/index.js +3148 -80
  9. package/package.json +2 -2
  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 +113 -81
  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 +45 -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 +171 -84
  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 +225 -213
  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 +307 -85
  142. package/reference/scaffold/recipes/add-a-resource.md +137 -103
  143. package/reference/scaffold/recipes/customize-knowledge-browser.md +5 -5
  144. package/reference/scaffold/recipes/customize-organization-model.md +275 -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 +394 -394
  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 +2136 -2093
  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,330 +1,345 @@
1
- ---
2
- name: knowledge
3
- description: |
4
- TRIGGER this skill when any of the following apply:
5
- - The user references organization-model entities by name or concept: identity, customers,
6
- offerings, roles, goals, techStack, systems, actions, labels, knowledge nodes, governance edges,
7
- mounts, playbook, outreach cadence, or any domain in the org model.
8
- - The user asks to read, list, find, show, query, navigate, describe, codify, add, edit,
9
- update, toggle, enable, or disable any organization-model domain or knowledge node.
10
- - The user asks "what governs X?", "what does X control?", "system governs", "what is our
11
- identity set to?", "what's our timezone?", "show me all reference docs", "list my roles",
12
- "where does outreach-cadence apply?", or similar.
13
- - An agent is editing files matching: core/config/organization-model.ts,
14
- core/config/organization-model.ts, packages/elevasis-core/src/organization-model/index.ts,
15
- or packages/core/src/knowledge/**.
16
- SKIP this skill when the task is purely UI layout, workflow authoring, or infrastructure
17
- work with no reference to org-model or knowledge-graph entities.
18
- metadata:
19
- pathPatterns:
20
- - "core/config/organization-model.ts"
21
- - "core/config/organization-model.ts"
22
- - "packages/elevasis-core/src/organization-model/**"
23
- - "packages/core/src/knowledge/**"
24
- promptSignals:
25
- phrases:
26
- - playbook
27
- - knowledge node
28
- - system governs
29
- - outreach cadence
30
- - identity
31
- - customer segment
32
- - codify
33
- - enable system
34
- - toggle system
35
- - what governs
36
- - org model
37
- - organization model
38
- - offerings
39
- - techStack
40
- - roles
41
- - goals
42
- - labels
43
- - knowledge map
44
- - governance edge
1
+ ---
2
+ name: knowledge
3
+ description: |
4
+ TRIGGER this skill when any of the following apply:
5
+ - The user references organization-model entities by name or concept: identity, customers,
6
+ offerings, roles, goals, techStack, systems, actions, labels, knowledge nodes, governance edges,
7
+ mounts, playbook, outreach cadence, or any domain in the org model.
8
+ - The user asks to read, list, find, show, query, navigate, describe, codify, add, edit,
9
+ update, toggle, enable, or disable any organization-model domain or knowledge node.
10
+ - The user asks "what governs X?", "what does X control?", "system governs", "what is our
11
+ identity set to?", "what's our timezone?", "show me all reference docs", "list my roles",
12
+ "where does outreach-cadence apply?", or similar.
13
+ - An agent is editing files matching: core/config/organization-model.ts,
14
+ core/config/organization-model.ts, packages/elevasis-core/src/organization-model/index.ts,
15
+ or packages/core/src/knowledge/**.
16
+ SKIP this skill when the task is purely UI layout, workflow authoring, or infrastructure
17
+ work with no reference to org-model or knowledge-graph entities.
18
+ metadata:
19
+ pathPatterns:
20
+ - "core/config/organization-model.ts"
21
+ - "core/config/organization-model.ts"
22
+ - "packages/elevasis-core/src/organization-model/**"
23
+ - "packages/core/src/knowledge/**"
24
+ promptSignals:
25
+ phrases:
26
+ - playbook
27
+ - knowledge node
28
+ - system governs
29
+ - outreach cadence
30
+ - identity
31
+ - customer segment
32
+ - codify
33
+ - enable system
34
+ - toggle system
35
+ - what governs
36
+ - org model
37
+ - organization model
38
+ - offerings
39
+ - techStack
40
+ - roles
41
+ - goals
42
+ - labels
43
+ - knowledge map
44
+ - governance edge
45
45
  - knowledge mount
46
46
  - knowledge graph
47
47
  - knowledge browser
48
+ - ontology
49
+ - by-ontology
48
50
  - list my roles
49
51
  - what is our
50
- - show me all reference docs
51
- - where does
52
- - apply
53
- context: fork
54
- allowed-tools: Read, Write, Edit, Glob, Grep, Bash
55
- ---
56
-
57
- # Knowledge
58
-
59
- Unified intent-inferring skill for all organization-model interaction. Reads org-model state
60
- through the `elevasis knowledge:*` CLI tooling; writes run through the codify ceremony absorbed
61
- from `/configure`. No verb namespace is required -- the skill classifies intent from conversation
62
- context and routes to the appropriate flow internally.
63
-
64
- ---
65
-
66
- ## When to Invoke
67
-
68
- This skill auto-invokes whenever:
69
-
70
- - Conversation references org-model entities (identity, customers, offerings, roles, goals,
71
- techStack, systems, actions, labels, knowledge nodes, governance edges, mounts)
72
- - The user asks to read, list, find, show, query, navigate, describe, codify, add, edit,
73
- update, toggle, enable, or disable any of those
74
- - An agent is editing files matching `core/config/organization-model.ts`,
75
- `core/config/organization-model.ts`, `packages/elevasis-core/src/organization-model/index.ts`,
76
- or `packages/core/src/knowledge/**`
77
-
78
- Auto-invocation is driven by frontmatter `description`, `metadata.pathPatterns`, and
79
- `metadata.promptSignals` -- no explicit `/knowledge` prefix is required.
80
-
81
- ---
82
-
83
- ## Intent Classification
84
-
85
- Once invoked, classify the user's intent into one of five flows. Read natural-language input and
86
- pick a flow. On ambiguous input, default to **Describe** (read intent) and ask the user to
87
- confirm before any write. The codify ceremony has an explicit user-confirm gate -- misclassification
88
- cannot bypass the write gate.
89
-
90
- | Flow | Triggers (examples) | Mechanics |
91
- | -------- | ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
92
- | Read | "what playbooks govern sales.crm?", "show me all reference docs", "list my roles" | Run CLI read commands (monorepo or external); format result |
93
- | Navigate | "what governs this system?", "where does outreach-cadence apply?" | Same CLI; pick mount axis from intent; default to `by-system` for orientation queries |
94
- | Describe | "what is our identity set to?", "what's our timezone?" | Read current values from OM source; narrate |
95
- | Codify | "we're an e-commerce company", "add a customer segment", "our outreach goal is..." | Run codify ceremony with shared-layer impact preview: snapshot -> propose -> confirm -> write -> typecheck -> Zod parse -> rollback on failure |
96
- | Toggle | "enable the lead-gen system", "turn off SEO" | Codify ceremony scoped to the `systems` domain; flip availability/routing state; same validation/rollback |
97
-
98
- ---
99
-
100
- ## Shared Layering Preview
101
-
102
- When opening a domain that uses a closed stage, status, or catalog vocabulary -- especially
103
- prospecting, CRM, outreach, or another pipeline-like domain -- read the scaffold-shipped primer:
104
-
105
- ```bash
106
- node_modules/@elevasis/sdk/reference/spine/spine-primer.md
107
- ```
108
-
109
- Use it to emit a short domain layering preview before the normal read, describe, or codify flow:
110
-
111
- 1. **Catalog:** which `organizationModel.<domain>` catalog owns the keys, labels, descriptions,
112
- ordering, and entity ownership.
113
- 2. **Runtime state:** where record progress is stored as sparse state keyed by those catalog
114
- members.
115
- 3. **Producers:** which templates, automations, or factories write entity-tagged results for those
116
- keys.
117
- 4. **Consumers:** which dashboards, queues, reports, filters, or API reads render or aggregate the
118
- same keys.
119
-
120
- For vibe-coder sessions, translate this into plain language: "business profile", "saved progress",
121
- "automations", and "dashboard or reports". For technical sessions, it is acceptable to name the
122
- catalog, state map, producer, and consumer surfaces directly. External tenants route all follow-ups
123
- through `/knowledge`; do not point them at monorepo-only commands.
124
-
125
- ---
126
-
127
- ## Organization Model Navigation Guide
128
-
129
- Use this map whenever the task asks what something is, where it lives, what governs it, or
130
- what adjacent context may matter:
131
-
132
- | Question | Start here | Then inspect |
133
- | --- | --- | --- |
134
- | What Systems exist? | `core/config/organization-model.ts` | System IDs, parentage, lifecycle, UI metadata, and content |
135
- | What governs a System? | `/by-system/<id>` knowledge read | system entry, governed knowledge, roles, policies, graph `governs` edges |
136
- | What resources belong to a System? | `organizationModel.resources.entries` and `getResourcesForSystem(model, systemPath)` | use `{ includeDescendants: true }` only for parent-scope rollups |
137
- | What can a System do? | system action refs and the actions domain | `action.resourceId`, invocation metadata, affected entities, policies |
138
- | What data does it own? | entities domain | owning System refs, state catalogs, entity links, emitted/projected events |
139
- | What operational content exists? | system `content` | content helpers and scaffold migration helpers when available |
140
- | What UI surface exposes it? | `navigation.sidebar` plus `SystemModule` manifests | route files, surface targets, route-prefix modules, guards |
141
- | What knowledge applies? | knowledge domain plus graph edges | `knowledge:cat`, `knowledge:graph`, `/graph/<id>/governed-by` |
142
-
143
- Do not treat any one read as a complete system snapshot. The OM is a set of related
144
- domain maps; follow the relationship that matches the work. Prefer structured helpers
145
- from `@elevasis/core/organization-model` over ad hoc string scanning when code access is
146
- available.
147
-
148
- ---
149
-
150
- ## Read Patterns
151
-
152
- ### Monorepo (platform defaults)
153
-
154
- ```bash
155
- pnpm exec elevasis knowledge:ls
52
+ - show me all reference docs
53
+ - where does
54
+ - apply
55
+ context: fork
56
+ allowed-tools: Read, Write, Edit, Glob, Grep, Bash
57
+ ---
58
+
59
+ # Knowledge
60
+
61
+ Unified intent-inferring skill for all organization-model interaction. Reads org-model state
62
+ through the `elevasis knowledge:*` CLI tooling; writes run through the codify ceremony absorbed
63
+ from `/configure`. No verb namespace is required -- the skill classifies intent from conversation
64
+ context and routes to the appropriate flow internally.
65
+
66
+ ---
67
+
68
+ ## When to Invoke
69
+
70
+ This skill auto-invokes whenever:
71
+
72
+ - Conversation references org-model entities (identity, customers, offerings, roles, goals,
73
+ techStack, systems, actions, labels, knowledge nodes, governance edges, mounts)
74
+ - The user asks to read, list, find, show, query, navigate, describe, codify, add, edit,
75
+ update, toggle, enable, or disable any of those
76
+ - An agent is editing files matching `core/config/organization-model.ts`,
77
+ `core/config/organization-model.ts`, `packages/elevasis-core/src/organization-model/index.ts`,
78
+ or `packages/core/src/knowledge/**`
79
+
80
+ Auto-invocation is driven by frontmatter `description`, `metadata.pathPatterns`, and
81
+ `metadata.promptSignals` -- no explicit `/knowledge` prefix is required.
82
+
83
+ ---
84
+
85
+ ## Intent Classification
86
+
87
+ Once invoked, classify the user's intent into one of five flows. Read natural-language input and
88
+ pick a flow. On ambiguous input, default to **Describe** (read intent) and ask the user to
89
+ confirm before any write. The codify ceremony has an explicit user-confirm gate -- misclassification
90
+ cannot bypass the write gate.
91
+
92
+ | Flow | Triggers (examples) | Mechanics |
93
+ | -------- | ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
94
+ | Read | "what playbooks govern sales.crm?", "show me all reference docs", "list my roles" | Run CLI read commands (monorepo or external); format result |
95
+ | Navigate | "what governs this system?", "where does outreach-cadence apply?" | Same CLI; pick mount axis from intent; default to `by-system` for orientation queries |
96
+ | Describe | "what is our identity set to?", "what's our timezone?" | Read current values from OM source; narrate |
97
+ | Codify | "we're an e-commerce company", "add a customer segment", "our outreach goal is..." | Run codify ceremony with shared-layer impact preview: snapshot -> propose -> confirm -> write -> typecheck -> Zod parse -> rollback on failure |
98
+ | Toggle | "enable the lead-gen system", "turn off SEO" | Codify ceremony scoped to the `systems` domain; flip availability/routing state; same validation/rollback |
99
+
100
+ ---
101
+
102
+ ## Shared Layering Preview
103
+
104
+ When opening a domain that uses a closed stage, status, or catalog vocabulary -- especially
105
+ prospecting, CRM, outreach, or another pipeline-like domain -- read the scaffold-shipped primer:
106
+
107
+ ```bash
108
+ node_modules/@elevasis/sdk/reference/spine/spine-primer.md
109
+ ```
110
+
111
+ Use it to emit a short domain layering preview before the normal read, describe, or codify flow:
112
+
113
+ 1. **Catalog:** which `organizationModel.<domain>` catalog owns the keys, labels, descriptions,
114
+ ordering, and entity ownership.
115
+ 2. **Runtime state:** where record progress is stored as sparse state keyed by those catalog
116
+ members.
117
+ 3. **Producers:** which templates, automations, or factories write entity-tagged results for those
118
+ keys.
119
+ 4. **Consumers:** which dashboards, queues, reports, filters, or API reads render or aggregate the
120
+ same keys.
121
+
122
+ For vibe-coder sessions, translate this into plain language: "business profile", "saved progress",
123
+ "automations", and "dashboard or reports". For technical sessions, it is acceptable to name the
124
+ catalog, state map, producer, and consumer surfaces directly. External tenants route all follow-ups
125
+ through `/knowledge`; do not point them at monorepo-only commands.
126
+
127
+ ---
128
+
129
+ ## Organization Model Navigation Guide
130
+
131
+ Use this map whenever the task asks what something is, where it lives, what governs it, or
132
+ what adjacent context may matter:
133
+
134
+ | Question | Start here | Then inspect |
135
+ | --- | --- | --- |
136
+ | What Systems exist? | `core/config/organization-model.ts` | System IDs, parentage, lifecycle, UI metadata, and content |
137
+ | What governs a System? | `/by-system/<id>` knowledge read | system entry, governed knowledge, roles, policies, graph `governs` edges |
138
+ | What resources belong to a System? | the id-keyed `organizationModel.resources` map and `getResourcesForSystem(model, systemPath)` | use `{ includeDescendants: true }` only for parent-scope rollups |
139
+ | What can a System do? | system action refs and the actions domain | `action.resourceId`, invocation metadata, affected entities, policies |
140
+ | What data does it own? | entities domain | owning System refs, state catalogs, entity links, emitted/projected events |
141
+ | What operational content exists? | system `content` | content helpers and scaffold migration helpers when available |
142
+ | What UI surface exposes it? | `navigation.sidebar` plus `SystemModule` manifests | route files, surface targets, route-prefix modules, guards |
143
+ | What knowledge applies? | knowledge domain plus graph edges | `knowledge:cat`, `knowledge:graph`, `/graph/<id>/governed-by` |
144
+
145
+ Do not treat any one read as a complete system snapshot. The OM is a set of related
146
+ domain maps; follow the relationship that matches the work. Prefer structured helpers
147
+ from `@elevasis/core/organization-model` over ad hoc string scanning when code access is
148
+ available.
149
+
150
+ ---
151
+
152
+ ## Read Patterns
153
+
154
+ ### Monorepo (platform defaults)
155
+
156
+ ```bash
157
+ pnpm exec elevasis knowledge:ls
156
158
  pnpm exec elevasis knowledge:cat <node-id>
157
159
  pnpm exec elevasis knowledge:ls /by-system/<system-id>
158
160
  pnpm exec elevasis knowledge:ls /by-owner/<owner-id>
161
+ pnpm exec elevasis knowledge:ls /by-ontology/<ontology-id> --ids-only
159
162
  pnpm exec elevasis knowledge:graph <node-id>
160
163
  ```
161
-
162
- ### External projects (org instance)
163
-
164
- ```bash
165
- pnpm exec elevasis-sdk knowledge:ls
164
+
165
+ ### External projects (org instance)
166
+
167
+ ```bash
168
+ pnpm exec elevasis-sdk knowledge:ls
166
169
  pnpm exec elevasis-sdk knowledge:cat <node-id>
167
170
  pnpm exec elevasis-sdk knowledge:ls /by-system/<system-id>
168
171
  pnpm exec elevasis-sdk knowledge:ls /by-owner/<owner-id>
172
+ pnpm exec elevasis-sdk knowledge:ls /by-ontology/<ontology-id> --ids-only
169
173
  pnpm exec elevasis-sdk knowledge:graph <node-id>
170
174
  ```
171
175
 
172
176
  Use `knowledge:ls` to enumerate all knowledge nodes. Use `knowledge:cat` to read a specific
173
177
  node's content. Use `knowledge:ls /by-system/<system-id>` or
174
178
  `knowledge:ls /by-owner/<owner-id>` to navigate system and owner groupings. Use
175
- `knowledge:graph <node-id>` to inspect incoming and outgoing graph edges for a specific node.
176
-
177
- ### `/knowledge read-folder` (chat shorthand from the Knowledge Browser)
178
-
179
- The Knowledge Browser's copy button on a top-level system or kind group emits a single
180
- `/knowledge read-folder <axis>:<id>` line instead of N per-node `read` lines. Resolve it by
181
- listing the folder via `knowledge:ls` and reading each child:
182
-
183
- | Copy form | Resolution (external) |
184
- | ------------------------------------ | --------------------------------------------------------------------------------------------- |
179
+ `knowledge:ls /by-ontology/<ontology-id> --ids-only` to find knowledge attached to a public
180
+ ontology id, then `knowledge:cat` each returned node. Use `knowledge:graph <node-id>` to
181
+ inspect incoming and outgoing graph edges for a specific node.
182
+
183
+ When a `/knowledge` query clearly names an ontology id such as
184
+ `sales.crm:object/deal`, route through `/by-ontology/<id>` automatically and read the
185
+ returned nodes. When the query names an ontology graph node id such as
186
+ `ontology:sales.crm:object/deal`, strip the `ontology:` graph prefix for the
187
+ `/by-ontology/<id>` path and inspect the graph node only when the user asks for graph
188
+ edges or adjacent context.
189
+
190
+ ### `/knowledge read-folder` (chat shorthand from the Knowledge Browser)
191
+
192
+ The Knowledge Browser's copy button on a top-level system or kind group emits a single
193
+ `/knowledge read-folder <axis>:<id>` line instead of N per-node `read` lines. Resolve it by
194
+ listing the folder via `knowledge:ls` and reading each child:
195
+
196
+ | Copy form | Resolution (external) |
197
+ | ------------------------------------ | --------------------------------------------------------------------------------------------- |
185
198
  | `/knowledge read-folder system:<id>` | `pnpm exec elevasis-sdk knowledge:ls /by-system/<id> --ids-only`, then `knowledge:cat` each |
186
199
  | `/knowledge read-folder kind:<kind>` | `pnpm exec elevasis-sdk knowledge:ls /by-kind/<kind> --ids-only`, then `knowledge:cat` each |
187
200
  | `/knowledge read-folder owner:<id>` | `pnpm exec elevasis-sdk knowledge:ls /by-owner/<id> --ids-only`, then `knowledge:cat` each |
201
+ | `/knowledge read-folder ontology:<id>` | `pnpm exec elevasis-sdk knowledge:ls /by-ontology/<id> --ids-only`, then `knowledge:cat` each |
188
202
  | `/knowledge read-folder graph:<id>` | inspect `/graph/<id>/governs` and `/graph/<id>/governed-by`; read returned knowledge ids |
189
203
 
190
204
  Dotted system ids may use either dots or slashes (`sales.crm` and `sales/crm` both work
191
205
  with `knowledge:ls`). Legacy `feature:<id>` copy lines may still appear in older browser
192
206
  builds; treat them as compatibility aliases for `system:<id>` and resolve through `/by-system/`.
207
+ Ontology read-folder ids are public Knowledge axes; route them through `/by-ontology/<id>`.
193
208
  Per-node leaves still copy as `/knowledge read <node-id>`. Browser group/domain/item folders
194
209
  usually copy explicit N-line read lists when they contain knowledge nodes; if they fall back to
195
210
  `group:`, `domain:`, `item:`, or `folder:` route ids, treat those as UI route breadcrumbs, not
196
211
  CLI mounts. Resolve them from visible child knowledge ids or the corresponding OM/graph context.
197
-
198
- `read-folder system:<id>` is the baseline knowledge read, not a mandatory full-system
199
- snapshot. Start by loading governing knowledge nodes. Broaden into adjacent Organization
200
- Model context only when the current task makes it relevant:
201
-
202
- - Runtime or implementation work: inspect `organizationModel.resources.entries` with
203
- `getResourcesForSystem(model, id)` or `getResourcesForSystem(model, id, { includeDescendants: true })`.
204
- - Operational configuration: inspect the system entry, `system.content`, `getContent()`,
205
- `resolveSystemContent()`, and scaffold migration helpers when applicable.
206
- - Governance or access work: inspect roles, policies, actions, entities, and graph edges
207
- through the Organization Graph or direct `core/config/organization-model.ts` domain reads.
208
- - Deployment/code work: follow resource ids into `operations/src/**` only when the task
209
- needs executable implementation details.
210
-
211
- There is no first-class CLI mount for "all resources/actions/entities/policies/roles by
212
- system" yet. Use the helpers above or scan the org model plus the relevant domain maps.
213
-
214
- ---
215
-
216
- ## Codify Ceremony
217
-
218
- Every write (Codify or Toggle intent) runs the six-step safety ceremony. This ceremony is
219
- preserved verbatim from `/configure`.
220
-
221
- ### Step 1: Snapshot
222
-
223
- Read `core/config/organization-model.ts` (external) or the appropriate platform OM file
224
- (monorepo) into memory before any edit. This is the rollback target.
225
-
226
- ### Step 2: Propose
227
-
228
- Show the diff in chat. Identify which domain and field changes. Present the proposed new value
229
- in context alongside the current value.
230
-
231
- For stage, status, or catalog vocabulary edits, include the shared-layer impact preview before
232
- asking for confirmation. Name the affected catalog key, whether existing sparse runtime state may
233
- contain the old key, which producers/templates reference it, and which consumers render or filter by
234
- it. If the impact cannot be determined from the local project, say which surface is unknown and keep
235
- the write gated.
236
-
237
- ### Step 3: Confirm
238
-
239
- Pause for explicit user confirmation. Do not proceed without a clear yes. Permission prompts
240
- also gate writes.
241
-
242
- ### Step 4: Write
243
-
244
- Apply the edit using the Edit or Write tool.
245
-
246
- ### Step 5: Validate
247
-
248
- Run both checks:
249
-
250
- ```bash
251
- pnpm -C operations check-types # TypeScript type-check
252
- pnpm -C operations check # Runtime schema validation (Zod parse)
253
- ```
254
-
255
- ### Step 6: Rollback
256
-
257
- If any validation step fails, restore the file from the Step 1 snapshot and report the error.
258
- The rollback is mandatory -- never leave the project in a broken state.
259
-
260
- **Two-level ceremony:**
261
-
262
- - **Level A** -- config-only edits to existing schema fields in `core/config/organization-model.ts`.
263
- Execute: `.claude/skills/knowledge/operations/codify-level-a.md`
264
- - **Level B** -- new Zod extension files in `core/config/extensions/`. Gated to explicit
265
- user ask. On casual second mentions of a new type, suggest Level B and wait for confirmation
266
- rather than scaffolding automatically.
267
- Execute: `.claude/skills/knowledge/operations/codify-level-b.md`
268
-
269
- ---
270
-
271
- ## Domain References
272
-
273
- The following domain reference files document each org-model domain: schema fields, validation
274
- rules, examples, and how to read or edit them. Load the relevant file when the user's intent
275
- classification names a specific domain.
276
-
277
- - `.claude/skills/knowledge/operations/identity.md` -- identity domain
278
- - `.claude/skills/knowledge/operations/customers.md` -- customer segments
279
- - `.claude/skills/knowledge/operations/offerings.md` -- products and services
280
- - `.claude/skills/knowledge/operations/roles.md` -- role chart
281
- - `.claude/skills/knowledge/operations/goals.md` -- organizational goals
282
- - `.claude/skills/knowledge/operations/techStack.md` -- external integration registry
283
- - `.claude/skills/knowledge/operations/features.md` -- legacy compatibility notes for feature wording; current availability/routing work uses Systems and Actions language
284
- - `.claude/skills/knowledge/operations/labels.md` -- inline display labels on enum entries
285
-
286
- These files are populated by Wave B2 and own the domain-specific schema reference content. The
287
- codify ceremony files above own the write pipeline. This SKILL.md owns intent classification
288
- and routing.
289
-
290
- ---
291
-
292
- ## Monorepo vs External
293
-
294
- ### External projects (canonical scope -- full power)
295
-
296
- In external projects (`external/_template`, `external/ZentaraHQ`, etc.) this skill has
297
- full power: read + write + codify + toggle. The org-model file is
298
- `core/config/organization-model.ts` (or `core/config/organization-model.ts` for
299
- `external/_template`-derived projects). Extension files live in `core/config/extensions/`.
300
-
301
- This is the environment where Codify and Toggle intents write. All six ceremony steps apply.
302
-
303
- ### Monorepo (read-only pointer for tenants; direct PR for platform)
304
-
305
- The monorepo-side skill at `.claude/skills/knowledge/SKILL.md` is a read-only pointer. For
306
- tenant agents reading the platform OM, it reads `packages/elevasis-core/src/organization-model/index.ts`
307
- (the workspace-resident platform OM, importable as `@repo/elevasis-core/organization-model`).
308
- It documents read patterns and explicitly declines write operations for tenant contexts.
309
-
310
- To modify the Elevasis runtime/platform OM, edit files under `packages/elevasis-core/src/organization-model/`
311
- via a standard PR in the monorepo -- this is source-controlled workspace code, not an external
312
- project. To modify your own tenant org-model state, work in `external/<your-project>/` where
313
- `/knowledge` has full write power via the codify ceremony.
314
-
315
- Cross-link: `.claude/skills/knowledge/SKILL.md` (monorepo pointer)
316
-
317
- ---
318
-
319
- ## Cross-Links
320
-
321
- - `/configure` -- Legacy org-model editor (pre-absorption). Absorbed into this skill; all
322
- Codify and Toggle intents now route here. `/configure` vocabulary still works as a domain
323
- hint (e.g., "configure identity" is parsed as domain=identity, intent=Describe-or-Codify).
324
- - `node_modules/@elevasis/sdk/reference/spine/spine-primer.md` -- Scaffold-shipped layering
325
- primer for stage/status/catalog vocabularies that coordinate business-profile entries, runtime
326
- progress, producers, and consumers in tenant projects.
327
-
328
- ---
329
-
330
- **Last Updated:** 2026-05-02
212
+
213
+ `read-folder system:<id>` is the baseline knowledge read, not a mandatory full-system
214
+ snapshot. Start by loading governing knowledge nodes. Broaden into adjacent Organization
215
+ Model context only when the current task makes it relevant:
216
+
217
+ - Runtime or implementation work: inspect the id-keyed `organizationModel.resources` map with
218
+ `getResourcesForSystem(model, id)` or `getResourcesForSystem(model, id, { includeDescendants: true })`.
219
+ - Operational configuration: inspect the system entry, `system.content`, `getContent()`,
220
+ `resolveSystemContent()`, and scaffold migration helpers when applicable.
221
+ - Governance or access work: inspect roles, policies, actions, entities, and graph edges
222
+ through the Organization Graph or direct `core/config/organization-model.ts` domain reads.
223
+ - Deployment/code work: follow resource ids into `operations/src/**` only when the task
224
+ needs executable implementation details.
225
+
226
+ There is no first-class CLI mount for "all resources/actions/entities/policies/roles by
227
+ system" yet. Use the helpers above or scan the org model plus the relevant domain maps.
228
+
229
+ ---
230
+
231
+ ## Codify Ceremony
232
+
233
+ Every write (Codify or Toggle intent) runs the six-step safety ceremony. This ceremony is
234
+ preserved verbatim from `/configure`.
235
+
236
+ ### Step 1: Snapshot
237
+
238
+ Read `core/config/organization-model.ts` (external) or the appropriate platform OM file
239
+ (monorepo) into memory before any edit. This is the rollback target.
240
+
241
+ ### Step 2: Propose
242
+
243
+ Show the diff in chat. Identify which domain and field changes. Present the proposed new value
244
+ in context alongside the current value.
245
+
246
+ For stage, status, or catalog vocabulary edits, include the shared-layer impact preview before
247
+ asking for confirmation. Name the affected catalog key, whether existing sparse runtime state may
248
+ contain the old key, which producers/templates reference it, and which consumers render or filter by
249
+ it. If the impact cannot be determined from the local project, say which surface is unknown and keep
250
+ the write gated.
251
+
252
+ ### Step 3: Confirm
253
+
254
+ Pause for explicit user confirmation. Do not proceed without a clear yes. Permission prompts
255
+ also gate writes.
256
+
257
+ ### Step 4: Write
258
+
259
+ Apply the edit using the Edit or Write tool.
260
+
261
+ ### Step 5: Validate
262
+
263
+ Run both checks:
264
+
265
+ ```bash
266
+ pnpm -C operations check-types # TypeScript type-check
267
+ pnpm -C operations check # Runtime schema validation (Zod parse)
268
+ ```
269
+
270
+ ### Step 6: Rollback
271
+
272
+ If any validation step fails, restore the file from the Step 1 snapshot and report the error.
273
+ The rollback is mandatory -- never leave the project in a broken state.
274
+
275
+ **Two-level ceremony:**
276
+
277
+ - **Level A** -- config-only edits to existing schema fields in `core/config/organization-model.ts`.
278
+ Execute: `.claude/skills/knowledge/operations/codify-level-a.md`
279
+ - **Level B** -- new Zod extension files in `core/config/extensions/`. Gated to explicit
280
+ user ask. On casual second mentions of a new type, suggest Level B and wait for confirmation
281
+ rather than scaffolding automatically.
282
+ Execute: `.claude/skills/knowledge/operations/codify-level-b.md`
283
+
284
+ ---
285
+
286
+ ## Domain References
287
+
288
+ The following domain reference files document each org-model domain: schema fields, validation
289
+ rules, examples, and how to read or edit them. Load the relevant file when the user's intent
290
+ classification names a specific domain.
291
+
292
+ - `.claude/skills/knowledge/operations/identity.md` -- identity domain
293
+ - `.claude/skills/knowledge/operations/customers.md` -- customer segments
294
+ - `.claude/skills/knowledge/operations/offerings.md` -- products and services
295
+ - `.claude/skills/knowledge/operations/roles.md` -- role chart
296
+ - `.claude/skills/knowledge/operations/goals.md` -- organizational goals
297
+ - `.claude/skills/knowledge/operations/techStack.md` -- external integration registry
298
+ - `.claude/skills/knowledge/operations/features.md` -- legacy compatibility notes for feature wording; current availability/routing work uses Systems and Actions language
299
+ - `.claude/skills/knowledge/operations/labels.md` -- inline display labels on enum entries
300
+
301
+ These files are populated by Wave B2 and own the domain-specific schema reference content. The
302
+ codify ceremony files above own the write pipeline. This SKILL.md owns intent classification
303
+ and routing.
304
+
305
+ ---
306
+
307
+ ## Monorepo vs External
308
+
309
+ ### External projects (canonical scope -- full power)
310
+
311
+ In external projects (`external/_template`, `external/ZentaraHQ`, etc.) this skill has
312
+ full power: read + write + codify + toggle. The org-model file is
313
+ `core/config/organization-model.ts` (or `core/config/organization-model.ts` for
314
+ `external/_template`-derived projects). Extension files live in `core/config/extensions/`.
315
+
316
+ This is the environment where Codify and Toggle intents write. All six ceremony steps apply.
317
+
318
+ ### Monorepo (read-only pointer for tenants; direct PR for platform)
319
+
320
+ The monorepo-side skill at `.claude/skills/knowledge/SKILL.md` is a read-only pointer. For
321
+ tenant agents reading the platform OM, it reads `packages/elevasis-core/src/organization-model/index.ts`
322
+ (the workspace-resident platform OM, importable as `@repo/elevasis-core/organization-model`).
323
+ It documents read patterns and explicitly declines write operations for tenant contexts.
324
+
325
+ To modify the Elevasis runtime/platform OM, edit files under `packages/elevasis-core/src/organization-model/`
326
+ via a standard PR in the monorepo -- this is source-controlled workspace code, not an external
327
+ project. To modify your own tenant org-model state, work in `external/<your-project>/` where
328
+ `/knowledge` has full write power via the codify ceremony.
329
+
330
+ Cross-link: `.claude/skills/knowledge/SKILL.md` (monorepo pointer)
331
+
332
+ ---
333
+
334
+ ## Cross-Links
335
+
336
+ - `/configure` -- Legacy org-model editor (pre-absorption). Absorbed into this skill; all
337
+ Codify and Toggle intents now route here. `/configure` vocabulary still works as a domain
338
+ hint (e.g., "configure identity" is parsed as domain=identity, intent=Describe-or-Codify).
339
+ - `node_modules/@elevasis/sdk/reference/spine/spine-primer.md` -- Scaffold-shipped layering
340
+ primer for stage/status/catalog vocabularies that coordinate business-profile entries, runtime
341
+ progress, producers, and consumers in tenant projects.
342
+
343
+ ---
344
+
345
+ **Last Updated:** 2026-05-02