@elevasis/sdk 1.8.2 → 1.9.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 (62) hide show
  1. package/dist/cli.cjs +289 -105
  2. package/dist/index.d.ts +90 -39
  3. package/dist/types/worker/adapters/lead.d.ts +1 -1
  4. package/dist/worker/index.js +2 -0
  5. package/package.json +2 -2
  6. package/reference/_navigation.md +7 -1
  7. package/reference/_reference-manifest.json +14 -0
  8. package/reference/claude-config/logs/scaffold-registry-reminder.log +3 -0
  9. package/reference/claude-config/rules/agent-start-here.md +254 -254
  10. package/reference/claude-config/rules/frontend.md +43 -43
  11. package/reference/claude-config/rules/operations.md +64 -64
  12. package/reference/claude-config/rules/organization-model.md +42 -43
  13. package/reference/claude-config/rules/organization-os.md +107 -107
  14. package/reference/claude-config/rules/shared-types.md +2 -2
  15. package/reference/claude-config/rules/task-tracking.md +1 -1
  16. package/reference/claude-config/rules/ui.md +202 -202
  17. package/reference/claude-config/rules/vibe.md +202 -202
  18. package/reference/claude-config/skills/configure/SKILL.md +98 -98
  19. package/reference/claude-config/skills/configure/operations/codify-level-a.md +100 -100
  20. package/reference/claude-config/skills/configure/operations/codify-level-b.md +158 -158
  21. package/reference/claude-config/skills/configure/operations/customers.md +150 -150
  22. package/reference/claude-config/skills/configure/operations/features.md +162 -162
  23. package/reference/claude-config/skills/configure/operations/goals.md +147 -147
  24. package/reference/claude-config/skills/configure/operations/identity.md +133 -133
  25. package/reference/claude-config/skills/configure/operations/labels.md +128 -128
  26. package/reference/claude-config/skills/configure/operations/offerings.md +159 -159
  27. package/reference/claude-config/skills/configure/operations/roles.md +153 -153
  28. package/reference/claude-config/skills/configure/operations/techStack.md +139 -139
  29. package/reference/claude-config/skills/explore/SKILL.md +78 -78
  30. package/reference/claude-config/skills/git-sync/SKILL.md +126 -0
  31. package/reference/claude-config/skills/save/SKILL.md +183 -183
  32. package/reference/claude-config/skills/setup/SKILL.md +275 -275
  33. package/reference/claude-config/skills/sync/SKILL.md +10 -44
  34. package/reference/claude-config/sync-notes/2026-04-22-git-sync-and-sync-notes.md +27 -0
  35. package/reference/claude-config/sync-notes/2026-04-22-lead-gen-deliverability-removal.md +30 -0
  36. package/reference/claude-config/sync-notes/2026-04-24-ui-consolidation-and-sdk-cli-train.md +86 -0
  37. package/reference/claude-config/sync-notes/README.md +43 -0
  38. package/reference/deployment/index.mdx +42 -7
  39. package/reference/examples/organization-model.ts +689 -0
  40. package/reference/index.mdx +6 -5
  41. package/reference/packages/core/src/README.md +39 -36
  42. package/reference/packages/core/src/business/README.md +52 -52
  43. package/reference/packages/core/src/organization-model/README.md +97 -97
  44. package/reference/packages/core/src/test-utils/README.md +42 -0
  45. package/reference/scaffold/core/organization-graph.mdx +272 -272
  46. package/reference/scaffold/core/organization-model.mdx +320 -320
  47. package/reference/scaffold/index.mdx +64 -64
  48. package/reference/scaffold/operations/propagation-pipeline.md +125 -104
  49. package/reference/scaffold/operations/scaffold-maintenance.md +122 -122
  50. package/reference/scaffold/operations/workflow-recipes.md +436 -436
  51. package/reference/scaffold/recipes/add-a-feature.md +158 -158
  52. package/reference/scaffold/recipes/add-a-resource.md +158 -158
  53. package/reference/scaffold/recipes/customize-organization-model.md +400 -400
  54. package/reference/scaffold/recipes/extend-a-base-entity.md +140 -140
  55. package/reference/scaffold/recipes/gate-by-feature-or-admin.md +158 -158
  56. package/reference/scaffold/recipes/index.md +32 -32
  57. package/reference/scaffold/reference/contracts.md +608 -607
  58. package/reference/scaffold/reference/feature-registry.md +2 -0
  59. package/reference/scaffold/reference/glossary.md +105 -105
  60. package/reference/scaffold/ui/composition-extensibility.mdx +1 -1
  61. package/reference/scaffold/ui/feature-flags-and-gating.md +1 -1
  62. package/reference/claude-config/commands/submit-request.md +0 -11
@@ -1,150 +1,150 @@
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
+ # 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 +1,162 @@
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
+ # 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
+ ```