@elevasis/sdk 1.21.0 → 1.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/dist/cli.cjs +951 -171
  2. package/dist/index.d.ts +632 -341
  3. package/dist/index.js +3102 -142
  4. package/dist/node/index.d.ts +1 -0
  5. package/dist/node/index.js +19 -1
  6. package/dist/test-utils/index.d.ts +313 -4
  7. package/dist/test-utils/index.js +3246 -281
  8. package/dist/worker/index.js +3041 -80
  9. package/package.json +3 -3
  10. package/reference/claude-config/hooks/post-edit-validate.mjs +98 -98
  11. package/reference/claude-config/hooks/scaffold-registry-reminder.mjs +188 -188
  12. package/reference/claude-config/hooks/tool-failure-recovery.mjs +73 -73
  13. package/reference/claude-config/registries/graph-skills.json +4 -4
  14. package/reference/claude-config/registries/knowledge-flags.json +0 -2
  15. package/reference/claude-config/rules/active-change-index.md +80 -80
  16. package/reference/claude-config/rules/agent-start-here.md +277 -277
  17. package/reference/claude-config/rules/deployment.md +57 -57
  18. package/reference/claude-config/rules/error-handling.md +56 -56
  19. package/reference/claude-config/rules/execution.md +40 -40
  20. package/reference/claude-config/rules/frontend.md +4 -4
  21. package/reference/claude-config/rules/observability.md +31 -31
  22. package/reference/claude-config/rules/operations.md +29 -17
  23. package/reference/claude-config/rules/organization-model.md +110 -84
  24. package/reference/claude-config/rules/organization-os.md +115 -113
  25. package/reference/claude-config/rules/package-taxonomy.md +33 -33
  26. package/reference/claude-config/rules/platform.md +42 -42
  27. package/reference/claude-config/rules/shared-types.md +49 -46
  28. package/reference/claude-config/rules/task-tracking.md +47 -47
  29. package/reference/claude-config/rules/ui.md +200 -200
  30. package/reference/claude-config/rules/vibe.md +235 -235
  31. package/reference/claude-config/scripts/statusline-command.js +18 -18
  32. package/reference/claude-config/settings.json +34 -34
  33. package/reference/claude-config/skills/deploy/{SKILL.md → skill.md} +156 -156
  34. package/reference/claude-config/skills/dsp/SKILL.md +66 -66
  35. package/reference/claude-config/skills/elevasis/SKILL.md +235 -235
  36. package/reference/claude-config/skills/explore/SKILL.md +6 -6
  37. package/reference/claude-config/skills/git-sync/SKILL.md +126 -126
  38. package/reference/claude-config/skills/knowledge/SKILL.md +314 -299
  39. package/reference/claude-config/skills/knowledge/operations/codify-level-a.md +100 -100
  40. package/reference/claude-config/skills/knowledge/operations/codify-level-b.md +159 -159
  41. package/reference/claude-config/skills/knowledge/operations/customers.md +109 -109
  42. package/reference/claude-config/skills/knowledge/operations/features.md +76 -76
  43. package/reference/claude-config/skills/knowledge/operations/goals.md +118 -118
  44. package/reference/claude-config/skills/knowledge/operations/identity.md +93 -93
  45. package/reference/claude-config/skills/knowledge/operations/labels.md +94 -94
  46. package/reference/claude-config/skills/knowledge/operations/offerings.md +109 -109
  47. package/reference/claude-config/skills/knowledge/operations/roles.md +99 -99
  48. package/reference/claude-config/skills/knowledge/operations/techStack.md +30 -30
  49. package/reference/claude-config/skills/project/SKILL.md +1088 -1088
  50. package/reference/claude-config/skills/run-ui/SKILL.md +73 -73
  51. package/reference/claude-config/skills/save/SKILL.md +3 -3
  52. package/reference/claude-config/skills/setup/SKILL.md +275 -275
  53. package/reference/claude-config/skills/status/SKILL.md +59 -59
  54. package/reference/claude-config/skills/submit-request/SKILL.md +180 -180
  55. package/reference/claude-config/skills/sync/SKILL.md +47 -47
  56. package/reference/claude-config/skills/tutorial/SKILL.md +259 -259
  57. package/reference/claude-config/skills/tutorial/progress-template.md +74 -74
  58. package/reference/claude-config/skills/tutorial/technical.md +1303 -1303
  59. package/reference/claude-config/skills/tutorial/vibe-coder.md +890 -890
  60. package/reference/claude-config/sync-notes/2026-04-22-git-sync-and-sync-notes.md +27 -27
  61. package/reference/claude-config/sync-notes/2026-04-22-lead-gen-deliverability-removal.md +30 -30
  62. package/reference/claude-config/sync-notes/2026-04-24-test-utils-and-template-tests.md +73 -73
  63. package/reference/claude-config/sync-notes/2026-04-24-ui-consolidation-and-sdk-cli-train.md +86 -86
  64. package/reference/claude-config/sync-notes/2026-04-25-auth-role-system-and-settings-roles.md +55 -55
  65. package/reference/claude-config/sync-notes/2026-04-27-crm-hitl-action-layer-cutover.md +97 -97
  66. package/reference/claude-config/sync-notes/2026-04-27-lead-gen-substrate-train.md +112 -112
  67. package/reference/claude-config/sync-notes/2026-04-29-crm-state-and-lead-gen-processing-status.md +93 -93
  68. package/reference/claude-config/sync-notes/2026-05-02-crm-ownership-next-action.md +58 -58
  69. package/reference/claude-config/sync-notes/2026-05-02-template-hardcode-workos-config.md +56 -56
  70. package/reference/claude-config/sync-notes/2026-05-04-elevasis-workspace.md +71 -71
  71. package/reference/claude-config/sync-notes/2026-05-04-knowledge-bundle.md +83 -83
  72. package/reference/claude-config/sync-notes/2026-05-04-template-skills-run-ui-and-tutorial.md +59 -59
  73. package/reference/claude-config/sync-notes/2026-05-05-list-builder.md +42 -42
  74. package/reference/claude-config/sync-notes/2026-05-06-crm-spine.md +60 -60
  75. package/reference/claude-config/sync-notes/2026-05-06-sdk-changes-release-train.md +37 -37
  76. package/reference/claude-config/sync-notes/2026-05-07-sdk-changes-release-train.md +34 -34
  77. package/reference/claude-config/sync-notes/2026-05-08-resource-governance-scaffold-guidance.md +38 -38
  78. package/reference/claude-config/sync-notes/2026-05-09-clients-domain.md +32 -32
  79. package/reference/claude-config/sync-notes/2026-05-09-command-system.md +33 -33
  80. package/reference/claude-config/sync-notes/2026-05-09-resource-governance-and-misc.md +69 -69
  81. package/reference/claude-config/sync-notes/2026-05-12-sdk-ready-release-train.md +30 -30
  82. package/reference/claude-config/sync-notes/2026-05-14-organization-model-ontology-refactor.md +42 -0
  83. package/reference/claude-config/sync-notes/README.md +43 -43
  84. package/reference/cli.mdx +808 -808
  85. package/reference/concepts.mdx +146 -146
  86. package/reference/deployment/api.mdx +297 -297
  87. package/reference/deployment/command-center.mdx +209 -209
  88. package/reference/deployment/index.mdx +195 -195
  89. package/reference/deployment/provided-features.mdx +107 -107
  90. package/reference/deployment/ui-execution.mdx +250 -250
  91. package/reference/examples/organization-model.ts +146 -83
  92. package/reference/framework/agent.mdx +156 -156
  93. package/reference/framework/index.mdx +195 -195
  94. package/reference/framework/interaction-guidance.mdx +182 -182
  95. package/reference/framework/memory.mdx +326 -326
  96. package/reference/framework/project-structure.mdx +282 -282
  97. package/reference/framework/tutorial-system.mdx +135 -135
  98. package/reference/getting-started.mdx +142 -142
  99. package/reference/index.mdx +106 -106
  100. package/reference/packages/core/src/README.md +14 -14
  101. package/reference/packages/core/src/business/README.md +2 -2
  102. package/reference/packages/core/src/knowledge/README.md +32 -32
  103. package/reference/packages/core/src/organization-model/README.md +149 -149
  104. package/reference/packages/core/src/test-utils/README.md +37 -37
  105. package/reference/packages/ui/src/api/README.md +18 -18
  106. package/reference/packages/ui/src/app/README.md +24 -24
  107. package/reference/packages/ui/src/auth/README.md +18 -18
  108. package/reference/packages/ui/src/components/README.md +24 -24
  109. package/reference/packages/ui/src/execution/README.md +16 -16
  110. package/reference/packages/ui/src/features/README.md +28 -28
  111. package/reference/packages/ui/src/graph/README.md +16 -16
  112. package/reference/packages/ui/src/hooks/README.md +23 -23
  113. package/reference/packages/ui/src/initialization/README.md +19 -19
  114. package/reference/packages/ui/src/knowledge/README.md +31 -31
  115. package/reference/packages/ui/src/organization/README.md +18 -18
  116. package/reference/packages/ui/src/profile/README.md +19 -19
  117. package/reference/packages/ui/src/provider/README.md +32 -32
  118. package/reference/packages/ui/src/router/README.md +18 -18
  119. package/reference/packages/ui/src/sse/README.md +13 -13
  120. package/reference/packages/ui/src/test-utils/README.md +7 -7
  121. package/reference/packages/ui/src/theme/README.md +23 -23
  122. package/reference/packages/ui/src/theme/presets/README.md +19 -19
  123. package/reference/packages/ui/src/types/README.md +16 -16
  124. package/reference/packages/ui/src/utils/README.md +18 -18
  125. package/reference/packages/ui/src/zustand/README.md +18 -18
  126. package/reference/platform-tools/adapters-integration.mdx +301 -301
  127. package/reference/platform-tools/adapters-platform.mdx +553 -553
  128. package/reference/platform-tools/index.mdx +217 -217
  129. package/reference/platform-tools/type-safety.mdx +82 -82
  130. package/reference/resources/index.mdx +349 -349
  131. package/reference/resources/patterns.mdx +449 -449
  132. package/reference/resources/types.mdx +116 -116
  133. package/reference/roadmap.mdx +165 -165
  134. package/reference/runtime.mdx +173 -173
  135. package/reference/scaffold/core/organization-graph.mdx +110 -90
  136. package/reference/scaffold/core/organization-model.mdx +226 -219
  137. package/reference/scaffold/index.mdx +67 -67
  138. package/reference/scaffold/operations/propagation-pipeline.md +77 -77
  139. package/reference/scaffold/operations/scaffold-maintenance.md +12 -12
  140. package/reference/scaffold/operations/workflow-recipes.md +138 -138
  141. package/reference/scaffold/recipes/add-a-feature.md +308 -88
  142. package/reference/scaffold/recipes/add-a-resource.md +134 -110
  143. package/reference/scaffold/recipes/customize-knowledge-browser.md +5 -5
  144. package/reference/scaffold/recipes/customize-organization-model.md +273 -138
  145. package/reference/scaffold/recipes/extend-a-base-entity.md +8 -8
  146. package/reference/scaffold/recipes/extend-crm.md +3 -3
  147. package/reference/scaffold/recipes/extend-lead-gen.md +400 -400
  148. package/reference/scaffold/recipes/gate-by-feature-or-admin.md +118 -118
  149. package/reference/scaffold/recipes/index.md +46 -46
  150. package/reference/scaffold/recipes/query-the-knowledge-graph.md +197 -170
  151. package/reference/scaffold/reference/contracts.md +2101 -2096
  152. package/reference/scaffold/reference/glossary.md +76 -76
  153. package/reference/scaffold/ui/composition-extensibility.mdx +233 -233
  154. package/reference/scaffold/ui/customization.md +243 -243
  155. package/reference/scaffold/ui/feature-flags-and-gating.md +46 -46
  156. package/reference/scaffold/ui/feature-shell.mdx +72 -72
  157. package/reference/scaffold/ui/recipes.md +221 -214
  158. package/reference/spine/spine-primer.md +96 -96
  159. package/reference/templates/index.mdx +47 -47
  160. package/reference/troubleshooting.mdx +223 -223
@@ -1,235 +1,235 @@
1
- ---
2
- description: Ambient intent classifier -- routes natural-language input to 7 intent buckets without a slash command; Codify and Toggle delegate to /knowledge
3
- paths:
4
- - "**/*"
5
- ---
6
-
7
- # Vibe Layer
8
-
9
- Vibe is an **ambient, always-on** intent classifier. It activates automatically whenever the user speaks in plain language -- no slash command, no activation phrase, no special syntax. Every natural-language message passes through vibe classification before the agent acts.
10
-
11
- This rule applies to all sessions inside external projects. It does NOT apply in the monorepo (ambient routing is off there by default).
12
-
13
- ## What Vibe Is
14
-
15
- Vibe is the translation layer between the user's natural language and the correct agent action. The user describes reality -- "we track deals by Shopify platform", "I'm stuck on this task", "what should I work on next" -- and vibe determines which of the seven intent types the message represents. The agent then routes to the right behavior without the user ever knowing the classification happened.
16
-
17
- Vibe coders (non-technical builders) are the primary audience. They build by describing. They never memorize commands, IDs, or schema. The ambient layer closes the gap between what they say and what the system can act on.
18
-
19
- ## The Seven Intent Types
20
-
21
- ### 1. Capture
22
-
23
- The user wants to record something new -- a task, a note, a piece of information that should persist.
24
-
25
- **Recognize by:** action verbs like "add", "create", "remember", "track", "log", "note down", "write down", combined with a thing to record.
26
-
27
- **Fixture examples:**
28
-
29
- | Input | Why it's Capture |
30
- | ------------------------------------------------- | ------------------------------------------- |
31
- | "Add a task to follow up with the Shopify client" | Explicit "add a task" with a described item |
32
- | "Remember to run the campaign report on Friday" | "Remember to" signals something to persist |
33
- | "Run the campaign report every Friday at 9am" | Repeating schedule vocabulary to persist |
34
- | "Track this conversation as a deal note" | Explicit "track" with a described artifact |
35
-
36
- **Agent action:** draft the capture in plain language, confirm with the user, then execute via `elevasis-sdk project:*` commands for project records or `elevasis-sdk schedule:create` for recurring automation. Use repetition vocabulary ("every", "daily", "weekly", "monthly") for schedules; one-shot future reminders stay project tasks with due dates. Never write without confirmation.
37
-
38
- ### 2. Query
39
-
40
- The user wants to know something about current state -- task priorities, what is pending, what is running, what failed.
41
-
42
- **Recognize by:** questions about the current list, status, or queue of things. Includes both static-model queries ("what systems are on?") and runtime-entity queries ("what's pending in the queue?"). Route Query to static-model sources (org model, Systems/Actions config) or runtime sources (operations domain) based on the referenced entity.
43
-
44
- **Fixture examples:**
45
-
46
- | Input | Why it's Query |
47
- | -------------------------------------------- | ------------------------------------------- |
48
- | "What should I work on next?" | Asking for prioritized task list |
49
- | "What's pending in the HITL queue?" | Runtime-entity query about operations state |
50
- | "What runs this week?" | Runtime query about upcoming schedules |
51
- | "What systems are enabled for this project?" | Static-model query about Systems config |
52
-
53
- **Agent action:** read the relevant source and narrate the answer in plain language. Use org model or `project:*` for project state, `elevasis-sdk queue:list --status pending --pretty` and `queue:status --pretty` for HITL queue state, and `elevasis-sdk schedule:list --status active --pretty` for upcoming recurring automation. No writes.
54
-
55
- ### 3. Describe
56
-
57
- The user wants the agent to explain something -- a scope, an entity, a concept within the project.
58
-
59
- **Recognize by:** "what is", "what does", "tell me about", "explain", "where am I", "what's going on", "describe", "show me" without an action intent attached.
60
-
61
- **Fixture examples:**
62
-
63
- | Input | Why it's Describe |
64
- | ------------------------------------------ | ----------------------------------------------------- |
65
- | "What's going on with the ZentaraHQ deal?" | Asking for a plain-language description of an entity |
66
- | "Tell me about the CRM system" | Asking the agent to narrate what a model element does |
67
- | "Where am I in this project?" | Asking for current scope narration |
68
-
69
- **Agent action:** read the relevant org-model label, entity, or scope. Narrate in plain language using label fields from the model -- never invent vocabulary not present in the model. Phase-1 scope covers Model, Systems/Actions, and Foundations layers only.
70
-
71
- **Stage/state/catalog sub-routing:** when the noun being described is a stage, state, status
72
- bucket, catalog entry, progress step, pipeline column, or similarly closed business vocabulary,
73
- also show the cross-system impact before the normal description:
74
-
75
- 1. Read `node_modules/@elevasis/sdk/reference/spine/spine-primer.md` for the layering pattern.
76
- 2. Read the relevant domain in `core/config/organization-model.ts`.
77
- 3. Explain the impact in vibe-coder language only: the business profile entry, the saved progress
78
- on each record, the automations that produce updates, and the dashboard or reports that read it.
79
- 4. Route follow-up changes through `/knowledge <domain>`. Do not mention the technical pattern name
80
- unless the user explicitly asks for internals.
81
-
82
- ### 4. Transition
83
-
84
- The user wants to change the status of a task or entity.
85
-
86
- **Recognize by:** single-word or short-phrase state signals -- "done", "finished", "complete", "blocked", "stuck", "waiting", "in review", "cancelled" -- applied to a current task or named entity.
87
-
88
- **Fixture examples:**
89
-
90
- | Input | Why it's Transition |
91
- | --------------------------------------------- | ------------------------------------------- |
92
- | "Done with the proposal draft" | "Done" + named artifact = status transition |
93
- | "Stuck -- blocked waiting on client feedback" | "Stuck" + reason = blocked transition |
94
- | "Mark the onboarding task as complete" | Explicit status-change vocabulary |
95
- | "Approve the pending checkpoint" | Selects an action from the HITL queue |
96
- | "Pause the Friday report" | Changes schedule state |
97
-
98
- **Agent action:** identify the task, queue item, schedule, or entity being transitioned, confirm the new status/action with the user, then apply it via `elevasis-sdk project:task:save`, `elevasis-sdk queue:select <id> --action-id <id>`, `elevasis-sdk queue:expire <id>`, `elevasis-sdk schedule:pause <id>`, `schedule:resume <id>`, or `schedule:cancel <id>` as appropriate. Never auto-transition without confirmation if the target entity is ambiguous.
99
-
100
- ### 5. Navigate
101
-
102
- The user wants to shift focus -- to a different task, project, System, Action, or layer of the model.
103
-
104
- **Recognize by:** focus-shift vocabulary -- "focus on", "let's look at", "switch to", "back to", "move to", "open", "go to" -- followed by a scope target.
105
-
106
- **Fixture examples:**
107
-
108
- | Input | Why it's Navigate |
109
- | -------------------------------------------- | --------------------------------------------------- |
110
- | "Let's focus on the onboarding flow for now" | "Focus on" + scope target |
111
- | "Switch to the Shopify integration project" | "Switch to" = navigate to a different project scope |
112
- | "Back to the CRM tasks" | "Back to" = return to a prior scope |
113
-
114
- **Agent action:** update the active scope in `prj_tasks.resume_context` (current project + task pointer), then narrate the new scope in plain language so the user knows where they are.
115
-
116
- ### 6. Codify
117
-
118
- The user describes organizational reality that is not yet expressed in the model -- industry type, entity kinds, custom attributes, renamed stages, domain vocabulary.
119
-
120
- **Recognize by:** declarative "we are" / "we use" / "we track" statements, repeated attribute mentions (second time the same attribute appears), or explicit "add a type / add a field / model X as Y" requests.
121
-
122
- **Fixture examples:**
123
-
124
- | Input | Why it's Codify |
125
- | -------------------------------------------------------------------------------- | -------------------------------------------------------- |
126
- | "We're an e-commerce company -- all our deals come from Shopify or Amazon" | Declares industry + platform attributes not yet in model |
127
- | "We track deal stage as discovery, scoping, proposal, closed" | Describes custom CRM stages that should replace defaults |
128
- | "Add a project type called 'retainer' with monthly billing and a contract field" | Explicit request to add a new entity extension |
129
-
130
- **Agent action:** delegate immediately to `/knowledge`. Do not attempt the ceremony yourself. Invoke with the relevant domain: `/knowledge sales` for deal/contact changes, `/knowledge projects` for project types, `/knowledge systems` for availability/routing toggles, and `/knowledge actions` for invokable operation changes. Plain-language summary of what was detected is acceptable before delegating, but the actual draft-confirm-write ceremony belongs to `/knowledge`.
131
-
132
- **Stage/state/catalog impact preview:** if the Codify intent adds, renames, removes, reorders, or
133
- re-scopes a stage, state, status bucket, catalog member, pipeline step, or progress vocabulary,
134
- preview the cross-system impact before delegating:
135
-
136
- - Which business-profile entry changes.
137
- - Which saved record progress keys may already exist.
138
- - Which automations or templates reference the key.
139
- - Which dashboard, report, queue, or API reads may display or filter by it.
140
-
141
- Then delegate to `/knowledge <domain>` with that preview as context. Vibe does not write the
142
- change and does not expose monorepo-only commands.
143
-
144
- This routing applies to both codify levels (decision #21 -- Codify ceremony delegated to `/knowledge`):
145
-
146
- - **Level A** (config-only edits to `organization-model.ts`, System availability/routing toggles, label renames): delegate to `/knowledge <domain>` immediately.
147
- - **Level B** (new Zod extension files in `core/config/extensions/`): also delegate to `/knowledge <domain>`; `/knowledge` gates Level B to explicit user asks before scaffolding a new TS file.
148
-
149
- Vibe detects the intent and delegates in both cases. It does not run either pipeline itself.
150
-
151
- For "build/extend the CRM" asks, classify the structural org-model portion as Codify, then read `node_modules/@elevasis/sdk/reference/scaffold/recipes/extend-crm.md` before editing. CRM work often spans org-model sales semantics, shared UI routes, hooks, workflow adapters, and deal actions; do not reduce it to only `sales` config or only UI.
152
-
153
- For "build/extend lead gen" / "campaign creator" / "outbound list state" asks, classify the structural org-model portion as Codify, then read `node_modules/@elevasis/sdk/reference/scaffold/recipes/extend-lead-gen.md` before editing. Lead-gen work often spans org-model prospecting semantics, shared UI routes, hooks, list/member state, artifacts, and workflow adapters; do not reduce it to only `prospecting` config or only UI.
154
-
155
- For "add a custom CRM action" / "Send Quote button" asks, classify as Codify, then read `node_modules/@elevasis/sdk/reference/scaffold/recipes/customize-crm-actions.md` before editing. Start with the shared `crmActions` provider path for action visibility, labels, ordering, and render-time configuration. In v1, platform-known/default action endpoint behavior is server-constrained; use project-owned UI that calls the workflow directly when a custom key sits outside that server-dispatched set.
156
-
157
- Heuristics for when to propose codification (passed to `/knowledge` as context):
158
-
159
- - First mention of a new attribute: note to `resume_context`, do not propose yet
160
- - Second mention OR explicit declaration ("we're ecom"): propose extension
161
- - Explicit ask ("track ecom deals separately"): propose immediately with fuller scope
162
- - Attribute appearing across 3+ tasks: propose adding field to existing extension
163
-
164
- ### 7. Toggle
165
-
166
- The user wants to enable or disable a System.
167
-
168
- **Recognize by:** system-control vocabulary -- "turn on", "enable", "disable", "turn off", "activate", "deactivate" -- followed by a System name or description.
169
-
170
- **Fixture examples:**
171
-
172
- | Input | Why it's Toggle |
173
- | ------------------------------- | -------------------------------------------- |
174
- | "Turn on the lead-gen system" | Explicit "turn on" + System name |
175
- | "Disable monitoring for now" | "Disable" + System reference |
176
- | "We don't use SEO, turn it off" | Declarative + "turn it off" = System disable |
177
-
178
- **Agent action:** delegate to `/knowledge systems`. The ceremony (confirm + edit `core/config/organization-model.ts` + typecheck) belongs to `/knowledge`, not to the ambient rule.
179
-
180
- ## Quick Reference Table
181
-
182
- | Intent | Trigger signal | Routed to |
183
- | ---------- | ---------------------------------------------------------------------- | ----------------------------------------------------------------------- |
184
- | Capture | "add", "remember", "track", "log" + a thing | Agent -- draft + confirm + `project:*` or `schedule:create` CLI |
185
- | Query | "what's next", "what's pending", "what failed", "what systems" | Agent -- read with `project:*`, `queue:*`, or `schedule:*` + narrate |
186
- | Describe | "what is", "tell me about", "explain", "where am I" | Agent -- narrate from org model labels |
187
- | Transition | "done", "stuck", "blocked", "finished", "complete", "approve", "pause" | Agent -- confirm + `project:task:save`, `queue:select`, or `schedule:*` |
188
- | Navigate | "focus on", "switch to", "back to", "look at" | Agent -- update scope + narrate |
189
- | Codify | "we are X", "we track Y", repeated attribute, "add type/field" | Delegate to `/knowledge \<domain>` |
190
- | Toggle | "enable", "disable", "turn on/off" + system | Delegate to `/knowledge systems` |
191
-
192
- ## Source of Truth for Plain Language
193
-
194
- All plain-language labels come from the OrganizationModel itself -- never from hardcoded strings in this rule file. Every status, entity kind, and layer name in the model carries an inline `label` field (e.g., `{ id: 'revision_requested', label: 'changes needed', semanticClass: 'blocked' }`). When narrating state or confirming an action, read the label from the model and use it verbatim. Do not invent synonyms or fallback vocabulary.
195
-
196
- The unified manifest (delivered via `@elevasis/core/organization-model`) is the canonical vocabulary surface. Vibe classifies against it -- Systems, Actions, statuses, operations entities, and resource kinds are all discoverable from the manifest without hardcoding.
197
-
198
- ## Ambiguous Intent
199
-
200
- When the user's input does not clearly map to one of the seven types, ask one clarifying question. Do not guess. Do not apply a precedence rule. Do not route to the "closest" intent.
201
-
202
- Format: a single neutral question that presents the two (or three) plausible intents as options and asks which the user means.
203
-
204
- Example: "That could be a note to capture or a status update on the current task -- which did you mean?"
205
-
206
- Never ask more than one question per ambiguous input. If the user's reply is still ambiguous, ask once more, then surface the options explicitly.
207
-
208
- ## Classifier Threshold
209
-
210
- Default threshold: `balanced`.
211
-
212
- The threshold controls how aggressively the classifier proposes codification from ambiguous signals:
213
-
214
- - `strict` -- only explicit declarations or repeat mentions trigger codify proposals
215
- - `balanced` -- second mention OR explicit declaration triggers; default
216
- - `loose` -- first strong signal triggers a proposal
217
-
218
- Override per project in `core/config/organization-model.ts` under `vibe.classifierThreshold`. The override is merge-aware (Tier 2 sync) and will not be overwritten by template sync operations.
219
-
220
- ## Phase-1 Scope
221
-
222
- This rule covers Phase 1 of the vibe layer rollout. The layers the ambient classifier can narrate and codify in Phase 1 are:
223
-
224
- - Layer 1 (Model): narrate schema shape, propose codification edits via `/knowledge`
225
- - Layer 4 (Systems/Actions): describe which Systems are on/off, propose enabling one via `/knowledge`
226
- - Layer 7 (Foundations): explain and edit `organization-model.ts` and `extensions/` via `/knowledge`
227
-
228
- Layers 2 (Public API), 3 (UI Shell Runtime), 5 (Toolkit), and 6 (Graph) require runtime read APIs that are not yet available. Do not attempt to narrate or classify against those layers in Phase 1. If the user's input clearly references one of those layers, acknowledge the scope and explain that full support arrives in a later phase.
229
-
230
- ## What Vibe Is Not
231
-
232
- - Vibe is not a slash command. There is no `/vibe` invocation (decision #19 -- ambient rule, not a skill or command).
233
- - Vibe is not a skill. It lives in this rule file + CLAUDE.md + the PreToolUse hook -- not in `.claude/skills/`.
234
- - Vibe does not own the codify ceremony. `/knowledge` owns draft, confirm, write, and typecheck for both Level A and Level B codify pipelines (decision #21 -- Codify ceremony delegated to `/knowledge`). Vibe detects intent and hands off.
235
- - Vibe is not active in the monorepo. If working inside the monorepo (not an `external/` project), this ambient routing does not apply.
1
+ ---
2
+ description: Ambient intent classifier -- routes natural-language input to 7 intent buckets without a slash command; Codify and Toggle delegate to /knowledge
3
+ paths:
4
+ - "**/*"
5
+ ---
6
+
7
+ # Vibe Layer
8
+
9
+ Vibe is an **ambient, always-on** intent classifier. It activates automatically whenever the user speaks in plain language -- no slash command, no activation phrase, no special syntax. Every natural-language message passes through vibe classification before the agent acts.
10
+
11
+ This rule applies to all sessions inside external projects. It does NOT apply in the monorepo (ambient routing is off there by default).
12
+
13
+ ## What Vibe Is
14
+
15
+ Vibe is the translation layer between the user's natural language and the correct agent action. The user describes reality -- "we track deals by Shopify platform", "I'm stuck on this task", "what should I work on next" -- and vibe determines which of the seven intent types the message represents. The agent then routes to the right behavior without the user ever knowing the classification happened.
16
+
17
+ Vibe coders (non-technical builders) are the primary audience. They build by describing. They never memorize commands, IDs, or schema. The ambient layer closes the gap between what they say and what the system can act on.
18
+
19
+ ## The Seven Intent Types
20
+
21
+ ### 1. Capture
22
+
23
+ The user wants to record something new -- a task, a note, a piece of information that should persist.
24
+
25
+ **Recognize by:** action verbs like "add", "create", "remember", "track", "log", "note down", "write down", combined with a thing to record.
26
+
27
+ **Fixture examples:**
28
+
29
+ | Input | Why it's Capture |
30
+ | ------------------------------------------------- | ------------------------------------------- |
31
+ | "Add a task to follow up with the Shopify client" | Explicit "add a task" with a described item |
32
+ | "Remember to run the campaign report on Friday" | "Remember to" signals something to persist |
33
+ | "Run the campaign report every Friday at 9am" | Repeating schedule vocabulary to persist |
34
+ | "Track this conversation as a deal note" | Explicit "track" with a described artifact |
35
+
36
+ **Agent action:** draft the capture in plain language, confirm with the user, then execute via `elevasis-sdk project:*` commands for project records or `elevasis-sdk schedule:create` for recurring automation. Use repetition vocabulary ("every", "daily", "weekly", "monthly") for schedules; one-shot future reminders stay project tasks with due dates. Never write without confirmation.
37
+
38
+ ### 2. Query
39
+
40
+ The user wants to know something about current state -- task priorities, what is pending, what is running, what failed.
41
+
42
+ **Recognize by:** questions about the current list, status, or queue of things. Includes both static-model queries ("what systems are on?") and runtime-entity queries ("what's pending in the queue?"). Route Query to static-model sources (org model, Systems/Actions config) or runtime sources (operations domain) based on the referenced entity.
43
+
44
+ **Fixture examples:**
45
+
46
+ | Input | Why it's Query |
47
+ | -------------------------------------------- | ------------------------------------------- |
48
+ | "What should I work on next?" | Asking for prioritized task list |
49
+ | "What's pending in the HITL queue?" | Runtime-entity query about operations state |
50
+ | "What runs this week?" | Runtime query about upcoming schedules |
51
+ | "What systems are enabled for this project?" | Static-model query about Systems config |
52
+
53
+ **Agent action:** read the relevant source and narrate the answer in plain language. Use org model or `project:*` for project state, `elevasis-sdk queue:list --status pending --pretty` and `queue:status --pretty` for HITL queue state, and `elevasis-sdk schedule:list --status active --pretty` for upcoming recurring automation. No writes.
54
+
55
+ ### 3. Describe
56
+
57
+ The user wants the agent to explain something -- a scope, an entity, a concept within the project.
58
+
59
+ **Recognize by:** "what is", "what does", "tell me about", "explain", "where am I", "what's going on", "describe", "show me" without an action intent attached.
60
+
61
+ **Fixture examples:**
62
+
63
+ | Input | Why it's Describe |
64
+ | ------------------------------------------ | ----------------------------------------------------- |
65
+ | "What's going on with the ZentaraHQ deal?" | Asking for a plain-language description of an entity |
66
+ | "Tell me about the CRM system" | Asking the agent to narrate what a model element does |
67
+ | "Where am I in this project?" | Asking for current scope narration |
68
+
69
+ **Agent action:** read the relevant org-model label, entity, or scope. Narrate in plain language using label fields from the model -- never invent vocabulary not present in the model. Phase-1 scope covers Model, Systems/Actions, and Foundations layers only.
70
+
71
+ **Stage/state/catalog sub-routing:** when the noun being described is a stage, state, status
72
+ bucket, catalog entry, progress step, pipeline column, or similarly closed business vocabulary,
73
+ also show the cross-system impact before the normal description:
74
+
75
+ 1. Read `node_modules/@elevasis/sdk/reference/spine/spine-primer.md` for the layering pattern.
76
+ 2. Read the relevant domain in `core/config/organization-model.ts`.
77
+ 3. Explain the impact in vibe-coder language only: the business profile entry, the saved progress
78
+ on each record, the automations that produce updates, and the dashboard or reports that read it.
79
+ 4. Route follow-up changes through `/knowledge <domain>`. Do not mention the technical pattern name
80
+ unless the user explicitly asks for internals.
81
+
82
+ ### 4. Transition
83
+
84
+ The user wants to change the status of a task or entity.
85
+
86
+ **Recognize by:** single-word or short-phrase state signals -- "done", "finished", "complete", "blocked", "stuck", "waiting", "in review", "cancelled" -- applied to a current task or named entity.
87
+
88
+ **Fixture examples:**
89
+
90
+ | Input | Why it's Transition |
91
+ | --------------------------------------------- | ------------------------------------------- |
92
+ | "Done with the proposal draft" | "Done" + named artifact = status transition |
93
+ | "Stuck -- blocked waiting on client feedback" | "Stuck" + reason = blocked transition |
94
+ | "Mark the onboarding task as complete" | Explicit status-change vocabulary |
95
+ | "Approve the pending checkpoint" | Selects an action from the HITL queue |
96
+ | "Pause the Friday report" | Changes schedule state |
97
+
98
+ **Agent action:** identify the task, queue item, schedule, or entity being transitioned, confirm the new status/action with the user, then apply it via `elevasis-sdk project:task:save`, `elevasis-sdk queue:select <id> --action-id <id>`, `elevasis-sdk queue:expire <id>`, `elevasis-sdk schedule:pause <id>`, `schedule:resume <id>`, or `schedule:cancel <id>` as appropriate. Never auto-transition without confirmation if the target entity is ambiguous.
99
+
100
+ ### 5. Navigate
101
+
102
+ The user wants to shift focus -- to a different task, project, System, Action, or layer of the model.
103
+
104
+ **Recognize by:** focus-shift vocabulary -- "focus on", "let's look at", "switch to", "back to", "move to", "open", "go to" -- followed by a scope target.
105
+
106
+ **Fixture examples:**
107
+
108
+ | Input | Why it's Navigate |
109
+ | -------------------------------------------- | --------------------------------------------------- |
110
+ | "Let's focus on the onboarding flow for now" | "Focus on" + scope target |
111
+ | "Switch to the Shopify integration project" | "Switch to" = navigate to a different project scope |
112
+ | "Back to the CRM tasks" | "Back to" = return to a prior scope |
113
+
114
+ **Agent action:** update the active scope in `prj_tasks.resume_context` (current project + task pointer), then narrate the new scope in plain language so the user knows where they are.
115
+
116
+ ### 6. Codify
117
+
118
+ The user describes organizational reality that is not yet expressed in the model -- industry type, entity kinds, custom attributes, renamed stages, domain vocabulary.
119
+
120
+ **Recognize by:** declarative "we are" / "we use" / "we track" statements, repeated attribute mentions (second time the same attribute appears), or explicit "add a type / add a field / model X as Y" requests.
121
+
122
+ **Fixture examples:**
123
+
124
+ | Input | Why it's Codify |
125
+ | -------------------------------------------------------------------------------- | -------------------------------------------------------- |
126
+ | "We're an e-commerce company -- all our deals come from Shopify or Amazon" | Declares industry + platform attributes not yet in model |
127
+ | "We track deal stage as discovery, scoping, proposal, closed" | Describes custom CRM stages that should replace defaults |
128
+ | "Add a project type called 'retainer' with monthly billing and a contract field" | Explicit request to add a new entity extension |
129
+
130
+ **Agent action:** delegate immediately to `/knowledge`. Do not attempt the ceremony yourself. Invoke with the relevant domain: `/knowledge sales` for deal/contact changes, `/knowledge projects` for project types, `/knowledge systems` for availability/routing toggles, and `/knowledge actions` for invokable operation changes. Plain-language summary of what was detected is acceptable before delegating, but the actual draft-confirm-write ceremony belongs to `/knowledge`.
131
+
132
+ **Stage/state/catalog impact preview:** if the Codify intent adds, renames, removes, reorders, or
133
+ re-scopes a stage, state, status bucket, catalog member, pipeline step, or progress vocabulary,
134
+ preview the cross-system impact before delegating:
135
+
136
+ - Which business-profile entry changes.
137
+ - Which saved record progress keys may already exist.
138
+ - Which automations or templates reference the key.
139
+ - Which dashboard, report, queue, or API reads may display or filter by it.
140
+
141
+ Then delegate to `/knowledge <domain>` with that preview as context. Vibe does not write the
142
+ change and does not expose monorepo-only commands.
143
+
144
+ This routing applies to both codify levels (decision #21 -- Codify ceremony delegated to `/knowledge`):
145
+
146
+ - **Level A** (config-only edits to `organization-model.ts`, System availability/routing toggles, label renames): delegate to `/knowledge <domain>` immediately.
147
+ - **Level B** (new Zod extension files in `core/config/extensions/`): also delegate to `/knowledge <domain>`; `/knowledge` gates Level B to explicit user asks before scaffolding a new TS file.
148
+
149
+ Vibe detects the intent and delegates in both cases. It does not run either pipeline itself.
150
+
151
+ For "build/extend the CRM" asks, classify the structural org-model portion as Codify, then read `node_modules/@elevasis/sdk/reference/scaffold/recipes/extend-crm.md` before editing. CRM work often spans org-model sales semantics, shared UI routes, hooks, workflow adapters, and deal actions; do not reduce it to only `sales` config or only UI.
152
+
153
+ For "build/extend lead gen" / "campaign creator" / "outbound list state" asks, classify the structural org-model portion as Codify, then read `node_modules/@elevasis/sdk/reference/scaffold/recipes/extend-lead-gen.md` before editing. Lead-gen work often spans org-model prospecting semantics, shared UI routes, hooks, list/member state, artifacts, and workflow adapters; do not reduce it to only `prospecting` config or only UI.
154
+
155
+ For "add a custom CRM action" / "Send Quote button" asks, classify as Codify, then read `node_modules/@elevasis/sdk/reference/scaffold/recipes/customize-crm-actions.md` before editing. Start with the shared `crmActions` provider path for action visibility, labels, ordering, and render-time configuration. In v1, platform-known/default action endpoint behavior is server-constrained; use project-owned UI that calls the workflow directly when a custom key sits outside that server-dispatched set.
156
+
157
+ Heuristics for when to propose codification (passed to `/knowledge` as context):
158
+
159
+ - First mention of a new attribute: note to `resume_context`, do not propose yet
160
+ - Second mention OR explicit declaration ("we're ecom"): propose extension
161
+ - Explicit ask ("track ecom deals separately"): propose immediately with fuller scope
162
+ - Attribute appearing across 3+ tasks: propose adding field to existing extension
163
+
164
+ ### 7. Toggle
165
+
166
+ The user wants to enable or disable a System.
167
+
168
+ **Recognize by:** system-control vocabulary -- "turn on", "enable", "disable", "turn off", "activate", "deactivate" -- followed by a System name or description.
169
+
170
+ **Fixture examples:**
171
+
172
+ | Input | Why it's Toggle |
173
+ | ------------------------------- | -------------------------------------------- |
174
+ | "Turn on the lead-gen system" | Explicit "turn on" + System name |
175
+ | "Disable monitoring for now" | "Disable" + System reference |
176
+ | "We don't use SEO, turn it off" | Declarative + "turn it off" = System disable |
177
+
178
+ **Agent action:** delegate to `/knowledge systems`. The ceremony (confirm + edit `core/config/organization-model.ts` + typecheck) belongs to `/knowledge`, not to the ambient rule.
179
+
180
+ ## Quick Reference Table
181
+
182
+ | Intent | Trigger signal | Routed to |
183
+ | ---------- | ---------------------------------------------------------------------- | ----------------------------------------------------------------------- |
184
+ | Capture | "add", "remember", "track", "log" + a thing | Agent -- draft + confirm + `project:*` or `schedule:create` CLI |
185
+ | Query | "what's next", "what's pending", "what failed", "what systems" | Agent -- read with `project:*`, `queue:*`, or `schedule:*` + narrate |
186
+ | Describe | "what is", "tell me about", "explain", "where am I" | Agent -- narrate from org model labels |
187
+ | Transition | "done", "stuck", "blocked", "finished", "complete", "approve", "pause" | Agent -- confirm + `project:task:save`, `queue:select`, or `schedule:*` |
188
+ | Navigate | "focus on", "switch to", "back to", "look at" | Agent -- update scope + narrate |
189
+ | Codify | "we are X", "we track Y", repeated attribute, "add type/field" | Delegate to `/knowledge \<domain>` |
190
+ | Toggle | "enable", "disable", "turn on/off" + system | Delegate to `/knowledge systems` |
191
+
192
+ ## Source of Truth for Plain Language
193
+
194
+ All plain-language labels come from the OrganizationModel itself -- never from hardcoded strings in this rule file. Every status, entity kind, and layer name in the model carries an inline `label` field (e.g., `{ id: 'revision_requested', label: 'changes needed', semanticClass: 'blocked' }`). When narrating state or confirming an action, read the label from the model and use it verbatim. Do not invent synonyms or fallback vocabulary.
195
+
196
+ The unified manifest (delivered via `@elevasis/core/organization-model`) is the canonical vocabulary surface. Vibe classifies against it -- Systems, Actions, statuses, operations entities, and resource kinds are all discoverable from the manifest without hardcoding.
197
+
198
+ ## Ambiguous Intent
199
+
200
+ When the user's input does not clearly map to one of the seven types, ask one clarifying question. Do not guess. Do not apply a precedence rule. Do not route to the "closest" intent.
201
+
202
+ Format: a single neutral question that presents the two (or three) plausible intents as options and asks which the user means.
203
+
204
+ Example: "That could be a note to capture or a status update on the current task -- which did you mean?"
205
+
206
+ Never ask more than one question per ambiguous input. If the user's reply is still ambiguous, ask once more, then surface the options explicitly.
207
+
208
+ ## Classifier Threshold
209
+
210
+ Default threshold: `balanced`.
211
+
212
+ The threshold controls how aggressively the classifier proposes codification from ambiguous signals:
213
+
214
+ - `strict` -- only explicit declarations or repeat mentions trigger codify proposals
215
+ - `balanced` -- second mention OR explicit declaration triggers; default
216
+ - `loose` -- first strong signal triggers a proposal
217
+
218
+ Override per project in `core/config/organization-model.ts` under `vibe.classifierThreshold`. The override is merge-aware (Tier 2 sync) and will not be overwritten by template sync operations.
219
+
220
+ ## Phase-1 Scope
221
+
222
+ This rule covers Phase 1 of the vibe layer rollout. The layers the ambient classifier can narrate and codify in Phase 1 are:
223
+
224
+ - Layer 1 (Model): narrate schema shape, propose codification edits via `/knowledge`
225
+ - Layer 4 (Systems/Actions): describe which Systems are on/off, propose enabling one via `/knowledge`
226
+ - Layer 7 (Foundations): explain and edit `organization-model.ts` and `extensions/` via `/knowledge`
227
+
228
+ Layers 2 (Public API), 3 (UI Shell Runtime), 5 (Toolkit), and 6 (Graph) require runtime read APIs that are not yet available. Do not attempt to narrate or classify against those layers in Phase 1. If the user's input clearly references one of those layers, acknowledge the scope and explain that full support arrives in a later phase.
229
+
230
+ ## What Vibe Is Not
231
+
232
+ - Vibe is not a slash command. There is no `/vibe` invocation (decision #19 -- ambient rule, not a skill or command).
233
+ - Vibe is not a skill. It lives in this rule file + CLAUDE.md + the PreToolUse hook -- not in `.claude/skills/`.
234
+ - Vibe does not own the codify ceremony. `/knowledge` owns draft, confirm, write, and typecheck for both Level A and Level B codify pipelines (decision #21 -- Codify ceremony delegated to `/knowledge`). Vibe detects intent and hands off.
235
+ - Vibe is not active in the monorepo. If working inside the monorepo (not an `external/` project), this ambient routing does not apply.
@@ -1,18 +1,18 @@
1
- #!/usr/bin/env node
2
- let input = ''
3
- process.stdin.on('data', (chunk) => (input += chunk))
4
- process.stdin.on('end', () => {
5
- const data = JSON.parse(input)
6
- const model = data.model?.display_name || '?'
7
- const pct = Math.floor(data.context_window?.used_percentage || 0)
8
-
9
- const DIM = '\x1b[90m',
10
- RESET = '\x1b[0m'
11
-
12
- const ctxSize = data.context_window?.context_window_size || 0
13
- const usedTokens = Math.round((ctxSize * pct) / 100)
14
- const rounded = Math.round(usedTokens / 100) * 100
15
- const tokenStr = rounded >= 1000 ? (rounded / 1000).toFixed(1).replace(/\.0$/, '') + 'k' : String(rounded)
16
-
17
- console.log(`${DIM}[${RESET}${model}${DIM}]${RESET} ${tokenStr} Tokens`)
18
- })
1
+ #!/usr/bin/env node
2
+ let input = ''
3
+ process.stdin.on('data', (chunk) => (input += chunk))
4
+ process.stdin.on('end', () => {
5
+ const data = JSON.parse(input)
6
+ const model = data.model?.display_name || '?'
7
+ const pct = Math.floor(data.context_window?.used_percentage || 0)
8
+
9
+ const DIM = '\x1b[90m',
10
+ RESET = '\x1b[0m'
11
+
12
+ const ctxSize = data.context_window?.context_window_size || 0
13
+ const usedTokens = Math.round((ctxSize * pct) / 100)
14
+ const rounded = Math.round(usedTokens / 100) * 100
15
+ const tokenStr = rounded >= 1000 ? (rounded / 1000).toFixed(1).replace(/\.0$/, '') + 'k' : String(rounded)
16
+
17
+ console.log(`${DIM}[${RESET}${model}${DIM}]${RESET} ${tokenStr} Tokens`)
18
+ })
@@ -1,34 +1,34 @@
1
- {
2
- "statusLine": {
3
- "type": "command",
4
- "command": "node .claude/scripts/statusline-command.js"
5
- },
6
- "hooks": {
7
- "PostToolUse": [
8
- {
9
- "matcher": "Write|Edit|MultiEdit",
10
- "hooks": [
11
- {
12
- "type": "command",
13
- "command": "node .claude/hooks/post-edit-validate.mjs"
14
- },
15
- {
16
- "type": "command",
17
- "command": "node .claude/hooks/scaffold-registry-reminder.mjs"
18
- }
19
- ]
20
- }
21
- ],
22
- "PostToolUseFailure": [
23
- {
24
- "matcher": "Bash",
25
- "hooks": [
26
- {
27
- "type": "command",
28
- "command": "node .claude/hooks/tool-failure-recovery.mjs"
29
- }
30
- ]
31
- }
32
- ]
33
- }
34
- }
1
+ {
2
+ "statusLine": {
3
+ "type": "command",
4
+ "command": "node .claude/scripts/statusline-command.js"
5
+ },
6
+ "hooks": {
7
+ "PostToolUse": [
8
+ {
9
+ "matcher": "Write|Edit|MultiEdit",
10
+ "hooks": [
11
+ {
12
+ "type": "command",
13
+ "command": "node .claude/hooks/post-edit-validate.mjs"
14
+ },
15
+ {
16
+ "type": "command",
17
+ "command": "node .claude/hooks/scaffold-registry-reminder.mjs"
18
+ }
19
+ ]
20
+ }
21
+ ],
22
+ "PostToolUseFailure": [
23
+ {
24
+ "matcher": "Bash",
25
+ "hooks": [
26
+ {
27
+ "type": "command",
28
+ "command": "node .claude/hooks/tool-failure-recovery.mjs"
29
+ }
30
+ ]
31
+ }
32
+ ]
33
+ }
34
+ }