@elevasis/sdk 1.6.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/cli.cjs +527 -4564
  2. package/dist/index.d.ts +72 -16
  3. package/package.json +2 -2
  4. package/reference/claude-config/hooks/post-edit-validate.mjs +0 -11
  5. package/reference/claude-config/hooks/scaffold-registry-reminder.mjs +188 -0
  6. package/reference/claude-config/logs/pre-edit-vibe-gate.log +40 -0
  7. package/reference/claude-config/logs/scaffold-registry-reminder.log +17 -0
  8. package/reference/claude-config/rules/active-change-index.md +80 -0
  9. package/reference/claude-config/rules/agent-start-here.md +254 -0
  10. package/reference/claude-config/rules/deployment.md +0 -1
  11. package/reference/claude-config/rules/observability.md +2 -2
  12. package/reference/claude-config/rules/operations.md +64 -0
  13. package/reference/claude-config/rules/organization-model.md +44 -0
  14. package/reference/claude-config/rules/organization-os.md +56 -11
  15. package/reference/claude-config/rules/task-tracking.md +4 -4
  16. package/reference/claude-config/rules/ui.md +202 -0
  17. package/reference/claude-config/rules/vibe.md +202 -0
  18. package/reference/claude-config/settings.json +4 -0
  19. package/reference/claude-config/skills/configure/SKILL.md +98 -0
  20. package/reference/claude-config/skills/configure/operations/codify-level-a.md +100 -0
  21. package/reference/claude-config/skills/configure/operations/codify-level-b.md +158 -0
  22. package/reference/claude-config/skills/configure/operations/customers.md +150 -0
  23. package/reference/claude-config/skills/configure/operations/features.md +161 -0
  24. package/reference/claude-config/skills/configure/operations/goals.md +147 -0
  25. package/reference/claude-config/skills/configure/operations/identity.md +133 -0
  26. package/reference/claude-config/skills/configure/operations/labels.md +128 -0
  27. package/reference/claude-config/skills/configure/operations/offerings.md +159 -0
  28. package/reference/claude-config/skills/configure/operations/roles.md +153 -0
  29. package/reference/claude-config/skills/configure/operations/techStack.md +139 -0
  30. package/reference/claude-config/skills/deploy/SKILL.md +3 -13
  31. package/reference/claude-config/skills/dsp/SKILL.md +2 -2
  32. package/reference/claude-config/skills/elevasis/SKILL.md +0 -4
  33. package/reference/claude-config/skills/explore/SKILL.md +5 -5
  34. package/reference/claude-config/skills/project/SKILL.md +1 -1
  35. package/reference/claude-config/skills/save/SKILL.md +5 -19
  36. package/reference/claude-config/skills/setup/SKILL.md +105 -40
  37. package/reference/claude-config/skills/status/SKILL.md +2 -3
  38. package/reference/claude-config/skills/submit-request/SKILL.md +1 -1
  39. package/reference/deployment/command-center.mdx +0 -17
  40. package/reference/framework/project-structure.mdx +1 -5
  41. package/reference/packages/core/src/organization-model/README.md +16 -12
  42. package/reference/packages/ui/src/hooks/README.md +1 -2
  43. package/reference/scaffold/core/organization-graph.mdx +1 -0
  44. package/reference/scaffold/core/organization-model.mdx +84 -19
  45. package/reference/scaffold/operations/propagation-pipeline.md +10 -11
  46. package/reference/scaffold/operations/scaffold-maintenance.md +1 -4
  47. package/reference/scaffold/recipes/add-a-feature.md +1 -1
  48. package/reference/scaffold/recipes/add-a-resource.md +3 -12
  49. package/reference/scaffold/recipes/customize-organization-model.md +5 -5
  50. package/reference/scaffold/recipes/gate-by-feature-or-admin.md +3 -3
  51. package/reference/scaffold/reference/contracts.md +115 -7
  52. package/reference/scaffold/reference/glossary.md +25 -4
  53. package/reference/claude-config/rules/docs.md +0 -26
@@ -0,0 +1,202 @@
1
+ ---
2
+ description: UI shell, route structure, auth flow, API access, and template customization points for the ui/ surface
3
+ paths:
4
+ - ui/**
5
+ ---
6
+
7
+ # UI Features
8
+
9
+ **Status:** Stable
10
+
11
+ ## App Shell Overview
12
+
13
+ The template frontend is a React 19 + TanStack Router app that composes a local dashboard shell with published feature manifests from `@elevasis/ui`.
14
+
15
+ The main join points are:
16
+
17
+ - `ui/src/main.tsx` -- boots the app with `ElevasisUIProvider`, query client, theme config, WorkOS AuthKit, notifications, and the generated route tree
18
+ - `ui/src/routes/__root.tsx` -- composes the authenticated shell with `ElevasisFeaturesProvider`, published feature manifests, app-local dashboard nav, shell runtime dependencies, and `FeatureShell`
19
+ - `ui/src/config/nav-items.ts` -- keeps the host-local dashboard entry separate from the published feature manifests
20
+ - `foundations/config/organization-model.ts` -- is the template's semantic source of truth, adapting `@elevasis/core/organization-model` into the preserved branding, dashboard label, quick-access, feature-label, and legacy surface helpers the shell still uses
21
+
22
+ Published feature manifests mounted by the template shell:
23
+
24
+ - `lead-gen`
25
+ - `crm`
26
+ - `delivery` at `/projects`
27
+ - `operations`
28
+ - `monitoring`
29
+ - `settings`
30
+
31
+ Important distinction:
32
+
33
+ - shared manifests gate on grouped org-model keys such as `acquisition` and `delivery`
34
+ - template routes and local nav may still use legacy aliases such as `crm`, `lead-gen`, and `projects`
35
+ - `foundations/config/organization-model.ts` and `ui/src/lib/hooks/useFeatureAccess.ts` are the bridge between those two vocabularies
36
+
37
+ Dashboard remains a host-local route at `/`, not a shared feature manifest.
38
+
39
+ This template should be treated as the downstream reference implementation for this composition:
40
+
41
+ - foundations owns the organization/runtime semantics
42
+ - `ui/src/config/nav-items.ts` preserves the host-local dashboard entry instead of pushing that concern into shared manifests
43
+ - `ui/src/routes/__root.tsx` threads `canonicalOrganizationModel` from foundations into `ElevasisFeaturesProvider` so the shared shell/runtime uses the same semantic source of truth as the local template helpers
44
+ - host-local customizations still stay local: dashboard remains app-owned nav, branding stays in app config, and quick-access/dashboard UX stays in the template app
45
+
46
+ ## Auth and Initialization
47
+
48
+ The app uses WorkOS AuthKit through `ElevasisUIProvider`. Authentication is enforced by the local `ProtectedRoute` wrapper in `ui/src/features/auth/ProtectedRoute.tsx`.
49
+
50
+ **Sign-in flow:**
51
+
52
+ 1. Unauthenticated user hits a protected route -- `ProtectedRoute` redirects to `/login?returnTo=<path>`
53
+ 2. `/login` renders a sign-in card; user clicks Sign In, triggering `signIn({ returnTo })` from `useAuth()`
54
+ 3. User authenticates on the WorkOS-hosted sign-in page
55
+ 4. WorkOS redirects back to `/auth-redirect` -- `ui/src/routes/auth-redirect.tsx` waits for auth to complete, then navigates to the requested path or `/`
56
+ 5. User lands on the home page, fully authenticated
57
+
58
+ **Route protection:**
59
+
60
+ Wrap protected route components with the local `ProtectedRoute` from `@/features/auth`, which adds the full-screen loader and delegates to the shared guard from `@elevasis/ui/auth`:
61
+
62
+ ```tsx
63
+ import { ProtectedRoute } from '@/features/auth'
64
+
65
+ function HomePageGuarded() {
66
+ return (
67
+ <ProtectedRoute>
68
+ <HomePage />
69
+ </ProtectedRoute>
70
+ )
71
+ }
72
+ ```
73
+
74
+ **Initialization state:**
75
+
76
+ Use `useInitialization()` from `@elevasis/ui/initialization` anywhere inside the app to read aggregated auth + org readiness:
77
+
78
+ ```ts
79
+ const { allReady, userReady, isInitializing, error, retry, profile } = useInitialization()
80
+ ```
81
+
82
+ **Organization context:**
83
+
84
+ Use `useOrganization()` from `@elevasis/ui/organization` to access org-scoped IDs and memberships:
85
+
86
+ ```ts
87
+ const { currentWorkOSOrganizationId, currentSupabaseOrganizationId, memberships, switchOrganization } = useOrganization()
88
+ ```
89
+
90
+ ## API and Streaming
91
+
92
+ Use `useApiClient()` from `@/lib/hooks/useApiClient` in route components and feature hooks:
93
+
94
+ ```ts
95
+ const { apiRequest, isOrganizationReady } = useApiClient()
96
+ const data = await apiRequest('/executions', { method: 'GET' })
97
+ ```
98
+
99
+ The template also re-exports `useApiClientContext()` and the shared API client types from `@/lib/hooks/useApiClient`.
100
+
101
+ For real-time updates, feature surfaces use the local singleton wrapper:
102
+
103
+ ```ts
104
+ import { sseConnectionManager } from '@/lib/sse/SSEConnectionManager'
105
+ ```
106
+
107
+ **Required env vars:**
108
+
109
+ ```bash
110
+ VITE_WORKOS_CLIENT_ID=client_...
111
+ VITE_WORKOS_REDIRECT_URI=http://localhost:4300/auth-redirect
112
+ VITE_WORKOS_SIGNOUT_URI=http://localhost:4300/login
113
+ ```
114
+
115
+ The API URL is centralized in `ui/src/lib/constants/api.ts`. In the current template it is hard-coded to `https://api.elevasis.io`, so if the bootstrap is repointed to another API target, that file is the source of truth.
116
+
117
+ ## Route Structure
118
+
119
+ Current top-level app sections:
120
+
121
+ - `/` -- host-local dashboard entrypoint with quick links derived from `organizationModel.navigation.quickAccessSurfaceIds`
122
+ - `/lead-gen/*` -- lead generation pages (`lists`, `companies`, `contacts`, `deliverability`)
123
+ - `/crm/*` -- CRM overview, pipeline, and deals
124
+ - `/projects/*` -- delivery feature pages (projects, milestones, tasks, notes)
125
+ - `/operations/*` -- operations overview, resources, command queue, command view, sessions, task scheduler
126
+ - `/monitoring/*` -- execution logs, execution health, activity log, cost analytics, notifications
127
+ - `/settings/*` -- account, organization, credentials, API keys, deployments, webhooks, and appearance
128
+ - `/login` and `/auth-redirect` -- auth entry/callback routes
129
+
130
+ Section guards currently follow this pattern:
131
+
132
+ - `ProtectedRoute` for all authenticated sections
133
+ - `FeatureGuard` on all feature sections that should hard-stop when a feature is disabled: `crm`, `lead-gen`, `projects`, `operations`, and `monitoring`
134
+ - provider-level shell gating for shared feature nav and sub-shell behavior
135
+
136
+ The app shell in `__root.tsx` derives visible nav from `shellModel.navItems`, filters admin-only entries locally using the signed-in profile, and passes `canonicalOrganizationModel` into `ElevasisFeaturesProvider` so shared nav labels, paths, and graph runtime behavior resolve from the same foundations-backed semantic model.
137
+
138
+ ## Dashboard and Feature Areas
139
+
140
+ **Dashboard**
141
+
142
+ `ui/src/features/dashboard/components/Dashboard.tsx` is intentionally lightweight. It acts as the host-owned landing page and renders quick access cards for the most important organization surfaces instead of duplicating the shared operations overview.
143
+
144
+ **Operations**
145
+
146
+ The operations area is the richest shared shell in the template. It includes:
147
+
148
+ - resource inventory and detail pages
149
+ - command queue and command view
150
+ - sessions screens
151
+ - the shared operations overview at `/operations/`
152
+
153
+ **Monitoring**
154
+
155
+ Monitoring is scaffolded as a shared feature area with route files for:
156
+
157
+ - activity log
158
+ - cost analytics
159
+ - execution health
160
+ - execution logs
161
+ - notifications
162
+
163
+ ## Customization Points
164
+
165
+ The main template-owned customization surfaces are:
166
+
167
+ - `ui/src/config/app-config.ts` -- brand name, logos, and app version
168
+ - `ui/src/config/theme.ts` -- theme presets and defaults
169
+ - `ui/src/config/background.tsx` -- shared background treatment
170
+ - `ui/src/config/loader.tsx` -- global loader element
171
+ - `ui/src/config/nav-items.ts` -- app-local nav entries, including the preserved dashboard/home entry
172
+ - `foundations/config/organization-model.ts` -- product labels, feature enablement, semantic surfaces, canonical-to-legacy surface aliases, and quick-access behavior
173
+ - `ui/src/config/README.md` -- the deeper guide for those config files
174
+
175
+ ## Customizing Feature Sidebars
176
+
177
+ The template demonstrates one override pattern in `ui/src/routes/__root.tsx`: it extends `CRM_ITEMS` with a template-owned Reports link and replaces `crmManifest` with `customCrmManifest` in the feature manifest array. The backing route lives at `ui/src/routes/crm/reports.tsx` -- delete both the nav item and the route if you don't need them.
178
+
179
+ Two customization layers are available for every shared feature sidebar:
180
+
181
+ 1. **Nav-item shortcut (`items` prop)** -- when you just need to swap or extend the nav array, spread the published items constant and pass the result to `*SidebarMiddle`. The template's CRM customization uses this path.
182
+
183
+ ```tsx
184
+ import { crmManifest, CrmSidebar, CrmSidebarMiddle, CRM_ITEMS } from '@elevasis/ui/features/crm'
185
+ import type { NavItem } from '@elevasis/ui/layout'
186
+
187
+ const customItems: NavItem[] = [...CRM_ITEMS, { label: 'Reports', to: '/crm/reports', icon: IconFileText, exact: false }]
188
+ const CustomCrmSidebar = () => <CrmSidebar><CrmSidebarMiddle items={customItems} /></CrmSidebar>
189
+ const customCrmManifest = { ...crmManifest, sidebar: CustomCrmSidebar }
190
+ ```
191
+
192
+ 2. **Compose-primitives (structural changes)** -- when you need to inject panels, reorder sections, or add a new section, drop down to `CrmSidebarTop` + `SubshellNavList` + `SubshellSidebarSection` + published panels (`MyTasksPanel`, `QuickCreateActions`) and compose your own Middle.
193
+
194
+ `manifest.sidebar` accepts any component, so arbitrary customization is always available. The `items` prop is an abstraction barrier for the common case, not a limit.
195
+
196
+ See `node_modules/@elevasis/sdk/reference/scaffold/ui/customization.md` for the decision tree, page-wrapping pattern, and delivery's three-section variant. See `node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md` for `NavItem`, `FeatureModule`, and related TypeScript shapes.
197
+
198
+ ## Notes
199
+
200
+ - `ui/src/routeTree.gen.ts` is generated by TanStack Router tooling. Do not hand-edit it.
201
+ - The template ships a broad route surface so downstream projects can trim or reshape features without having to re-derive the shared shell contract from scratch.
202
+ - For package-export discovery, glob `node_modules/@elevasis/sdk/reference/` or `node_modules/@repo/ui/dist/` for the current SDK/UI package surface.
@@ -0,0 +1,202 @@
1
+ ---
2
+ description: Ambient intent classifier -- routes natural-language input to 7 intent buckets without a slash command; Codify and Toggle delegate to /configure
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
+ | "Track this conversation as a deal note" | Explicit "track" with a described artifact |
34
+
35
+ **Agent action:** draft the capture in plain language, confirm with the user, then execute via `elevasis-sdk project:*` commands. Never write without confirmation.
36
+
37
+ ### 2. Query
38
+
39
+ The user wants to know something about current state -- task priorities, what is pending, what is running, what failed.
40
+
41
+ **Recognize by:** questions about the current list, status, or queue of things. Includes both static-model queries ("what features are on?") and runtime-entity queries ("what's pending in the queue?"). Route Query to static-model sources (org model, features config) or runtime sources (operations domain) based on the referenced entity.
42
+
43
+ **Fixture examples:**
44
+
45
+ | Input | Why it's Query |
46
+ | --------------------------------------------- | ------------------------------------------- |
47
+ | "What should I work on next?" | Asking for prioritized task list |
48
+ | "What's pending in the HITL queue?" | Runtime-entity query about operations state |
49
+ | "What features are enabled for this project?" | Static-model query about features config |
50
+
51
+ **Agent action:** read the relevant source (org model, `prj_tasks`, operations domain as available) and narrate the answer in plain language. No writes.
52
+
53
+ ### 3. Describe
54
+
55
+ The user wants the agent to explain something -- a scope, an entity, a concept within the project.
56
+
57
+ **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.
58
+
59
+ **Fixture examples:**
60
+
61
+ | Input | Why it's Describe |
62
+ | ------------------------------------------ | ----------------------------------------------------- |
63
+ | "What's going on with the ZentaraHQ deal?" | Asking for a plain-language description of an entity |
64
+ | "Tell me about the CRM feature" | Asking the agent to narrate what a model element does |
65
+ | "Where am I in this project?" | Asking for current scope narration |
66
+
67
+ **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, Features, and Foundations layers only.
68
+
69
+ ### 4. Transition
70
+
71
+ The user wants to change the status of a task or entity.
72
+
73
+ **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.
74
+
75
+ **Fixture examples:**
76
+
77
+ | Input | Why it's Transition |
78
+ | --------------------------------------------- | ------------------------------------------- |
79
+ | "Done with the proposal draft" | "Done" + named artifact = status transition |
80
+ | "Stuck -- blocked waiting on client feedback" | "Stuck" + reason = blocked transition |
81
+ | "Mark the onboarding task as complete" | Explicit status-change vocabulary |
82
+
83
+ **Agent action:** identify the task or entity being transitioned, confirm the new status with the user, then apply the transition via `elevasis-sdk project:task:save` or equivalent. Never auto-transition without confirmation if the target entity is ambiguous.
84
+
85
+ ### 5. Navigate
86
+
87
+ The user wants to shift focus -- to a different task, project, feature, or layer of the model.
88
+
89
+ **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.
90
+
91
+ **Fixture examples:**
92
+
93
+ | Input | Why it's Navigate |
94
+ | -------------------------------------------- | --------------------------------------------------- |
95
+ | "Let's focus on the onboarding flow for now" | "Focus on" + scope target |
96
+ | "Switch to the Shopify integration project" | "Switch to" = navigate to a different project scope |
97
+ | "Back to the CRM tasks" | "Back to" = return to a prior scope |
98
+
99
+ **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.
100
+
101
+ ### 6. Codify
102
+
103
+ The user describes organizational reality that is not yet expressed in the model -- industry type, entity kinds, custom attributes, renamed stages, domain vocabulary.
104
+
105
+ **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.
106
+
107
+ **Fixture examples:**
108
+
109
+ | Input | Why it's Codify |
110
+ | -------------------------------------------------------------------------------- | -------------------------------------------------------- |
111
+ | "We're an e-commerce company -- all our deals come from Shopify or Amazon" | Declares industry + platform attributes not yet in model |
112
+ | "We track deal stage as discovery, scoping, proposal, closed" | Describes custom CRM stages that should replace defaults |
113
+ | "Add a project type called 'retainer' with monthly billing and a contract field" | Explicit request to add a new entity extension |
114
+
115
+ **Agent action:** delegate immediately to `/configure`. Do not attempt the ceremony yourself. Invoke with the relevant domain: `/configure crm` for deal/contact changes, `/configure projects` for project types, `/configure features` for feature toggles. Plain-language summary of what was detected is acceptable before delegating, but the actual draft-confirm-write ceremony belongs to `/configure`.
116
+
117
+ This routing applies to both codify levels (decision #21 -- Codify ceremony delegated to `/configure`):
118
+
119
+ - **Level A** (config-only edits to `organization-model.ts`, feature toggles, label renames): delegate to `/configure <domain>` immediately.
120
+ - **Level B** (new Zod extension files in `foundations/config/extensions/`): also delegate to `/configure <domain>`; `/configure` gates Level B to explicit user asks before scaffolding a new TS file.
121
+
122
+ Vibe detects the intent and delegates in both cases. It does not run either pipeline itself.
123
+
124
+ Heuristics for when to propose codification (passed to `/configure` as context):
125
+
126
+ - First mention of a new attribute: note to `resume_context`, do not propose yet
127
+ - Second mention OR explicit declaration ("we're ecom"): propose extension
128
+ - Explicit ask ("track ecom deals separately"): propose immediately with fuller scope
129
+ - Attribute appearing across 3+ tasks: propose adding field to existing extension
130
+
131
+ ### 7. Toggle
132
+
133
+ The user wants to enable or disable a feature.
134
+
135
+ **Recognize by:** feature-control vocabulary -- "turn on", "enable", "disable", "turn off", "activate", "deactivate" -- followed by a feature name or description.
136
+
137
+ **Fixture examples:**
138
+
139
+ | Input | Why it's Toggle |
140
+ | ------------------------------- | --------------------------------------------- |
141
+ | "Turn on the lead-gen feature" | Explicit "turn on" + feature name |
142
+ | "Disable monitoring for now" | "Disable" + feature reference |
143
+ | "We don't use SEO, turn it off" | Declarative + "turn it off" = feature disable |
144
+
145
+ **Agent action:** delegate to `/configure features`. The ceremony (confirm + edit `foundations/config/organization-model.ts` + typecheck) belongs to `/configure`, not to the ambient rule.
146
+
147
+ ## Quick Reference Table
148
+
149
+ | Intent | Trigger signal | Routed to |
150
+ | ---------- | --------------------------------------------------------------- | ------------------------------------------ |
151
+ | Capture | "add", "remember", "track", "log" + a thing | Agent -- draft + confirm + `project:*` CLI |
152
+ | Query | "what's next", "what's pending", "what failed", "what features" | Agent -- read + narrate |
153
+ | Describe | "what is", "tell me about", "explain", "where am I" | Agent -- narrate from org model labels |
154
+ | Transition | "done", "stuck", "blocked", "finished", "complete" | Agent -- confirm + `project:task:save` |
155
+ | Navigate | "focus on", "switch to", "back to", "look at" | Agent -- update scope + narrate |
156
+ | Codify | "we are X", "we track Y", repeated attribute, "add type/field" | Delegate to `/configure \<domain>` |
157
+ | Toggle | "enable", "disable", "turn on/off" + feature | Delegate to `/configure features` |
158
+
159
+ ## Source of Truth for Plain Language
160
+
161
+ 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.
162
+
163
+ The unified manifest (delivered via `@elevasis/core/organization-model`) is the canonical vocabulary surface. Vibe classifies against it -- capabilities, features, statuses, operations entities, and resource kinds are all discoverable from the manifest without hardcoding.
164
+
165
+ ## Ambiguous Intent
166
+
167
+ 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.
168
+
169
+ Format: a single neutral question that presents the two (or three) plausible intents as options and asks which the user means.
170
+
171
+ Example: "That could be a note to capture or a status update on the current task -- which did you mean?"
172
+
173
+ 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.
174
+
175
+ ## Classifier Threshold
176
+
177
+ Default threshold: `balanced`.
178
+
179
+ The threshold controls how aggressively the classifier proposes codification from ambiguous signals:
180
+
181
+ - `strict` -- only explicit declarations or repeat mentions trigger codify proposals
182
+ - `balanced` -- second mention OR explicit declaration triggers; default
183
+ - `loose` -- first strong signal triggers a proposal
184
+
185
+ Override per project in `foundations/config/organization-model.ts` under `vibe.classifierThreshold`. The override is merge-aware (Tier 2 sync) and will not be overwritten by template sync operations.
186
+
187
+ ## Phase-1 Scope
188
+
189
+ This rule covers Phase 1 of the vibe layer rollout. The layers the ambient classifier can narrate and codify in Phase 1 are:
190
+
191
+ - Layer 1 (Model): narrate schema shape, propose codification edits via `/configure`
192
+ - Layer 4 (Features): describe which features are on/off, propose enabling one via `/configure`
193
+ - Layer 7 (Foundations): explain and edit `organization-model.ts` and `extensions/` via `/configure`
194
+
195
+ 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.
196
+
197
+ ## What Vibe Is Not
198
+
199
+ - Vibe is not a slash command. There is no `/vibe` invocation (decision #19 -- ambient rule, not a skill or command).
200
+ - Vibe is not a skill. It lives in this rule file + CLAUDE.md + the PreToolUse hook -- not in `.claude/skills/`.
201
+ - Vibe does not own the codify ceremony. `/configure` owns draft, confirm, write, and typecheck for both Level A and Level B codify pipelines (decision #21 -- Codify ceremony delegated to `/configure`). Vibe detects intent and hands off.
202
+ - Vibe is not active in the monorepo. If working inside the monorepo (not an `external/` project), this ambient routing does not apply.
@@ -11,6 +11,10 @@
11
11
  {
12
12
  "type": "command",
13
13
  "command": "node .claude/hooks/post-edit-validate.mjs"
14
+ },
15
+ {
16
+ "type": "command",
17
+ "command": "node .claude/hooks/scaffold-registry-reminder.mjs"
14
18
  }
15
19
  ]
16
20
  }
@@ -0,0 +1,98 @@
1
+ ---
2
+ name: configure
3
+ description: "Recurring organization model editor — layered QA flow across identity, customers, offerings, roles, goals, and techStack. Idempotent, confirm-before-overwrite. Codifies changes to foundations/config/organization-model.ts with runtime validation gate."
4
+ argument-hint: "[identity|customers|offerings|roles|goals|techStack|features|labels]"
5
+ context: fork
6
+ allowed-tools: Read, Write, Edit, Glob, Grep, Bash
7
+ ---
8
+
9
+ # Configure
10
+
11
+ Recurring, safe-to-re-run org model editor for external projects. Reads the organization model as the single source of truth and guides the user through structured updates — either across all domains in a layered flow, or targeted at a single domain by argument.
12
+
13
+ **Usage:**
14
+
15
+ - `/configure` -- Layered flow: walks identity → customers → offerings → roles → goals → techStack in sequence
16
+ - `/configure identity` -- Target only the identity domain
17
+ - `/configure customers` -- Target only the customers domain
18
+ - `/configure offerings` -- Target only the offerings domain
19
+ - `/configure roles` -- Target only the roles domain
20
+ - `/configure goals` -- Target only the goals domain
21
+ - `/configure techStack` -- Target only the techStack domain (resource mapping extensions)
22
+ - `/configure features` -- Enable, disable, or add features; Level A (defaults) or Level B (new extension TS files)
23
+ - `/configure labels` -- Edit inline display labels on enum entries (statuses, stages, categories)
24
+
25
+ **Distinction from `/setup`:** `/setup` is for first-time bootstrap (placeholder replacement, dependency install, build verification). `/configure` is for recurring org-model updates. After first run, `/setup` delegates here.
26
+
27
+ ---
28
+
29
+ ## Goal
30
+
31
+ Keep `foundations/config/organization-model.ts` accurate and validated. Every edit proposed by this skill ends with `resolveOrganizationModel()` + `OrganizationModelSchema.parse()` confirming the merged result is valid — and a full TypeScript type-check via `pnpm -C operations check-types` to catch static errors. If validation fails, the change is rolled back.
32
+
33
+ ---
34
+
35
+ ## Pre-Flight: Read the Current Model
36
+
37
+ Before any domain flow, read the current organization model adapter:
38
+
39
+ ```
40
+ Read("foundations/config/organization-model.ts")
41
+ ```
42
+
43
+ This is the single source of truth. All proposals must start from what is currently in this file, not from stale context.
44
+
45
+ ---
46
+
47
+ ## Mode Detection
48
+
49
+ - **No argument:** run the layered flow (all domains, one at a time in the order below).
50
+ - **Argument matches a domain name** (`identity`, `customers`, `offerings`, `roles`, `goals`, `techStack`): run only that domain's operation.
51
+ - **Argument is `features`:** run the features operation.
52
+ - **Argument is `labels`:** run the labels operation.
53
+ - **Argument is unrecognized:** ask the user which domain they meant.
54
+
55
+ ---
56
+
57
+ ## Layered Flow (Default)
58
+
59
+ When run without an argument, execute operations in this order. After each domain, ask "Ready to move on to [next domain]?" and pause for confirmation. The user can stop after any domain — partial updates are valid.
60
+
61
+ 1. `identity` -- EXECUTE `.claude/skills/configure/operations/identity.md`
62
+ 2. `customers` -- EXECUTE `.claude/skills/configure/operations/customers.md`
63
+ 3. `offerings` -- EXECUTE `.claude/skills/configure/operations/offerings.md`
64
+ 4. `roles` -- EXECUTE `.claude/skills/configure/operations/roles.md`
65
+ 5. `goals` -- EXECUTE `.claude/skills/configure/operations/goals.md`
66
+ 6. `techStack` -- EXECUTE `.claude/skills/configure/operations/techStack.md`
67
+
68
+ ---
69
+
70
+ ## Operations
71
+
72
+ | Operation | File | Description |
73
+ | ---------------- | ------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
74
+ | `identity` | `.claude/skills/configure/operations/identity.md` | Legal identity, mission, vision, industry, geography, timezone, business hours |
75
+ | `customers` | `.claude/skills/configure/operations/customers.md` | Customer segments with jobs-to-be-done, pains, gains, firmographics, value props |
76
+ | `offerings` | `.claude/skills/configure/operations/offerings.md` | Products and services with pricing model, price, currency, and segment/feature refs |
77
+ | `roles` | `.claude/skills/configure/operations/roles.md` | Role chart with responsibilities, reporting lines, and role holders |
78
+ | `goals` | `.claude/skills/configure/operations/goals.md` | Organizational goals with period and measurable outcomes |
79
+ | `techStack` | `.claude/skills/configure/operations/techStack.md` | External integration registry — platform, purpose, credential status, system-of-record flag |
80
+ | `features` | `.claude/skills/configure/operations/features.md` | Enable/disable features or add new ones (Level A config edit vs Level B extension file) |
81
+ | `labels` | `.claude/skills/configure/operations/labels.md` | Edit inline display labels on enum entries (statuses, stages, categories) |
82
+ | `codify-level-a` | `.claude/skills/configure/operations/codify-level-a.md` | Codify pipeline for config-only edits (Level A): propose, confirm, write, validate, rollback |
83
+ | `codify-level-b` | `.claude/skills/configure/operations/codify-level-b.md` | Codify pipeline for new extension TS files (Level B): scaffold file, propose, confirm, write, validate, rollback |
84
+
85
+ ---
86
+
87
+ ## Validation Gate (MANDATORY)
88
+
89
+ Every codify operation (Level A or B) must end with this validation sequence before reporting success:
90
+
91
+ 1. **TypeScript type-check:** `pnpm -C operations check-types` (catches static errors in the generated extension files)
92
+ 2. **Runtime schema parse:** confirm that the adapter calls `resolveOrganizationModel()` and `OrganizationModelSchema.parse()` is satisfied (Zod cross-refs, enum values, required fields)
93
+
94
+ If either fails: roll back the file to its pre-edit state and report the error to the user. See `codify-level-a.md` and `codify-level-b.md` for the full rollback procedure.
95
+
96
+ ---
97
+
98
+ **Last Updated:** 2026-04-20
@@ -0,0 +1,100 @@
1
+ # Codify Pipeline: Level A (Config-Only Edits)
2
+
3
+ Level A is the codify pipeline for changes that land exclusively in
4
+ `foundations/config/organization-model.ts`. No new TypeScript files are created. The entire
5
+ ceremony is: snapshot current file, propose the edit, write the edit, validate, and roll back on
6
+ failure.
7
+
8
+ This pipeline is called by domain operations (identity, customers, offerings, roles, goals,
9
+ techStack, features, labels) after the user has confirmed the proposed change. The caller provides
10
+ the specific field/block being changed and the proposed new value.
11
+
12
+ ---
13
+
14
+ ## Pipeline
15
+
16
+ ### Step 1: Snapshot
17
+
18
+ Before any write, read `foundations/config/organization-model.ts` and keep the full file content
19
+ in memory as the rollback snapshot. Do not write any file during this step.
20
+
21
+ ```
22
+ Read("foundations/config/organization-model.ts")
23
+ -- store as ROLLBACK_SNAPSHOT
24
+ ```
25
+
26
+ ### Step 2: Apply the edit
27
+
28
+ Use the Edit tool to apply the caller's proposed change to
29
+ `foundations/config/organization-model.ts`.
30
+
31
+ Rules for the edit:
32
+
33
+ - Edit only the specific field or block the caller specified. Do not reformat or restructure
34
+ unrelated sections.
35
+ - Preserve all other keys in `defineOrganizationModel({...})` exactly as they are.
36
+ - Maintain the existing code style (trailing commas, quote style, indentation) of the file.
37
+ - If the target field does not yet exist in the adapter call, add it as a new property in the
38
+ appropriate position (following the declared domain order in the schema).
39
+
40
+ ### Step 3: TypeScript type-check
41
+
42
+ Run the type-check for the operations package:
43
+
44
+ ```bash
45
+ pnpm -C operations check-types
46
+ ```
47
+
48
+ Capture stdout and stderr. If the command exits non-zero, proceed to Step 5 (rollback).
49
+
50
+ ### Step 4: Runtime schema validation
51
+
52
+ Confirm that the adapter's output passes `OrganizationModelSchema.parse()`. The adapter calls
53
+ `resolveOrganizationModel()` internally, which merges defaults with overrides and then parses the
54
+ result. A successful `check-types` pass is strong evidence that the schema is valid, but
55
+ cross-reference checks (segment ID refs in offerings, role reporting refs, period ordering in
56
+ goals) are runtime-only.
57
+
58
+ If the project exposes a validation script (e.g. `pnpm -C operations check`), run that too:
59
+
60
+ ```bash
61
+ pnpm -C operations check
62
+ ```
63
+
64
+ If either validation step fails, proceed to Step 5 (rollback).
65
+
66
+ ### Step 5: Rollback (on failure only)
67
+
68
+ If Step 3 or Step 4 failed:
69
+
70
+ 1. Write the ROLLBACK_SNAPSHOT content back to `foundations/config/organization-model.ts`
71
+ verbatim (use the Write tool with the exact snapshot content).
72
+ 2. Confirm the file has been restored by checking that the content matches the snapshot.
73
+ 3. Return the error message to the caller.
74
+
75
+ The caller is responsible for reporting the rollback to the user.
76
+
77
+ ### Step 6: Success signal
78
+
79
+ If Steps 3 and 4 both passed, return a success signal to the caller with:
80
+
81
+ - The fields changed
82
+ - `Type-check: PASS`
83
+ - `Schema validation: PASS`
84
+
85
+ The caller formats and presents the final report.
86
+
87
+ ---
88
+
89
+ ## Caller Contract
90
+
91
+ Callers must provide before invoking this pipeline:
92
+
93
+ - **Target file:** always `foundations/config/organization-model.ts`
94
+ - **Target block:** the specific domain key or sub-key being changed (e.g. `identity`,
95
+ `customers.segments`, `roles.roles`, `resourceMappings[id="rm-hubspot"].techStack`)
96
+ - **Proposed value:** the new TypeScript literal to write for that block
97
+ - **Confirmed:** the user has already said yes to the proposed change
98
+
99
+ This pipeline does not ask the user any questions. All confirmation happens in the domain
100
+ operation before this pipeline is invoked.