@elevasis/sdk 1.15.1 → 1.17.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 (60) hide show
  1. package/dist/cli.cjs +2325 -124
  2. package/dist/index.d.ts +410 -473
  3. package/dist/index.js +96 -44
  4. package/dist/node/index.d.ts +69 -0
  5. package/dist/node/index.js +273 -0
  6. package/dist/test-utils/index.d.ts +473 -466
  7. package/dist/types/worker/platform.d.ts +2 -9
  8. package/package.json +12 -3
  9. package/reference/_navigation.md +23 -1
  10. package/reference/_reference-manifest.json +98 -0
  11. package/reference/claude-config/rules/agent-start-here.md +13 -0
  12. package/reference/claude-config/rules/organization-model.md +40 -40
  13. package/reference/claude-config/rules/organization-os.md +16 -16
  14. package/reference/claude-config/rules/vibe.md +13 -13
  15. package/reference/claude-config/skills/knowledge/SKILL.md +253 -0
  16. package/reference/claude-config/skills/{configure → knowledge}/operations/codify-level-a.md +100 -100
  17. package/reference/claude-config/skills/{configure → knowledge}/operations/codify-level-b.md +158 -158
  18. package/reference/claude-config/skills/knowledge/operations/customers.md +109 -0
  19. package/reference/claude-config/skills/knowledge/operations/features.md +113 -0
  20. package/reference/claude-config/skills/knowledge/operations/goals.md +118 -0
  21. package/reference/claude-config/skills/knowledge/operations/identity.md +93 -0
  22. package/reference/claude-config/skills/knowledge/operations/labels.md +89 -0
  23. package/reference/claude-config/skills/knowledge/operations/offerings.md +109 -0
  24. package/reference/claude-config/skills/knowledge/operations/roles.md +99 -0
  25. package/reference/claude-config/skills/knowledge/operations/techStack.md +102 -0
  26. package/reference/claude-config/skills/run-ui/SKILL.md +73 -0
  27. package/reference/claude-config/skills/setup/SKILL.md +270 -270
  28. package/reference/claude-config/skills/tutorial/SKILL.md +249 -0
  29. package/reference/claude-config/skills/tutorial/progress-template.md +74 -0
  30. package/reference/claude-config/skills/tutorial/technical.md +1309 -0
  31. package/reference/claude-config/skills/tutorial/vibe-coder.md +890 -0
  32. package/reference/claude-config/sync-notes/2026-05-04-elevasis-workspace.md +71 -0
  33. package/reference/claude-config/sync-notes/2026-05-04-knowledge-bundle.md +83 -0
  34. package/reference/claude-config/sync-notes/2026-05-04-template-skills-run-ui-and-tutorial.md +59 -0
  35. package/reference/deployment/index.mdx +5 -5
  36. package/reference/examples/organization-model.ts +40 -0
  37. package/reference/framework/index.mdx +1 -1
  38. package/reference/framework/tutorial-system.mdx +86 -173
  39. package/reference/packages/core/src/knowledge/README.md +32 -0
  40. package/reference/packages/ui/src/knowledge/README.md +31 -0
  41. package/reference/packages/ui/src/theme/presets/README.md +19 -0
  42. package/reference/scaffold/core/organization-model.mdx +1 -1
  43. package/reference/scaffold/recipes/add-a-feature.md +1 -1
  44. package/reference/scaffold/recipes/customize-crm-actions.md +433 -433
  45. package/reference/scaffold/recipes/customize-organization-model.md +3 -3
  46. package/reference/scaffold/recipes/extend-lead-gen.md +90 -55
  47. package/reference/scaffold/recipes/gate-by-feature-or-admin.md +1 -1
  48. package/reference/scaffold/recipes/index.md +6 -0
  49. package/reference/scaffold/reference/contracts.md +1265 -1154
  50. package/reference/scaffold/reference/feature-registry.md +2 -1
  51. package/reference/scaffold/ui/composition-extensibility.mdx +17 -0
  52. package/reference/claude-config/skills/configure/SKILL.md +0 -98
  53. package/reference/claude-config/skills/configure/operations/customers.md +0 -150
  54. package/reference/claude-config/skills/configure/operations/features.md +0 -162
  55. package/reference/claude-config/skills/configure/operations/goals.md +0 -147
  56. package/reference/claude-config/skills/configure/operations/identity.md +0 -133
  57. package/reference/claude-config/skills/configure/operations/labels.md +0 -128
  58. package/reference/claude-config/skills/configure/operations/offerings.md +0 -159
  59. package/reference/claude-config/skills/configure/operations/roles.md +0 -153
  60. package/reference/claude-config/skills/configure/operations/techStack.md +0 -139
@@ -16,6 +16,7 @@ description: Auto-generated catalog of registered feature manifests. Do not edit
16
16
  | --- | --- | --- | --- | --- |
17
17
  | `crm` | `sales.crm` | — | — | — |
18
18
  | `delivery` | `projects` | — | — | — |
19
+ | `knowledge` | `knowledge` | — | — | — |
19
20
  | `lead-gen` | `sales.lead-gen` | — | — | — |
20
21
  | `monitoring` | `monitoring` | — | — | — |
21
22
  | `operations` | `operations` | — | — | — |
@@ -30,7 +31,7 @@ Feature IDs defined in `DEFAULT_ORGANIZATION_MODEL.features` (`packages/core/src
30
31
 
31
32
  ```typescript
32
33
  // FeatureSchema: { id, label, enabled, color?, icon?, entityIds, surfaceIds, resourceIds, capabilityIds }
33
- type DefaultFeatureId = 'dashboard' | 'sales' | 'sales.crm' | 'sales.lead-gen' | 'projects' | 'operations' | 'operations.command-view' | 'operations.overview' | 'operations.resources' | 'operations.command-queue' | 'operations.sessions' | 'operations.task-scheduler' | 'monitoring' | 'monitoring.activity-log' | 'monitoring.execution-logs' | 'monitoring.execution-health' | 'monitoring.cost-analytics' | 'monitoring.notifications' | 'monitoring.submitted-requests' | 'settings' | 'settings.account' | 'settings.appearance' | 'settings.roles' | 'settings.organization' | 'settings.credentials' | 'settings.api-keys' | 'settings.webhooks' | 'settings.deployments' | 'admin' | 'admin.system-health' | 'admin.organizations' | 'admin.users' | 'admin.design-showcase' | 'admin.debug' | 'archive' | 'archive.agent-chat' | 'archive.execution-runner' | 'seo'
34
+ type DefaultFeatureId = 'dashboard' | 'identity' | 'platform' | 'finance' | 'sales' | 'sales.crm' | 'sales.lead-gen' | 'projects' | 'operations' | 'knowledge.command-view' | 'operations.overview' | 'operations.resources' | 'operations.command-queue' | 'operations.sessions' | 'operations.task-scheduler' | 'monitoring' | 'monitoring.activity-log' | 'monitoring.execution-logs' | 'monitoring.execution-health' | 'monitoring.cost-analytics' | 'monitoring.notifications' | 'monitoring.submitted-requests' | 'settings' | 'settings.account' | 'settings.appearance' | 'settings.roles' | 'settings.organization' | 'settings.credentials' | 'settings.api-keys' | 'settings.webhooks' | 'settings.deployments' | 'admin' | 'admin.system-health' | 'admin.organizations' | 'admin.users' | 'admin.design-showcase' | 'admin.debug' | 'archive' | 'archive.agent-chat' | 'archive.execution-runner' | 'seo' | 'knowledge' | 'knowledge.base'
34
35
  ```
35
36
 
36
37
  These are the built-in feature IDs. The `featureId` field on a `FeatureModule` manifest must match the `id` of a feature in the organization model to enable access-flag gating.
@@ -211,6 +211,23 @@ All primitives above flow through published subpaths (`@elevasis/ui/features/<fe
211
211
 
212
212
  The published barrel (`packages/ui/src/provider/published.ts`) remains headless -- no Mantine-dependent visual pieces leak into the external contract.
213
213
 
214
+ ## Knowledge Browser Customization
215
+
216
+ The Knowledge Browser follows the same pattern described in this document. The three tiers map directly:
217
+
218
+ - **Tier 1** -- import `knowledgeManifest` from `@elevasis/ui/features/knowledge` and pass it to `ElevasisFeaturesProvider`. No further code required.
219
+ - **Tier 2** -- spread the manifest, override `sidebar` to a component that composes `KnowledgeSidebar` + `KnowledgeSidebarMiddle items={customItems}`. Same shape as the CRM example above.
220
+ - **Tier 3** -- skip the manifest, own the route, call `byFeature` / `byKind` / `byOwner` from `@elevasis/core/knowledge` directly.
221
+
222
+ One additional wiring step is required for Knowledge Browser that does not apply to CRM or Lead Gen: add `knowledgePlugin()` from `@elevasis/ui/vite-plugin-knowledge` to `vite.config.ts`. The plugin runs build-time MDX codegen so rendered body components are available at runtime.
223
+
224
+ See [recipes/customize-knowledge-browser.md](../recipes/customize-knowledge-browser.md) for the full walkthrough including code examples, the CSS import requirement, and the full exports reference.
225
+
226
+ Phase 1.5 adds two further extension surfaces documented in the same recipe file under the "Phase 1.5" section:
227
+
228
+ - **Extending the SegmentedControl** -- supply a `segments` prop to `KnowledgeSidebarMiddle` to add custom mount-axis tabs beyond the default five (By Feature, By Kind, By Owner, Governs, Governed By).
229
+ - **Replacing `DescribeNodeView`** -- override the `/knowledge/:nodeId` route component to swap the entire main-pane dispatcher, or use `createDescribeNodeDispatcher` from `@elevasis/ui/knowledge` to override only specific node-kind views while keeping the platform defaults for the rest.
230
+
214
231
  ## What Not to Do
215
232
 
216
233
  - **Don't fork sidebar files into your app tree.** You own upstream drift forever.
@@ -1,98 +0,0 @@
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 core/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 `core/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("core/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
@@ -1,150 +0,0 @@
1
- # Configure: customers
2
-
3
- Guides the user through reviewing and updating the `customers` domain of the organization model.
4
-
5
- The `customers` domain describes who the organization serves — distinct buyer archetypes modeled
6
- after the Value Proposition Canvas (BMC / VPC). Each segment captures jobs-to-be-done, pains,
7
- gains, firmographics, and a value proposition. Agents use these segments for targeting, outreach
8
- context, and personalization.
9
-
10
- ## Schema reference
11
-
12
- Source: `packages/core/src/organization-model/domains/customers.ts`
13
-
14
- ```typescript
15
- CustomersDomainSchema = z.object({
16
- segments: z.array(CustomerSegmentSchema).default([])
17
- })
18
-
19
- CustomerSegmentSchema = z.object({
20
- id: z.string().trim().min(1).max(100), // stable ID, e.g. "segment-smb-agencies"
21
- name: z.string().trim().max(200).default(''), // display name
22
- description: z.string().trim().max(2000).default(''), // who this segment is
23
- jobsToBeDone: z.string().trim().max(2000).default(''), // the goal they hire you to accomplish
24
- pains: z.array(z.string().trim().max(500)).default([]),
25
- gains: z.array(z.string().trim().max(500)).default([]),
26
- firmographics: FirmographicsSchema.default({}), // industry, companySize, region
27
- valueProp: z.string().trim().max(2000).default('') // why your offering fits this segment
28
- })
29
-
30
- FirmographicsSchema = z.object({
31
- industry: z.string().trim().max(200).optional(), // e.g. "Marketing Agency"
32
- companySize: z.string().trim().max(100).optional(), // e.g. "11–50"
33
- region: z.string().trim().max(200).optional() // e.g. "North America"
34
- })
35
- ```
36
-
37
- Where this lands in the adapter: `foundations/config/organization-model.ts` under the `customers`
38
- key of `defineOrganizationModel({...})`.
39
-
40
- ---
41
-
42
- ## Process
43
-
44
- ### Step 1: Read current state
45
-
46
- Read `foundations/config/organization-model.ts` and extract the current `customers.segments` array.
47
- Present it as a summary table:
48
-
49
- ```
50
- Current customer segments (N):
51
- 1. {name} ({id}) — {description truncated to 80 chars}
52
- 2. ...
53
- (none defined yet)
54
- ```
55
-
56
- ### Step 2: Establish intent
57
-
58
- Ask whether the user wants to:
59
-
60
- - **Add** a new segment
61
- - **Edit** an existing segment (by name or number)
62
- - **Remove** a segment
63
- - **Review all** segments in detail
64
-
65
- Handle one segment at a time unless the user explicitly asks to work on multiple at once.
66
-
67
- ### Step 3: Gather segment details
68
-
69
- For each segment being added or edited, work through the fields conversationally:
70
-
71
- **Core identity:**
72
-
73
- - "What's a good name for this segment? (e.g. 'SMB Marketing Agencies', 'Enterprise SaaS Companies')"
74
- - "Give it a stable ID I'll use as a key — lowercase with hyphens, like `segment-smb-agencies`."
75
- - "How would you describe who this segment is in one or two sentences?"
76
-
77
- **Jobs-to-be-done:**
78
-
79
- - "What is the main job this segment is trying to get done? The goal they hire you to accomplish —
80
- describe it in their terms, not yours."
81
-
82
- **Pains and gains:**
83
-
84
- - "What are two or three frustrations or obstacles this segment runs into when trying to get that
85
- job done?"
86
- - "What outcomes or benefits are they hoping for — beyond just fixing the pain?"
87
-
88
- **Firmographics (optional):**
89
-
90
- - "Do you want to capture firmographic filters for targeting? Things like industry vertical,
91
- typical company size, and geographic region."
92
-
93
- **Value proposition:**
94
-
95
- - "How does your organization's offering uniquely address this segment's needs? One or two sentences."
96
-
97
- If a field already has a value, show it and ask "Keep this or update it?"
98
-
99
- ### Step 4: Confirm before writing
100
-
101
- Present a diff for the affected segment(s):
102
-
103
- ```
104
- Proposed customers change:
105
-
106
- ADD segment "SMB Marketing Agencies" (segment-smb-agencies):
107
- name: "SMB Marketing Agencies"
108
- description: "Owner-operated agencies with 1–15 employees running campaign delivery for SMB clients."
109
- jobsToBeDone: "Deliver consistent client results without adding headcount."
110
- pains: ["Manual campaign QA", "Client reporting takes hours", "Hard to scale without hiring"]
111
- gains: ["More client capacity without more staff", "Predictable delivery timelines"]
112
- firmographics: { industry: "Marketing Agency", companySize: "1–15", region: "North America" }
113
- valueProp: "Automates the repetitive delivery and reporting work so agencies can take on more clients."
114
-
115
- Apply? (yes/no)
116
- ```
117
-
118
- For edits to existing segments, show only the fields that changed.
119
-
120
- ### Step 5: Codify
121
-
122
- Execute `.claude/skills/configure/operations/codify-level-a.md` with the proposed `customers`
123
- block. Only the `segments` array is written — no other keys in the adapter are touched.
124
-
125
- When adding a segment, append to the array. When editing, replace the matching entry by `id`.
126
- When removing, filter it out.
127
-
128
- Cross-reference note: if `offerings.products[].targetSegmentIds` references a segment being
129
- removed, surface a warning and ask the user whether to clean up those references before writing.
130
-
131
- ### Step 6: Report
132
-
133
- After successful validation:
134
-
135
- ```
136
- Customers updated.
137
- Segments: {total count} ({N added / N edited / N removed})
138
- foundations/config/organization-model.ts — customers.segments updated
139
- Type-check: PASS
140
- Schema validation: PASS
141
- ```
142
-
143
- If validation failed and rollback occurred:
144
-
145
- ```
146
- Customers update rolled back.
147
- Reason: {error message}
148
- foundations/config/organization-model.ts — restored to previous state
149
- No changes persisted.
150
- ```
@@ -1,162 +0,0 @@
1
- # Configure: features
2
-
3
- Guides the user through enabling, disabling, or adding features in the organization model.
4
-
5
- Features are the top-level capability switches in the platform. Enabling a feature makes its nav
6
- items and routes visible; disabling hides them without removing the feature from the model. Adding
7
- a new feature may require only a config edit (Level A) or a new extension TypeScript file
8
- (Level B), depending on whether the feature already exists in the platform defaults.
9
-
10
- This operation handles both toggling existing features and introducing custom features.
11
-
12
- ## Background: Level A vs Level B
13
-
14
- - **Level A (config-only edit):** The feature exists in the platform defaults (see
15
- `node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md` for the default feature
16
- set). The adapter in `foundations/config/organization-model.ts` overrides its `enabled` flag or
17
- adjusts metadata. No new TypeScript files needed.
18
-
19
- - **Level B (new extension file):** The feature does not exist in platform defaults. A new
20
- feature ID and manifest need to be declared. This requires a new TypeScript file under
21
- `foundations/config/extensions/` plus wiring it into the adapter. Level B is only offered when
22
- the user explicitly asks to create a custom feature.
23
-
24
- ## Schema reference
25
-
26
- Source: `node_modules/@elevasis/core/organization-model` (published types) or
27
- `node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md` (auto-generated shapes)
28
-
29
- ```typescript
30
- FeatureSchema = z.object({
31
- id: ModelIdSchema, // lowercase, e.g. "crm", "lead-gen", "seo"
32
- label: LabelSchema, // display label
33
- description: DescriptionSchema.optional(),
34
- enabled: z.boolean().default(true),
35
- color: ColorTokenSchema.optional(),
36
- icon: IconNameSchema.optional(),
37
- entityIds: ReferenceIdsSchema,
38
- surfaceIds: ReferenceIdsSchema,
39
- resourceIds: ReferenceIdsSchema,
40
- capabilityIds: ReferenceIdsSchema
41
- })
42
- ```
43
-
44
- Platform default feature IDs (from `node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md`):
45
- `crm`, `lead-gen`, `projects`, `operations`, `monitoring`, `settings`, `seo`
46
-
47
- Where this lands in the adapter: `foundations/config/organization-model.ts` under the `features`
48
- array of `defineOrganizationModel({...})`. The `features` array replaces entirely (no element
49
- merge), so the adapter must redeclare all features it wants to override.
50
-
51
- ---
52
-
53
- ## Process
54
-
55
- ### Step 1: Read current state
56
-
57
- Read `foundations/config/organization-model.ts` and extract the current `features` array from the
58
- adapter. Also read `node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md` to see
59
- what the platform defaults look like.
60
-
61
- Present a combined view:
62
-
63
- ```
64
- Platform features (current state):
65
- crm [enabled] -- CRM (adapter override or platform default)
66
- lead-gen [enabled] -- Lead Generation
67
- projects [enabled] -- Projects
68
- operations [enabled] -- Operations
69
- monitoring [enabled] -- Monitoring
70
- settings [enabled] -- Settings
71
- seo [disabled] -- SEO (disabled in platform default)
72
-
73
- Custom features (adapter-only):
74
- (none)
75
- ```
76
-
77
- ### Step 2: Establish intent
78
-
79
- Ask what the user wants to do:
80
-
81
- - **Enable** a disabled feature
82
- - **Disable** an enabled feature
83
- - **Add a custom feature** (Level B -- will ask for explicit confirmation)
84
- - **Edit metadata** on an existing feature (label, color, icon)
85
-
86
- For enable/disable: this is Level A. For custom add: escalate to Level B branch.
87
-
88
- ### Step 3a: Level A -- Enable or disable
89
-
90
- For an enable or disable request:
91
-
92
- - Identify the target feature by name or ID.
93
- - Read the current `enabled` value.
94
- - Confirm the proposed change:
95
-
96
- ```
97
- Proposed feature change:
98
-
99
- DISABLE feature "SEO" (seo):
100
- enabled: true -> false
101
-
102
- This will hide the SEO nav item and gate its routes.
103
- Apply? (yes/no)
104
- ```
105
-
106
- After confirmation, execute `.claude/skills/configure/operations/codify-level-a.md`.
107
-
108
- The write either adds or updates the matching entry in the `features` array of the adapter.
109
- Because the array replaces entirely, verify that the adapter redeclares all features that should
110
- remain in their current state.
111
-
112
- ### Step 3b: Level B -- Add a custom feature
113
-
114
- Only proceed here when the user explicitly asks to add a new custom feature that does not exist in
115
- the platform defaults.
116
-
117
- State clearly: "Adding a custom feature creates a new TypeScript extension file in
118
- `foundations/config/extensions/`. This is a bigger change than a config toggle. Want to proceed?"
119
-
120
- If yes, gather:
121
-
122
- - "What should the feature ID be? Lowercase, hyphens only (e.g. `client-portal`)."
123
- - "What's the display label? (e.g. 'Client Portal')"
124
- - "Optional: a short description of what this feature represents."
125
- - "Which surfaces, entities, or resources does this feature relate to? (IDs -- leave blank to add
126
- later)"
127
-
128
- Then execute `.claude/skills/configure/operations/codify-level-b.md` to scaffold the extension
129
- file and wire it into the adapter.
130
-
131
- ### Step 4: Validation
132
-
133
- All changes -- Level A and Level B -- must pass:
134
-
135
- 1. `pnpm -C operations check-types`
136
- 2. `resolveOrganizationModel()` and `OrganizationModelSchema.parse()` succeed on the merged result
137
-
138
- On failure, roll back and report. See `codify-level-a.md` and `codify-level-b.md` for the
139
- rollback procedure.
140
-
141
- ### Step 5: Report
142
-
143
- After successful validation:
144
-
145
- ```
146
- Features updated.
147
- {feature label} ({id}): {old enabled} -> {new enabled} (Level A)
148
- Custom feature "{label}" ({id}): added (Level B, if applicable)
149
- foundations/config/organization-model.ts -- features array updated
150
- foundations/config/extensions/{id}.ts -- created (Level B only)
151
- Type-check: PASS
152
- Schema validation: PASS
153
- ```
154
-
155
- If validation failed and rollback occurred:
156
-
157
- ```
158
- Features update rolled back.
159
- Reason: {error message}
160
- All files restored to previous state.
161
- No changes persisted.
162
- ```
@@ -1,147 +0,0 @@
1
- # Configure: goals
2
-
3
- Guides the user through reviewing and updating the `goals` domain of the organization model.
4
-
5
- The `goals` domain captures what the organization is working toward — time-bounded goals with
6
- measurable outcomes. The schema shape is OKR-inspired (objectives + key results) but all
7
- user-facing language must say "goals" and "measurable outcomes". Never say "OKR", "objective",
8
- or "key result" to the user.
9
-
10
- Agents use this domain for quarterly planning, priority routing, and understanding which outcomes
11
- matter most right now.
12
-
13
- ## Schema reference
14
-
15
- Source: `packages/core/src/organization-model/domains/goals.ts`
16
-
17
- ```typescript
18
- GoalsDomainSchema = z.object({
19
- objectives: z.array(ObjectiveSchema).default([])
20
- })
21
-
22
- ObjectiveSchema = z.object({
23
- id: z.string().trim().min(1).max(100), // stable ID, e.g. "goal-grow-arr-q1-2026"
24
- description: z.string().trim().min(1).max(1000), // plain-language goal statement
25
- periodStart: z.string().regex(ISO_DATE), // YYYY-MM-DD — must be before periodEnd
26
- periodEnd: z.string().regex(ISO_DATE), // YYYY-MM-DD — enforced in superRefine
27
- keyResults: z.array(KeyResultSchema).default([]) // measurable outcomes under this goal
28
- })
29
-
30
- KeyResultSchema = z.object({
31
- id: z.string().trim().min(1).max(100), // e.g. "kr-revenue-q1"
32
- description: z.string().trim().min(1).max(500), // e.g. "Increase trial-to-paid conversion"
33
- targetMetric: z.string().trim().min(1).max(200), // what is being measured, e.g. "monthly revenue"
34
- currentValue: z.number().default(0), // current tracked value
35
- targetValue: z.number().optional() // target to hit (omit if directional)
36
- })
37
- ```
38
-
39
- Cross-reference constraint: `periodEnd` must be strictly after `periodStart`. Enforced at parse
40
- time by `OrganizationModelSchema.superRefine()`.
41
-
42
- The field name in the schema is `objectives` (not `goals`) and the measurable-outcome array is
43
- `keyResults` (not `outcomes`) — these are internal field names, not user-facing vocabulary.
44
-
45
- Where this lands in the adapter: `foundations/config/organization-model.ts` under the `goals`
46
- key of `defineOrganizationModel({...})`.
47
-
48
- ---
49
-
50
- ## Process
51
-
52
- ### Step 1: Read current state
53
-
54
- Read `foundations/config/organization-model.ts` and extract the current `goals.objectives` array.
55
- Present as a plain-language summary:
56
-
57
- ```
58
- Current goals (N):
59
- 1. "{description truncated to 80 chars}" ({id})
60
- Period: {periodStart} → {periodEnd}
61
- Measurable outcomes: {count}
62
- (no goals defined yet)
63
- ```
64
-
65
- ### Step 2: Establish intent
66
-
67
- Ask whether the user wants to:
68
-
69
- - **Add** a new goal
70
- - **Edit** an existing goal (by description or number)
71
- - **Remove** a goal
72
- - **Update progress** on a measurable outcome (update `currentValue`)
73
-
74
- ### Step 3: Gather goal details
75
-
76
- For each goal being added or edited:
77
-
78
- **Core goal:**
79
-
80
- - "What is the organization working toward? Describe the goal in plain language — one or two sentences."
81
- - "Give it a stable ID — lowercase with hyphens, e.g. `goal-grow-arr-q1-2026`."
82
- - "What period does this goal cover? (Start date and end date — e.g. 2026-01-01 to 2026-03-31)"
83
-
84
- Validate that the end date is strictly after the start date before proceeding.
85
-
86
- **Measurable outcomes (optional but recommended):**
87
-
88
- - "Do you want to add any measurable outcomes under this goal? These help track whether you're
89
- on track."
90
- - For each outcome: "What are you measuring? (e.g. monthly revenue, NPS score, trial-to-paid
91
- conversion rate)"
92
- - "What's the target value? (Optional — leave blank if the outcome is directional.)"
93
- - "What's the current value?"
94
- - "Give this outcome an ID — e.g. `kr-revenue-q1`."
95
-
96
- Capture as many outcomes as the user wants. One at a time is fine.
97
-
98
- ### Step 4: Confirm before writing
99
-
100
- Present a diff:
101
-
102
- ```
103
- Proposed goals change:
104
-
105
- ADD goal "Reach $50K MRR by end of Q1 2026" (goal-arr-q1-2026):
106
- period: 2026-01-01 → 2026-03-31
107
- outcomes:
108
- kr-mrr-q1: "Grow monthly recurring revenue"
109
- metric: "monthly recurring revenue (MRR)"
110
- current: 32000
111
- target: 50000
112
- kr-churn-q1: "Reduce churn rate"
113
- metric: "monthly churn rate (%)"
114
- current: 4.2
115
- target: 2.5
116
-
117
- Apply? (yes/no)
118
- ```
119
-
120
- ### Step 5: Codify
121
-
122
- Execute `.claude/skills/configure/operations/codify-level-a.md` with the proposed `goals` block.
123
- Only the `objectives` array is written — no other keys in the adapter are touched.
124
-
125
- When updating progress only (updating `currentValue` on an existing outcome), make a targeted
126
- edit rather than rewriting the entire goals block.
127
-
128
- ### Step 6: Report
129
-
130
- After successful validation:
131
-
132
- ```
133
- Goals updated.
134
- Goals: {total count} ({N added / N edited / N removed})
135
- foundations/config/organization-model.ts — goals.objectives updated
136
- Type-check: PASS
137
- Schema validation: PASS
138
- ```
139
-
140
- If validation failed and rollback occurred:
141
-
142
- ```
143
- Goals update rolled back.
144
- Reason: {error message}
145
- foundations/config/organization-model.ts — restored to previous state
146
- No changes persisted.
147
- ```