@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
@@ -1,133 +0,0 @@
1
- # Configure: identity
2
-
3
- Guides the user through reviewing and updating the `identity` domain of the organization model.
4
-
5
- The `identity` domain captures legal identity, purpose, and operational anchors — distinct from
6
- `branding` (display identity: logos, product names). Editing identity fields here does not touch
7
- any visual or branding configuration.
8
-
9
- ## Schema reference
10
-
11
- Source: `packages/core/src/organization-model/domains/identity.ts`
12
-
13
- ```typescript
14
- IdentityDomainSchema = z.object({
15
- mission: z.string().trim().max(1000).default(''),
16
- vision: z.string().trim().max(1000).default(''),
17
- legalName: z.string().trim().max(200).default(''),
18
- entityType: z.string().trim().max(100).default(''), // e.g. "LLC", "Corporation"
19
- jurisdiction: z.string().trim().max(200).default(''), // e.g. "United States – Delaware"
20
- industryCategory: z.string().trim().max(200).default(''), // e.g. "Marketing Agency"
21
- geographicFocus: z.string().trim().max(200).default(''), // e.g. "North America"
22
- timeZone: z.string().trim().max(100).default('UTC'), // IANA identifier
23
- businessHours: BusinessHoursSchema // per-day { open, close } in HH:MM
24
- })
25
- ```
26
-
27
- `BusinessHoursSchema` is an object with optional keys `monday` through `sunday`, each holding
28
- `{ open: "HH:MM", close: "HH:MM" }`. An empty object `{}` means not configured.
29
-
30
- Where this lands in the adapter: `foundations/config/organization-model.ts` under the `identity`
31
- key of `defineOrganizationModel({...})`.
32
-
33
- ---
34
-
35
- ## Process
36
-
37
- ### Step 1: Read current state
38
-
39
- Read `foundations/config/organization-model.ts` and extract the current `identity` block. Present
40
- it to the user as a plain-language summary, not a raw code dump:
41
-
42
- ```
43
- Current identity:
44
- Mission: {value or "(not set)"}
45
- Vision: {value or "(not set)"}
46
- Legal name: {value or "(not set)"}
47
- Entity type: {value or "(not set)"}
48
- Jurisdiction: {value or "(not set)"}
49
- Industry: {value or "(not set)"}
50
- Geographic focus: {value or "(not set)"}
51
- Time zone: {value}
52
- Business hours: {configured days or "not configured"}
53
- ```
54
-
55
- ### Step 2: Ask conversationally
56
-
57
- Work through the fields in natural conversation. You do not need to ask every field in a single
58
- message — group related ones together and react to what the user shares.
59
-
60
- **Group A — Purpose:**
61
-
62
- - "What's the organization's mission? (Why does it exist — one or two sentences.)"
63
- - "What's the vision? (Where is the organization headed long-term?)"
64
-
65
- **Group B — Legal identity:**
66
-
67
- - "What's the legal registered name of the organization?"
68
- - "What type of legal entity is it? (e.g. LLC, Corporation, Sole Proprietor, Non-profit)"
69
- - "What jurisdiction is it registered in? (e.g. United States – Delaware, Canada – Ontario)"
70
-
71
- **Group C — Industry and geography:**
72
-
73
- - "What industry or category best describes the organization? (e.g. Marketing Agency, SaaS, Professional Services)"
74
- - "Where does it primarily operate or serve? (e.g. North America, Global, Southeast Asia)"
75
-
76
- **Group D — Temporal anchors:**
77
-
78
- - "What time zone does the team primarily operate in? I'll use an IANA identifier like
79
- America/Los_Angeles or Europe/London."
80
- - "Do you want to capture standard business hours? (e.g. Mon–Fri 09:00–17:00)"
81
-
82
- If a field already has a non-empty value, show the current value and ask whether to keep or change it.
83
- Never silently overwrite existing values without confirmation.
84
-
85
- ### Step 3: Confirm before writing
86
-
87
- Present a diff-style summary of all proposed changes:
88
-
89
- ```
90
- Proposed identity changes:
91
- mission: "" → "We help SMBs automate complex operations using AI."
92
- vision: (unchanged) "(not set)"
93
- legalName: "" → "Acme Operations LLC"
94
- entityType: "" → "LLC"
95
- jurisdiction: "" → "United States – Delaware"
96
- industryCategory: "" → "AI Automation / Professional Services"
97
- geographicFocus: "" → "North America"
98
- timeZone: "UTC" → "America/Chicago"
99
- businessHours: {} → { monday–friday: 09:00–17:00 }
100
-
101
- Apply these changes? (yes/no)
102
- ```
103
-
104
- If the user says no, abort without writing anything.
105
-
106
- ### Step 4: Codify
107
-
108
- Execute `.claude/skills/configure/operations/codify-level-a.md` with these changes targeting the
109
- `identity` key inside the `defineOrganizationModel({...})` call in
110
- `foundations/config/organization-model.ts`.
111
-
112
- Only write the fields the user confirmed. Do not add or remove other top-level keys in the adapter.
113
-
114
- ### Step 5: Report
115
-
116
- After successful validation:
117
-
118
- ```
119
- Identity updated.
120
- Fields changed: {list}
121
- foundations/config/organization-model.ts — identity block updated
122
- Type-check: PASS
123
- Schema validation: PASS
124
- ```
125
-
126
- If validation failed and rollback occurred, report:
127
-
128
- ```
129
- Identity update rolled back.
130
- Reason: {error message}
131
- foundations/config/organization-model.ts — restored to previous state
132
- No changes persisted.
133
- ```
@@ -1,128 +0,0 @@
1
- # Configure: labels
2
-
3
- Guides the user through editing inline display labels on enum entries in the organization model.
4
-
5
- Labels are the `label` field carried by status entries, stage entries, and other enum-like
6
- elements in the model. They control what users see in the UI and what agents say when narrating
7
- state. Editing a label does not change the entry's `id` or `semanticClass` -- only the
8
- human-readable display string.
9
-
10
- This operation is Level A only (config-only edits to `foundations/config/organization-model.ts`).
11
- No new TypeScript files are created.
12
-
13
- ## What has labels
14
-
15
- The following model elements carry inline `label` fields that are editable here:
16
-
17
- **Statuses (sales domain -- deal pipeline stages):**
18
- Located in `foundations/config/organization-model.ts` under `sales.statuses` or in the platform
19
- defaults at `packages/core/src/organization-model/domains/sales.ts`.
20
-
21
- Each status entry shape (example):
22
-
23
- ```typescript
24
- { id: 'new', label: 'New Lead', semanticClass: 'active', color: 'blue' }
25
- ```
26
-
27
- **Statuses (prospecting domain -- lead lifecycle stages):**
28
- Located under `prospecting.statuses` or in `packages/core/src/organization-model/domains/prospecting.ts`.
29
-
30
- **Statuses (projects domain -- project and task stages):**
31
- Located under `projects.statuses` or in `packages/core/src/organization-model/domains/projects.ts`.
32
-
33
- **Features (`label` field):**
34
- The display label on a feature entry (e.g. changing "CRM" to "Sales Pipeline"). Editing this
35
- changes sidebar nav text and any agent narration that references the feature by label.
36
-
37
- **Navigation surfaces (`label` field):**
38
- Surface entries in the `navigation.surfaces` array each carry a `label`. Editing changes
39
- breadcrumb text and nav item display.
40
-
41
- The `id` and `semanticClass` of any entry must never be changed here -- those are structural
42
- anchors. Only `label` (and optionally `color` or `icon`) are in scope for this operation.
43
-
44
- ---
45
-
46
- ## Process
47
-
48
- ### Step 1: Read current state
49
-
50
- Ask the user which domain's labels they want to edit:
51
-
52
- - Deal pipeline stages (sales)
53
- - Lead lifecycle stages (prospecting)
54
- - Project/task stages (projects)
55
- - Feature names
56
- - Navigation surface names
57
-
58
- Read `foundations/config/organization-model.ts` and the relevant platform defaults file for the
59
- selected domain. Present all current label values for that domain:
60
-
61
- ```
62
- Current labels -- sales (deal pipeline stages):
63
- new "New Lead"
64
- contacted "Contacted"
65
- qualified "Qualified"
66
- proposal "Proposal Sent"
67
- negotiation "In Negotiation"
68
- closed_won "Closed Won"
69
- closed_lost "Closed Lost"
70
- ```
71
-
72
- ### Step 2: Gather changes
73
-
74
- Ask which labels the user wants to change. Work one at a time or accept a list:
75
-
76
- - "Which label do you want to rename? (by current label or ID)"
77
- - "What should it say instead?"
78
-
79
- Validate:
80
-
81
- - Max 120 characters
82
- - Non-empty
83
- - No change to the `id` or `semanticClass`
84
-
85
- If the user wants to change a `color` or `icon` alongside the label, accept that too.
86
-
87
- ### Step 3: Confirm before writing
88
-
89
- Present a diff:
90
-
91
- ```
92
- Proposed label changes -- sales:
93
- new: "New Lead" -> "Inbound Lead"
94
- proposal: "Proposal Sent" -> "Proposal Out"
95
- negotiation: (unchanged)
96
-
97
- Apply? (yes/no)
98
- ```
99
-
100
- ### Step 4: Codify
101
-
102
- Execute `.claude/skills/configure/operations/codify-level-a.md`.
103
-
104
- The write targets only the affected entries in the selected domain array. Entries not being
105
- changed are left exactly as they are. The `id` and `semanticClass` of every entry must remain
106
- unchanged in the output.
107
-
108
- ### Step 5: Report
109
-
110
- After successful validation:
111
-
112
- ```
113
- Labels updated.
114
- Domain: {domain name}
115
- Changed: {list of id: "old" -> "new"}
116
- foundations/config/organization-model.ts -- {domain}.statuses updated
117
- Type-check: PASS
118
- Schema validation: PASS
119
- ```
120
-
121
- If validation failed and rollback occurred:
122
-
123
- ```
124
- Labels update rolled back.
125
- Reason: {error message}
126
- foundations/config/organization-model.ts -- restored to previous state
127
- No changes persisted.
128
- ```
@@ -1,159 +0,0 @@
1
- # Configure: offerings
2
-
3
- Guides the user through reviewing and updating the `offerings` domain of the organization model.
4
-
5
- The `offerings` domain describes what the organization sells or delivers — a catalog of products
6
- and services modeled after Business Model Canvas "Value Propositions". Agents use offerings for
7
- quoting, proposal generation, and scope-of-work reasoning.
8
-
9
- ## Schema reference
10
-
11
- Source: `packages/core/src/organization-model/domains/offerings.ts`
12
-
13
- ```typescript
14
- OfferingsDomainSchema = z.object({
15
- products: z.array(ProductSchema).default([])
16
- })
17
-
18
- ProductSchema = z.object({
19
- id: z.string().trim().min(1).max(100), // stable ID, e.g. "product-starter-plan"
20
- name: z.string().trim().max(200).default(''), // display name
21
- description: z.string().trim().max(2000).default(''), // what it delivers
22
- pricingModel: PricingModelSchema.default('custom'), // 'one-time' | 'subscription' | 'usage-based' | 'custom'
23
- price: z.number().min(0).default(0), // base price amount (≥ 0)
24
- currency: z.string().trim().max(10).default('USD'),// ISO 4217, e.g. "USD", "EUR"
25
- targetSegmentIds: z.array(z.string()).default([]), // must ref customers.segments[].id
26
- deliveryFeatureId: z.string().optional() // optional ref to features[].id
27
- })
28
- ```
29
-
30
- `pricingModel` values:
31
-
32
- - `one-time` — single purchase (setup fee, project fee)
33
- - `subscription` — recurring (monthly/annual SaaS, retainer)
34
- - `usage-based` — metered by consumption (API calls, seats)
35
- - `custom` — negotiated or bespoke pricing
36
-
37
- Cross-reference constraints enforced at parse time:
38
-
39
- - `targetSegmentIds` entries must exist in `customers.segments[].id`
40
- - `deliveryFeatureId` (when present) must exist in `features[].id`
41
-
42
- Where this lands in the adapter: `foundations/config/organization-model.ts` under the `offerings`
43
- key of `defineOrganizationModel({...})`.
44
-
45
- ---
46
-
47
- ## Process
48
-
49
- ### Step 1: Read current state
50
-
51
- Read `foundations/config/organization-model.ts` and extract the current `offerings.products` array.
52
- Also extract `customers.segments` (for cross-reference display) and `features` (for
53
- `deliveryFeatureId` reference).
54
-
55
- Present a summary:
56
-
57
- ```
58
- Current offerings (N):
59
- 1. {name} ({id}) — {pricingModel} — {price} {currency}
60
- Targets: {segment names or "(none)"}
61
- (none defined yet)
62
- ```
63
-
64
- ### Step 2: Establish intent
65
-
66
- Ask whether the user wants to:
67
-
68
- - **Add** a new product/service
69
- - **Edit** an existing product (by name or number)
70
- - **Remove** a product
71
- - **Review all** in detail
72
-
73
- ### Step 3: Gather product details
74
-
75
- For each product being added or edited:
76
-
77
- **Core identity:**
78
-
79
- - "What's the name of this offering? (e.g. 'Starter Plan', 'Full-Service Retainer', 'One-Time Audit')"
80
- - "Give it a stable ID — lowercase with hyphens, like `product-starter-plan`."
81
- - "Describe what this product/service delivers in one or two sentences."
82
-
83
- **Pricing:**
84
-
85
- - "How is this priced? Options: one-time payment, subscription (recurring), usage-based (metered),
86
- or custom/negotiated."
87
- - "What's the base price? (Enter 0 if pricing is fully custom or not yet set.)"
88
- - "What currency? (Default: USD)"
89
-
90
- **Targeting:**
91
-
92
- - "Which customer segments does this offering target?"
93
- Show the available segments by name. The user can select by name; translate to IDs.
94
- If no segments are defined yet, note this and suggest configuring customers first.
95
-
96
- **Platform delivery (optional):**
97
-
98
- - "Is there a platform feature responsible for delivering this offering? (e.g. the CRM feature,
99
- the Projects feature)" Show available feature IDs. This field is optional.
100
-
101
- If a field already has a value, show it and ask "Keep this or update it?"
102
-
103
- ### Step 4: Confirm before writing
104
-
105
- Present a diff for the affected product(s):
106
-
107
- ```
108
- Proposed offerings change:
109
-
110
- ADD product "Full-Service Retainer" (product-full-service-retainer):
111
- name: "Full-Service Retainer"
112
- description: "End-to-end campaign delivery, reporting, and optimization for SMB clients."
113
- pricingModel: "subscription"
114
- price: 2500
115
- currency: "USD"
116
- targetSegmentIds: ["segment-smb-agencies"]
117
- deliveryFeatureId: (not set)
118
-
119
- Apply? (yes/no)
120
- ```
121
-
122
- ### Step 5: Cross-reference validation
123
-
124
- Before writing, verify:
125
-
126
- 1. Every `targetSegmentIds` entry exists in the current `customers.segments[].id` array in the
127
- adapter. If any are missing, surface the discrepancy and ask whether to add the missing segment
128
- first or proceed without the reference.
129
- 2. If `deliveryFeatureId` is provided, verify it exists in `features[].id`. If not found, surface
130
- a warning and offer to omit the field.
131
-
132
- ### Step 6: Codify
133
-
134
- Execute `.claude/skills/configure/operations/codify-level-a.md` with the proposed `offerings`
135
- block. Only the `products` array is written — no other keys in the adapter are touched.
136
-
137
- When adding a product, append to the array. When editing, replace by `id`. When removing, filter
138
- out and also surface any `targetSegmentIds` in other products referencing the removed ID.
139
-
140
- ### Step 7: Report
141
-
142
- After successful validation:
143
-
144
- ```
145
- Offerings updated.
146
- Products: {total count} ({N added / N edited / N removed})
147
- foundations/config/organization-model.ts — offerings.products updated
148
- Type-check: PASS
149
- Schema validation: PASS
150
- ```
151
-
152
- If validation failed and rollback occurred:
153
-
154
- ```
155
- Offerings update rolled back.
156
- Reason: {error message}
157
- foundations/config/organization-model.ts — restored to previous state
158
- No changes persisted.
159
- ```
@@ -1,153 +0,0 @@
1
- # Configure: roles
2
-
3
- Guides the user through reviewing and updating the `roles` domain of the organization model.
4
-
5
- The `roles` domain describes who does what inside the organization — a role chart inspired by the
6
- EOS Accountability Chart but using plain-language field names throughout. Agents use this domain
7
- for HITL routing, escalation logic, and approval-rights reasoning.
8
-
9
- Field names are developer-facing; user-facing prompts should say "role", "responsibilities",
10
- "reports to", and "held by". Do not say "seat", "accountability", or "EOS".
11
-
12
- ## Schema reference
13
-
14
- Source: `packages/core/src/organization-model/domains/roles.ts`
15
-
16
- ```typescript
17
- RolesDomainSchema = z.object({
18
- roles: z.array(RoleSchema).default([])
19
- })
20
-
21
- RoleSchema = z.object({
22
- id: z.string().trim().min(1).max(100), // stable ID, e.g. "role-ceo"
23
- title: z.string().trim().min(1).max(200), // display title, e.g. "CEO"
24
- responsibilities: z.array(z.string().trim().max(500)).default([]),// what this role owns
25
- reportsToId: z.string().trim().min(1).max(100).optional(), // must ref another roles[].id
26
- heldBy: z.string().trim().max(200).optional() // name or email, free-form
27
- })
28
- ```
29
-
30
- Cross-reference constraint: `reportsToId` (when present) must resolve to another `roles[].id` in
31
- the same collection. Enforced at parse time by `OrganizationModelSchema.superRefine()`. Cycle
32
- detection is not enforced (known limitation).
33
-
34
- Absence of `reportsToId` indicates a top-level role (no reporting line).
35
-
36
- Where this lands in the adapter: `foundations/config/organization-model.ts` under the `roles`
37
- key of `defineOrganizationModel({...})`.
38
-
39
- ---
40
-
41
- ## Process
42
-
43
- ### Step 1: Read current state
44
-
45
- Read `foundations/config/organization-model.ts` and extract the current `roles.roles` array.
46
- Present it as a role chart summary:
47
-
48
- ```
49
- Current roles (N):
50
- {title} ({id})
51
- Held by: {heldBy or "(unassigned)"}
52
- Reports to: {reportsToId resolved to title, or "(top-level)"}
53
- Responsibilities: {count or "(none listed)"}
54
- (none defined yet)
55
- ```
56
-
57
- If the array is empty, note that an empty roles chart means no HITL routing or escalation rules
58
- are available yet.
59
-
60
- ### Step 2: Establish intent
61
-
62
- Ask whether the user wants to:
63
-
64
- - **Add** a new role
65
- - **Edit** an existing role (by title or number)
66
- - **Remove** a role
67
- - **Review all** in detail (show full responsibilities lists)
68
-
69
- ### Step 3: Gather role details
70
-
71
- For each role being added or edited:
72
-
73
- **Core identity:**
74
-
75
- - "What's the title of this role? (e.g. 'CEO', 'Head of Client Success', 'Operations Lead')"
76
- - "Give it a stable ID — lowercase with hyphens, like `role-ceo` or `role-head-of-client-success`."
77
-
78
- **Reporting line:**
79
-
80
- - "Does this role report to another role? If so, which one?"
81
- Show the existing roles by title. Translate selection to ID. If none, it becomes a top-level role.
82
-
83
- **Responsibilities:**
84
-
85
- - "What are the main things this role is accountable for? List them one at a time — I'll capture
86
- each as a separate responsibility."
87
-
88
- **Who holds it (optional):**
89
-
90
- - "Who currently holds this role? A name or email address works — or leave it blank if it's
91
- unassigned."
92
-
93
- If a field already has a value, show it and ask "Keep this or update it?"
94
-
95
- ### Step 4: Confirm before writing
96
-
97
- Present a diff for the affected role(s):
98
-
99
- ```
100
- Proposed roles change:
101
-
102
- ADD role "CEO" (role-ceo):
103
- title: "CEO"
104
- responsibilities: ["Set company direction", "Final approval on deals >$10K", "Manage investor relations"]
105
- reportsToId: (none — top-level)
106
- heldBy: "Alice Johnson"
107
-
108
- ADD role "Head of Client Success" (role-head-of-client-success):
109
- title: "Head of Client Success"
110
- responsibilities: ["Own client health scores", "Lead QBRs", "Handle escalations"]
111
- reportsToId: "role-ceo"
112
- heldBy: (unassigned)
113
-
114
- Apply? (yes/no)
115
- ```
116
-
117
- ### Step 5: Cross-reference validation
118
-
119
- Before writing, verify:
120
-
121
- 1. Every `reportsToId` in the proposed changes resolves to an ID that will exist after the write
122
- (either already present in the array or being added in this batch).
123
- 2. If a role being removed has other roles that `reportsToId` to it, surface those orphaned
124
- references and ask whether to clear the reporting lines before proceeding.
125
-
126
- ### Step 6: Codify
127
-
128
- Execute `.claude/skills/configure/operations/codify-level-a.md` with the proposed `roles` block.
129
- Only the `roles` array is written — no other keys in the adapter are touched.
130
-
131
- When adding, append in declaration order (top-level roles first, then reporting roles). When
132
- editing, replace by `id`. When removing, filter out.
133
-
134
- ### Step 7: Report
135
-
136
- After successful validation:
137
-
138
- ```
139
- Roles updated.
140
- Roles: {total count} ({N added / N edited / N removed})
141
- foundations/config/organization-model.ts — roles.roles updated
142
- Type-check: PASS
143
- Schema validation: PASS
144
- ```
145
-
146
- If validation failed and rollback occurred:
147
-
148
- ```
149
- Roles update rolled back.
150
- Reason: {error message}
151
- foundations/config/organization-model.ts — restored to previous state
152
- No changes persisted.
153
- ```