@elevasis/sdk 1.8.2 → 1.8.3
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.
- package/dist/cli.cjs +1 -1
- package/dist/index.d.ts +88 -39
- package/dist/types/worker/adapters/lead.d.ts +1 -1
- package/dist/worker/index.js +2 -0
- package/package.json +2 -2
- package/reference/_navigation.md +7 -1
- package/reference/_reference-manifest.json +14 -0
- package/reference/claude-config/logs/scaffold-registry-reminder.log +3 -0
- package/reference/claude-config/rules/agent-start-here.md +254 -254
- package/reference/claude-config/rules/frontend.md +43 -43
- package/reference/claude-config/rules/operations.md +64 -64
- package/reference/claude-config/rules/organization-model.md +42 -43
- package/reference/claude-config/rules/organization-os.md +107 -107
- package/reference/claude-config/rules/shared-types.md +2 -2
- package/reference/claude-config/rules/task-tracking.md +1 -1
- package/reference/claude-config/rules/ui.md +202 -202
- package/reference/claude-config/rules/vibe.md +202 -202
- package/reference/claude-config/skills/configure/SKILL.md +98 -98
- package/reference/claude-config/skills/configure/operations/codify-level-a.md +100 -100
- package/reference/claude-config/skills/configure/operations/codify-level-b.md +158 -158
- package/reference/claude-config/skills/configure/operations/customers.md +150 -150
- package/reference/claude-config/skills/configure/operations/features.md +162 -162
- package/reference/claude-config/skills/configure/operations/goals.md +147 -147
- package/reference/claude-config/skills/configure/operations/identity.md +133 -133
- package/reference/claude-config/skills/configure/operations/labels.md +128 -128
- package/reference/claude-config/skills/configure/operations/offerings.md +159 -159
- package/reference/claude-config/skills/configure/operations/roles.md +153 -153
- package/reference/claude-config/skills/configure/operations/techStack.md +139 -139
- package/reference/claude-config/skills/explore/SKILL.md +78 -78
- package/reference/claude-config/skills/git-sync/SKILL.md +126 -0
- package/reference/claude-config/skills/save/SKILL.md +183 -183
- package/reference/claude-config/skills/setup/SKILL.md +275 -275
- package/reference/claude-config/skills/sync/SKILL.md +10 -44
- package/reference/claude-config/sync-notes/2026-04-22-git-sync-and-sync-notes.md +27 -0
- package/reference/claude-config/sync-notes/2026-04-22-lead-gen-deliverability-removal.md +30 -0
- package/reference/claude-config/sync-notes/README.md +43 -0
- package/reference/packages/core/src/README.md +39 -36
- package/reference/packages/core/src/business/README.md +52 -52
- package/reference/packages/core/src/organization-model/README.md +97 -97
- package/reference/packages/core/src/test-utils/README.md +42 -0
- package/reference/scaffold/core/organization-graph.mdx +272 -272
- package/reference/scaffold/core/organization-model.mdx +320 -320
- package/reference/scaffold/index.mdx +64 -64
- package/reference/scaffold/operations/propagation-pipeline.md +125 -104
- package/reference/scaffold/operations/scaffold-maintenance.md +122 -122
- package/reference/scaffold/operations/workflow-recipes.md +436 -436
- package/reference/scaffold/recipes/add-a-feature.md +158 -158
- package/reference/scaffold/recipes/add-a-resource.md +158 -158
- package/reference/scaffold/recipes/customize-organization-model.md +400 -400
- package/reference/scaffold/recipes/extend-a-base-entity.md +140 -140
- package/reference/scaffold/recipes/gate-by-feature-or-admin.md +158 -158
- package/reference/scaffold/recipes/index.md +32 -32
- package/reference/scaffold/reference/contracts.md +608 -607
- package/reference/scaffold/reference/feature-registry.md +2 -0
- package/reference/scaffold/reference/glossary.md +105 -105
- package/reference/scaffold/ui/composition-extensibility.mdx +1 -1
- package/reference/scaffold/ui/feature-flags-and-gating.md +1 -1
|
@@ -1,254 +1,254 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Canonical first-read for agents entering the template scaffold -- project continuity, task-class routing, and boundary resolution
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Agent Start Here
|
|
6
|
-
|
|
7
|
-
Read this file first when entering a freshly scaffolded project.
|
|
8
|
-
|
|
9
|
-
## First Action: Check Active Projects
|
|
10
|
-
|
|
11
|
-
Before loading any docs for a new session, check whether the user's ask resumes or relates to an in-flight client project. Project context (milestones, tasks, resume notes) is DB-canonical -- agents and CLI read/write it through the `elevasis-sdk project:*` surface.
|
|
12
|
-
|
|
13
|
-
1. **Portfolio snapshot.** Run this first to see what is active or blocked:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
pnpm elevasis-sdk project:list --status active --pretty
|
|
17
|
-
pnpm elevasis-sdk project:list --status blocked --pretty
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
2. **Resume-style asks.** If the user says "continue", "pick up", references a client name, or names a task/milestone, resolve it via:
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
pnpm elevasis-sdk project:work <query>
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
`project:work` fuzzy-matches a project or task by name/ID and returns the current resume context -- the canonical continuity payload (current state, next steps, files modified, key docs).
|
|
27
|
-
|
|
28
|
-
3. **Fresh non-project asks.** Only if the portfolio snapshot and the request show no overlap with active projects, fall back to the docs-index flow below. Even then, if the work will take more than a single file edit, offer to create a project first (`/project create` or `project:create`) so continuity is captured from the start.
|
|
29
|
-
|
|
30
|
-
### Resume Context Source of Truth
|
|
31
|
-
|
|
32
|
-
`resume_context` lives in the `prj_tasks` table in the database, not in task-doc frontmatter. There is one source of truth:
|
|
33
|
-
|
|
34
|
-
- **Humans write** via the inline resume-context editor on the Project Detail page in Command Center.
|
|
35
|
-
- **Agents and the CLI write** via `pnpm elevasis-sdk project:task:save <task-id> --current-state ... --next-steps ... --files-modified ...`.
|
|
36
|
-
- **Readers** consume it via `project:work <query>` or `project:task:resume <id>`.
|
|
37
|
-
|
|
38
|
-
Do not write resume state into markdown frontmatter. Task-doc frontmatter is limited to `title`, `description`, and `status`.
|
|
39
|
-
|
|
40
|
-
### Session-Start Dashboard
|
|
41
|
-
|
|
42
|
-
The session-start dashboard directive lives in `CLAUDE.md`. If you see it there, follow it on the first response of a session. This file (`agent-start-here` rule) is the drill-down reference layer; `CLAUDE.md` owns session bootstrap.
|
|
43
|
-
|
|
44
|
-
## Template Surfaces
|
|
45
|
-
|
|
46
|
-
Once project continuity is resolved (or confirmed irrelevant), the template is not just an app starter. It is an agent operating environment with several distinct surfaces:
|
|
47
|
-
|
|
48
|
-
- `ui/` -- React frontend app and shell composition
|
|
49
|
-
- `operations/` -- Elevasis SDK resources deployed to the platform
|
|
50
|
-
- `foundations/` -- runtime-agnostic shared contracts and organization model adaptation
|
|
51
|
-
- `.claude/` -- local agent rules, skills, and hooks
|
|
52
|
-
- `client-workspace/` -- optional separate knowledge workspace for richer team knowledge management
|
|
53
|
-
- `node_modules/@elevasis/sdk/reference/scaffold/` -- SDK reference scaffold: canonical recipes, UI patterns, gating model, contracts, and glossary. Entry point: `index.mdx`.
|
|
54
|
-
|
|
55
|
-
## Discovery Order
|
|
56
|
-
|
|
57
|
-
Use this order unless a more specific doc tells you otherwise:
|
|
58
|
-
|
|
59
|
-
1. Complete the "First Action: Check Active Projects" flow above.
|
|
60
|
-
2. Read `CLAUDE.md` for project rules, command surface, and navigation pointers.
|
|
61
|
-
3. Read this rule and classify the task using the Task Classes below.
|
|
62
|
-
4. Read `identity.clientBrief` from the OrganizationModel (`operations/foundations/config/organization-model.ts`) for organization context and naming.
|
|
63
|
-
5. Read the relevant structural map:
|
|
64
|
-
- Glob `node_modules/@elevasis/sdk/reference/` for published package surfaces
|
|
65
|
-
- Glob `operations/resources/**` for source, or run `pnpm elevasis-sdk project:list --pretty` for live DB state
|
|
66
|
-
6. For feature integration, resource authoring, or UI customization tasks, read `node_modules/@elevasis/sdk/reference/scaffold/index.mdx` to find the canonical recipe or reference doc.
|
|
67
|
-
7. Drill into the co-located local explainer for the abstraction boundary you are changing.
|
|
68
|
-
8. Check the `.claude/rules/active-change-index.md` rule before trusting stable assumptions in areas that are under active architecture work.
|
|
69
|
-
|
|
70
|
-
## SDK Reference Scaffold
|
|
71
|
-
|
|
72
|
-
Universal scaffold documentation (recipes, patterns, architecture, reference) has been centralized in the SDK reference. After `pnpm install`, the entry point is:
|
|
73
|
-
|
|
74
|
-
`node_modules/@elevasis/sdk/reference/scaffold/index.mdx`
|
|
75
|
-
|
|
76
|
-
This index links to all scaffold docs including pathway recipes, UI patterns, core architecture, and auto-generated contracts/feature registry.
|
|
77
|
-
|
|
78
|
-
For task classes that involve feature integration, resource authoring, or UI customization, start with the scaffold index rather than local docs.
|
|
79
|
-
|
|
80
|
-
## Task Classes
|
|
81
|
-
|
|
82
|
-
Classify the request, then follow the load/inspect/verify sequence for that class.
|
|
83
|
-
|
|
84
|
-
### 1. UI / Shell Work
|
|
85
|
-
|
|
86
|
-
Examples: add a page, change sidebar behavior, adjust feature visibility, update dashboard labels.
|
|
87
|
-
|
|
88
|
-
Load first:
|
|
89
|
-
|
|
90
|
-
- `node_modules/@elevasis/sdk/reference/scaffold/index.mdx` (scaffold index -- UI recipes, feature flags, customization)
|
|
91
|
-
- `.claude/rules/ui.md`
|
|
92
|
-
- `ui/src/routes/README.md`
|
|
93
|
-
- `foundations/config/README.md`
|
|
94
|
-
- `node_modules/@elevasis/sdk/reference/scaffold/ui/recipes.md` -- specifically recipe 6 when building a "run this resource" surface
|
|
95
|
-
|
|
96
|
-
Then inspect:
|
|
97
|
-
|
|
98
|
-
- `ui/src/routes/__root.tsx`
|
|
99
|
-
- `ui/src/config/*`
|
|
100
|
-
- relevant `ui/src/routes/*`
|
|
101
|
-
- relevant `ui/src/features/*`
|
|
102
|
-
- `foundations/config/organization-model.ts`
|
|
103
|
-
|
|
104
|
-
Verify with:
|
|
105
|
-
|
|
106
|
-
- route and manifest source
|
|
107
|
-
- any relevant package README from `packages/ui`
|
|
108
|
-
|
|
109
|
-
### 2. Workflow / Agent / Operations Work
|
|
110
|
-
|
|
111
|
-
Examples: add a workflow, update an agent, change resource registration, understand deployable resources.
|
|
112
|
-
|
|
113
|
-
Load first:
|
|
114
|
-
|
|
115
|
-
- `node_modules/@elevasis/sdk/reference/scaffold/index.mdx` (scaffold index -- workflow recipes, resource authoring)
|
|
116
|
-
- `.claude/rules/operations.md`
|
|
117
|
-
- `operations/src/README.md`
|
|
118
|
-
|
|
119
|
-
Then inspect:
|
|
120
|
-
|
|
121
|
-
- `operations/src/index.ts`
|
|
122
|
-
- relevant `operations/src/<feature>/*`
|
|
123
|
-
- `foundations/types/index.ts` -- workflow input/output Zod schemas
|
|
124
|
-
- `foundations/types/entities.ts` -- typed entity contracts (Project, Deal, etc.) extending `@elevasis/core/entities` base types. Read this when authoring a workflow that takes or returns these entities so the input/output schemas reference the canonical entity shapes rather than redeclaring them.
|
|
125
|
-
- `operations/elevasis.config.ts`
|
|
126
|
-
|
|
127
|
-
Verify with:
|
|
128
|
-
|
|
129
|
-
- Glob `operations/resources/**` for local source files, or run `pnpm elevasis-sdk project:list --pretty` for live DB state
|
|
130
|
-
- local SDK guidance in `.claude/skills/elevasis/SKILL.md`
|
|
131
|
-
|
|
132
|
-
### 3. Organization Model / Feature Access Work
|
|
133
|
-
|
|
134
|
-
Examples: rename a feature area, change quick access surfaces, map new business terms into the shell, adjust feature gating.
|
|
135
|
-
|
|
136
|
-
Load first:
|
|
137
|
-
|
|
138
|
-
- `node_modules/@elevasis/sdk/reference/scaffold/index.mdx` (scaffold index -- contracts, gating patterns, glossary)
|
|
139
|
-
- `foundations/config/README.md`
|
|
140
|
-
- `node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md`
|
|
141
|
-
- typed feature/surface constants from `@elevasis/core/organization-model` -- `CRM_FEATURE_ID`, `LEAD_GEN_FEATURE_ID`, `PROJECTS_FEATURE_ID`, `OPERATIONS_FEATURE_ID`, `MONITORING_FEATURE_ID`, `SETTINGS_FEATURE_ID`, `SEO_FEATURE_ID`, `CRM_PIPELINE_SURFACE_ID`, `LEAD_GEN_LISTS_SURFACE_ID`, `PROJECTS_INDEX_SURFACE_ID`, `OPERATIONS_ORGANIZATION_GRAPH_SURFACE_ID`. Use these typed constants instead of magic strings when overriding feature/surface IDs.
|
|
142
|
-
- `node_modules/@elevasis/sdk/reference/scaffold/ui/feature-flags-and-gating.md`
|
|
143
|
-
|
|
144
|
-
Then inspect:
|
|
145
|
-
|
|
146
|
-
- `foundations/config/organization-model.ts`
|
|
147
|
-
- `foundations/config/organization-model.examples.ts` -- 5 reference patterns: branding override, CRM pipeline stage customization, lead-gen lifecycle customization, resource mapping registration, custom feature declaration. Not imported anywhere -- pure reference. Start here for the override pattern when extending the org model.
|
|
148
|
-
- `ui/src/routes/__root.tsx`
|
|
149
|
-
- `ui/src/lib/hooks/useFeatureAccess.ts`
|
|
150
|
-
- relevant nav config files
|
|
151
|
-
|
|
152
|
-
Verify with:
|
|
153
|
-
|
|
154
|
-
- published package docs for `@elevasis/core/organization-model`
|
|
155
|
-
- current scaffold routes and manifests
|
|
156
|
-
|
|
157
|
-
### 4. Debugging / Impact Analysis
|
|
158
|
-
|
|
159
|
-
Examples: why is this automation disconnected, what does this workflow affect, what should I inspect before changing this resource.
|
|
160
|
-
|
|
161
|
-
Load first:
|
|
162
|
-
|
|
163
|
-
- `operations/src/README.md`
|
|
164
|
-
- `.claude/rules/active-change-index.md`
|
|
165
|
-
- Glob `operations/resources/**` for source, or run `pnpm elevasis-sdk project:list --pretty` for live DB state
|
|
166
|
-
|
|
167
|
-
Then inspect:
|
|
168
|
-
|
|
169
|
-
- `operations/src/index.ts`
|
|
170
|
-
- resource definitions
|
|
171
|
-
- related UI route and feature files
|
|
172
|
-
- related foundations contracts
|
|
173
|
-
|
|
174
|
-
Verify with:
|
|
175
|
-
|
|
176
|
-
- resource registration and relationship declarations
|
|
177
|
-
- generated maps
|
|
178
|
-
- package and source ownership boundaries
|
|
179
|
-
|
|
180
|
-
### 5. Platform Extension / Package Contract Work
|
|
181
|
-
|
|
182
|
-
Examples: extend a published package contract, understand how a scaffold surface maps to `@elevasis/ui`, update a package-facing reference doc.
|
|
183
|
-
|
|
184
|
-
Load first:
|
|
185
|
-
|
|
186
|
-
- `.claude/rules/active-change-index.md`
|
|
187
|
-
- Glob `node_modules/@elevasis/sdk/reference/` for the current SDK package surface
|
|
188
|
-
- package README found via that glob
|
|
189
|
-
|
|
190
|
-
Then inspect:
|
|
191
|
-
|
|
192
|
-
- package source entrypoints
|
|
193
|
-
- package reference manifests
|
|
194
|
-
- scaffold files that consume that contract
|
|
195
|
-
|
|
196
|
-
Verify with:
|
|
197
|
-
|
|
198
|
-
- published package docs
|
|
199
|
-
- source exports
|
|
200
|
-
- scaffold consumption points
|
|
201
|
-
|
|
202
|
-
## Boundary Resolution
|
|
203
|
-
|
|
204
|
-
Once the request is classified, determine which boundary owns the change:
|
|
205
|
-
|
|
206
|
-
- **Foundations boundary** -- semantics, aliases, labels, shared schemas
|
|
207
|
-
- **UI shell boundary** -- provider composition, manifests, navigation, route ownership
|
|
208
|
-
- **Operations boundary** -- deployable resource registration, workflow/agent contracts, topology
|
|
209
|
-
- **Package boundary** -- public exports, shared platform behavior, reusable contracts
|
|
210
|
-
|
|
211
|
-
If a task spans boundaries, start at the semantic boundary, then move to runtime composition, then to registration/deployment.
|
|
212
|
-
|
|
213
|
-
## Main Boundaries
|
|
214
|
-
|
|
215
|
-
### `foundations/config/organization-model.ts`
|
|
216
|
-
|
|
217
|
-
The semantic adaptation point between platform contracts and scaffold-local terminology. Start here for feature labels, legacy aliases, quick-access surfaces, and shell-facing organization semantics.
|
|
218
|
-
|
|
219
|
-
### `ui/src/routes/__root.tsx`
|
|
220
|
-
|
|
221
|
-
The shell composition point. Start here for manifest mounting, provider wiring, app-local nav, and how the scaffold combines published feature surfaces with project-owned shell concerns.
|
|
222
|
-
|
|
223
|
-
### `operations/src/index.ts`
|
|
224
|
-
|
|
225
|
-
The deployment aggregation point. Start here for what resources are registered and deployed as part of the scaffold.
|
|
226
|
-
|
|
227
|
-
## Source of Truth
|
|
228
|
-
|
|
229
|
-
Trust these in order:
|
|
230
|
-
|
|
231
|
-
1. Source code and published package docs
|
|
232
|
-
2. Co-located boundary docs
|
|
233
|
-
3. Generated structural maps
|
|
234
|
-
4. Hand-authored template guidance
|
|
235
|
-
5. In-progress architecture docs when `.claude/rules/active-change-index.md` says the area is actively evolving
|
|
236
|
-
|
|
237
|
-
If a hand-authored doc conflicts with source or published package docs, trust source and flag the doc drift.
|
|
238
|
-
|
|
239
|
-
## Common Traps
|
|
240
|
-
|
|
241
|
-
- Do not assume `operations/resources/**` is exhaustive without also checking `operations/src/index.ts` directly.
|
|
242
|
-
- Do not assume placeholder knowledge is sufficient for real client context. Read `identity.clientBrief` from the OrganizationModel (`operations/foundations/config/organization-model.ts`).
|
|
243
|
-
- Do not trust stable docs blindly when `.claude/rules/active-change-index.md` flags related in-progress architecture work.
|
|
244
|
-
- Do not write `resume_context` into task-doc frontmatter. DB is canonical; write via `project:task:save` or the inline editor in Command Center.
|
|
245
|
-
|
|
246
|
-
## Operations-Only Projects
|
|
247
|
-
|
|
248
|
-
Some projects derived from this template are operations-only. They have `operations/` (or a top-level `src/`) but NO `ui/`, NO `foundations/config/organization-model.ts`, and NO frontend. Finding none of these is not missing scaffolding -- it is by design.
|
|
249
|
-
|
|
250
|
-
**What applies:** Only Task Classes 2 (Workflow / Agent / Operations Work) and 4 (Debugging / Impact Analysis) apply to operations-only projects. Task Classes 1 (UI / Shell Work), 3 (Organization Model / Feature Access Work), and 5 (Platform Extension / Package Contract Work) do not apply and can be skipped.
|
|
251
|
-
|
|
252
|
-
**Primary entrypoint:** For operations-only projects, the project's own `CLAUDE.md` and its Navigation table are the canonical first-read. This rule provides task-routing context but its full surface map is irrelevant for that project type.
|
|
253
|
-
|
|
254
|
-
**Signal:** The `CLAUDE.md` of an operations-only project includes `Project type: operations-only` in its `## Project` section. When you see this signal, skip all template surfaces that don't exist and go directly to the operations task class.
|
|
1
|
+
---
|
|
2
|
+
description: Canonical first-read for agents entering the template scaffold -- project continuity, task-class routing, and boundary resolution
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Agent Start Here
|
|
6
|
+
|
|
7
|
+
Read this file first when entering a freshly scaffolded project.
|
|
8
|
+
|
|
9
|
+
## First Action: Check Active Projects
|
|
10
|
+
|
|
11
|
+
Before loading any docs for a new session, check whether the user's ask resumes or relates to an in-flight client project. Project context (milestones, tasks, resume notes) is DB-canonical -- agents and CLI read/write it through the `elevasis-sdk project:*` surface.
|
|
12
|
+
|
|
13
|
+
1. **Portfolio snapshot.** Run this first to see what is active or blocked:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm elevasis-sdk project:list --status active --pretty
|
|
17
|
+
pnpm elevasis-sdk project:list --status blocked --pretty
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
2. **Resume-style asks.** If the user says "continue", "pick up", references a client name, or names a task/milestone, resolve it via:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pnpm elevasis-sdk project:work <query>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
`project:work` fuzzy-matches a project or task by name/ID and returns the current resume context -- the canonical continuity payload (current state, next steps, files modified, key docs).
|
|
27
|
+
|
|
28
|
+
3. **Fresh non-project asks.** Only if the portfolio snapshot and the request show no overlap with active projects, fall back to the docs-index flow below. Even then, if the work will take more than a single file edit, offer to create a project first (`/project create` or `project:create`) so continuity is captured from the start.
|
|
29
|
+
|
|
30
|
+
### Resume Context Source of Truth
|
|
31
|
+
|
|
32
|
+
`resume_context` lives in the `prj_tasks` table in the database, not in task-doc frontmatter. There is one source of truth:
|
|
33
|
+
|
|
34
|
+
- **Humans write** via the inline resume-context editor on the Project Detail page in Command Center.
|
|
35
|
+
- **Agents and the CLI write** via `pnpm elevasis-sdk project:task:save <task-id> --current-state ... --next-steps ... --files-modified ...`.
|
|
36
|
+
- **Readers** consume it via `project:work <query>` or `project:task:resume <id>`.
|
|
37
|
+
|
|
38
|
+
Do not write resume state into markdown frontmatter. Task-doc frontmatter is limited to `title`, `description`, and `status`.
|
|
39
|
+
|
|
40
|
+
### Session-Start Dashboard
|
|
41
|
+
|
|
42
|
+
The session-start dashboard directive lives in `CLAUDE.md`. If you see it there, follow it on the first response of a session. This file (`agent-start-here` rule) is the drill-down reference layer; `CLAUDE.md` owns session bootstrap.
|
|
43
|
+
|
|
44
|
+
## Template Surfaces
|
|
45
|
+
|
|
46
|
+
Once project continuity is resolved (or confirmed irrelevant), the template is not just an app starter. It is an agent operating environment with several distinct surfaces:
|
|
47
|
+
|
|
48
|
+
- `ui/` -- React frontend app and shell composition
|
|
49
|
+
- `operations/` -- Elevasis SDK resources deployed to the platform
|
|
50
|
+
- `foundations/` -- runtime-agnostic shared contracts and organization model adaptation
|
|
51
|
+
- `.claude/` -- local agent rules, skills, and hooks
|
|
52
|
+
- `client-workspace/` -- optional separate knowledge workspace for richer team knowledge management
|
|
53
|
+
- `node_modules/@elevasis/sdk/reference/scaffold/` -- SDK reference scaffold: canonical recipes, UI patterns, gating model, contracts, and glossary. Entry point: `index.mdx`.
|
|
54
|
+
|
|
55
|
+
## Discovery Order
|
|
56
|
+
|
|
57
|
+
Use this order unless a more specific doc tells you otherwise:
|
|
58
|
+
|
|
59
|
+
1. Complete the "First Action: Check Active Projects" flow above.
|
|
60
|
+
2. Read `CLAUDE.md` for project rules, command surface, and navigation pointers.
|
|
61
|
+
3. Read this rule and classify the task using the Task Classes below.
|
|
62
|
+
4. Read `identity.clientBrief` from the OrganizationModel (`operations/foundations/config/organization-model.ts`) for organization context and naming.
|
|
63
|
+
5. Read the relevant structural map:
|
|
64
|
+
- Glob `node_modules/@elevasis/sdk/reference/` for published package surfaces
|
|
65
|
+
- Glob `operations/resources/**` for source, or run `pnpm elevasis-sdk project:list --pretty` for live DB state
|
|
66
|
+
6. For feature integration, resource authoring, or UI customization tasks, read `node_modules/@elevasis/sdk/reference/scaffold/index.mdx` to find the canonical recipe or reference doc.
|
|
67
|
+
7. Drill into the co-located local explainer for the abstraction boundary you are changing.
|
|
68
|
+
8. Check the `.claude/rules/active-change-index.md` rule before trusting stable assumptions in areas that are under active architecture work.
|
|
69
|
+
|
|
70
|
+
## SDK Reference Scaffold
|
|
71
|
+
|
|
72
|
+
Universal scaffold documentation (recipes, patterns, architecture, reference) has been centralized in the SDK reference. After `pnpm install`, the entry point is:
|
|
73
|
+
|
|
74
|
+
`node_modules/@elevasis/sdk/reference/scaffold/index.mdx`
|
|
75
|
+
|
|
76
|
+
This index links to all scaffold docs including pathway recipes, UI patterns, core architecture, and auto-generated contracts/feature registry.
|
|
77
|
+
|
|
78
|
+
For task classes that involve feature integration, resource authoring, or UI customization, start with the scaffold index rather than local docs.
|
|
79
|
+
|
|
80
|
+
## Task Classes
|
|
81
|
+
|
|
82
|
+
Classify the request, then follow the load/inspect/verify sequence for that class.
|
|
83
|
+
|
|
84
|
+
### 1. UI / Shell Work
|
|
85
|
+
|
|
86
|
+
Examples: add a page, change sidebar behavior, adjust feature visibility, update dashboard labels.
|
|
87
|
+
|
|
88
|
+
Load first:
|
|
89
|
+
|
|
90
|
+
- `node_modules/@elevasis/sdk/reference/scaffold/index.mdx` (scaffold index -- UI recipes, feature flags, customization)
|
|
91
|
+
- `.claude/rules/ui.md`
|
|
92
|
+
- `ui/src/routes/README.md`
|
|
93
|
+
- `foundations/config/README.md`
|
|
94
|
+
- `node_modules/@elevasis/sdk/reference/scaffold/ui/recipes.md` -- specifically recipe 6 when building a "run this resource" surface
|
|
95
|
+
|
|
96
|
+
Then inspect:
|
|
97
|
+
|
|
98
|
+
- `ui/src/routes/__root.tsx`
|
|
99
|
+
- `ui/src/config/*`
|
|
100
|
+
- relevant `ui/src/routes/*`
|
|
101
|
+
- relevant `ui/src/features/*`
|
|
102
|
+
- `foundations/config/organization-model.ts`
|
|
103
|
+
|
|
104
|
+
Verify with:
|
|
105
|
+
|
|
106
|
+
- route and manifest source
|
|
107
|
+
- any relevant package README from `packages/ui`
|
|
108
|
+
|
|
109
|
+
### 2. Workflow / Agent / Operations Work
|
|
110
|
+
|
|
111
|
+
Examples: add a workflow, update an agent, change resource registration, understand deployable resources.
|
|
112
|
+
|
|
113
|
+
Load first:
|
|
114
|
+
|
|
115
|
+
- `node_modules/@elevasis/sdk/reference/scaffold/index.mdx` (scaffold index -- workflow recipes, resource authoring)
|
|
116
|
+
- `.claude/rules/operations.md`
|
|
117
|
+
- `operations/src/README.md`
|
|
118
|
+
|
|
119
|
+
Then inspect:
|
|
120
|
+
|
|
121
|
+
- `operations/src/index.ts`
|
|
122
|
+
- relevant `operations/src/<feature>/*`
|
|
123
|
+
- `foundations/types/index.ts` -- workflow input/output Zod schemas
|
|
124
|
+
- `foundations/types/entities.ts` -- typed entity contracts (Project, Deal, etc.) extending `@elevasis/core/entities` base types. Read this when authoring a workflow that takes or returns these entities so the input/output schemas reference the canonical entity shapes rather than redeclaring them.
|
|
125
|
+
- `operations/elevasis.config.ts`
|
|
126
|
+
|
|
127
|
+
Verify with:
|
|
128
|
+
|
|
129
|
+
- Glob `operations/resources/**` for local source files, or run `pnpm elevasis-sdk project:list --pretty` for live DB state
|
|
130
|
+
- local SDK guidance in `.claude/skills/elevasis/SKILL.md`
|
|
131
|
+
|
|
132
|
+
### 3. Organization Model / Feature Access Work
|
|
133
|
+
|
|
134
|
+
Examples: rename a feature area, change quick access surfaces, map new business terms into the shell, adjust feature gating.
|
|
135
|
+
|
|
136
|
+
Load first:
|
|
137
|
+
|
|
138
|
+
- `node_modules/@elevasis/sdk/reference/scaffold/index.mdx` (scaffold index -- contracts, gating patterns, glossary)
|
|
139
|
+
- `foundations/config/README.md`
|
|
140
|
+
- `node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md`
|
|
141
|
+
- typed feature/surface constants from `@elevasis/core/organization-model` -- `CRM_FEATURE_ID`, `LEAD_GEN_FEATURE_ID`, `PROJECTS_FEATURE_ID`, `OPERATIONS_FEATURE_ID`, `MONITORING_FEATURE_ID`, `SETTINGS_FEATURE_ID`, `SEO_FEATURE_ID`, `CRM_PIPELINE_SURFACE_ID`, `LEAD_GEN_LISTS_SURFACE_ID`, `PROJECTS_INDEX_SURFACE_ID`, `OPERATIONS_ORGANIZATION_GRAPH_SURFACE_ID`. Use these typed constants instead of magic strings when overriding feature/surface IDs.
|
|
142
|
+
- `node_modules/@elevasis/sdk/reference/scaffold/ui/feature-flags-and-gating.md`
|
|
143
|
+
|
|
144
|
+
Then inspect:
|
|
145
|
+
|
|
146
|
+
- `foundations/config/organization-model.ts`
|
|
147
|
+
- `foundations/config/organization-model.examples.ts` -- 5 reference patterns: branding override, CRM pipeline stage customization, lead-gen lifecycle customization, resource mapping registration, custom feature declaration. Not imported anywhere -- pure reference. Start here for the override pattern when extending the org model.
|
|
148
|
+
- `ui/src/routes/__root.tsx`
|
|
149
|
+
- `ui/src/lib/hooks/useFeatureAccess.ts`
|
|
150
|
+
- relevant nav config files
|
|
151
|
+
|
|
152
|
+
Verify with:
|
|
153
|
+
|
|
154
|
+
- published package docs for `@elevasis/core/organization-model`
|
|
155
|
+
- current scaffold routes and manifests
|
|
156
|
+
|
|
157
|
+
### 4. Debugging / Impact Analysis
|
|
158
|
+
|
|
159
|
+
Examples: why is this automation disconnected, what does this workflow affect, what should I inspect before changing this resource.
|
|
160
|
+
|
|
161
|
+
Load first:
|
|
162
|
+
|
|
163
|
+
- `operations/src/README.md`
|
|
164
|
+
- `.claude/rules/active-change-index.md`
|
|
165
|
+
- Glob `operations/resources/**` for source, or run `pnpm elevasis-sdk project:list --pretty` for live DB state
|
|
166
|
+
|
|
167
|
+
Then inspect:
|
|
168
|
+
|
|
169
|
+
- `operations/src/index.ts`
|
|
170
|
+
- resource definitions
|
|
171
|
+
- related UI route and feature files
|
|
172
|
+
- related foundations contracts
|
|
173
|
+
|
|
174
|
+
Verify with:
|
|
175
|
+
|
|
176
|
+
- resource registration and relationship declarations
|
|
177
|
+
- generated maps
|
|
178
|
+
- package and source ownership boundaries
|
|
179
|
+
|
|
180
|
+
### 5. Platform Extension / Package Contract Work
|
|
181
|
+
|
|
182
|
+
Examples: extend a published package contract, understand how a scaffold surface maps to `@elevasis/ui`, update a package-facing reference doc.
|
|
183
|
+
|
|
184
|
+
Load first:
|
|
185
|
+
|
|
186
|
+
- `.claude/rules/active-change-index.md`
|
|
187
|
+
- Glob `node_modules/@elevasis/sdk/reference/` for the current SDK package surface
|
|
188
|
+
- package README found via that glob
|
|
189
|
+
|
|
190
|
+
Then inspect:
|
|
191
|
+
|
|
192
|
+
- package source entrypoints
|
|
193
|
+
- package reference manifests
|
|
194
|
+
- scaffold files that consume that contract
|
|
195
|
+
|
|
196
|
+
Verify with:
|
|
197
|
+
|
|
198
|
+
- published package docs
|
|
199
|
+
- source exports
|
|
200
|
+
- scaffold consumption points
|
|
201
|
+
|
|
202
|
+
## Boundary Resolution
|
|
203
|
+
|
|
204
|
+
Once the request is classified, determine which boundary owns the change:
|
|
205
|
+
|
|
206
|
+
- **Foundations boundary** -- semantics, aliases, labels, shared schemas
|
|
207
|
+
- **UI shell boundary** -- provider composition, manifests, navigation, route ownership
|
|
208
|
+
- **Operations boundary** -- deployable resource registration, workflow/agent contracts, topology
|
|
209
|
+
- **Package boundary** -- public exports, shared platform behavior, reusable contracts
|
|
210
|
+
|
|
211
|
+
If a task spans boundaries, start at the semantic boundary, then move to runtime composition, then to registration/deployment.
|
|
212
|
+
|
|
213
|
+
## Main Boundaries
|
|
214
|
+
|
|
215
|
+
### `foundations/config/organization-model.ts`
|
|
216
|
+
|
|
217
|
+
The semantic adaptation point between platform contracts and scaffold-local terminology. Start here for feature labels, legacy aliases, quick-access surfaces, and shell-facing organization semantics.
|
|
218
|
+
|
|
219
|
+
### `ui/src/routes/__root.tsx`
|
|
220
|
+
|
|
221
|
+
The shell composition point. Start here for manifest mounting, provider wiring, app-local nav, and how the scaffold combines published feature surfaces with project-owned shell concerns.
|
|
222
|
+
|
|
223
|
+
### `operations/src/index.ts`
|
|
224
|
+
|
|
225
|
+
The deployment aggregation point. Start here for what resources are registered and deployed as part of the scaffold.
|
|
226
|
+
|
|
227
|
+
## Source of Truth
|
|
228
|
+
|
|
229
|
+
Trust these in order:
|
|
230
|
+
|
|
231
|
+
1. Source code and published package docs
|
|
232
|
+
2. Co-located boundary docs
|
|
233
|
+
3. Generated structural maps
|
|
234
|
+
4. Hand-authored template guidance
|
|
235
|
+
5. In-progress architecture docs when `.claude/rules/active-change-index.md` says the area is actively evolving
|
|
236
|
+
|
|
237
|
+
If a hand-authored doc conflicts with source or published package docs, trust source and flag the doc drift.
|
|
238
|
+
|
|
239
|
+
## Common Traps
|
|
240
|
+
|
|
241
|
+
- Do not assume `operations/resources/**` is exhaustive without also checking `operations/src/index.ts` directly.
|
|
242
|
+
- Do not assume placeholder knowledge is sufficient for real client context. Read `identity.clientBrief` from the OrganizationModel (`operations/foundations/config/organization-model.ts`).
|
|
243
|
+
- Do not trust stable docs blindly when `.claude/rules/active-change-index.md` flags related in-progress architecture work.
|
|
244
|
+
- Do not write `resume_context` into task-doc frontmatter. DB is canonical; write via `project:task:save` or the inline editor in Command Center.
|
|
245
|
+
|
|
246
|
+
## Operations-Only Projects
|
|
247
|
+
|
|
248
|
+
Some projects derived from this template are operations-only. They have `operations/` (or a top-level `src/`) but NO `ui/`, NO `foundations/config/organization-model.ts`, and NO frontend. Finding none of these is not missing scaffolding -- it is by design.
|
|
249
|
+
|
|
250
|
+
**What applies:** Only Task Classes 2 (Workflow / Agent / Operations Work) and 4 (Debugging / Impact Analysis) apply to operations-only projects. Task Classes 1 (UI / Shell Work), 3 (Organization Model / Feature Access Work), and 5 (Platform Extension / Package Contract Work) do not apply and can be skipped.
|
|
251
|
+
|
|
252
|
+
**Primary entrypoint:** For operations-only projects, the project's own `CLAUDE.md` and its Navigation table are the canonical first-read. This rule provides task-routing context but its full surface map is irrelevant for that project type.
|
|
253
|
+
|
|
254
|
+
**Signal:** The `CLAUDE.md` of an operations-only project includes `Project type: operations-only` in its `## Project` section. When you see this signal, skip all template surfaces that don't exist and go directly to the operations task class.
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Frontend conventions -- React, routing, state, styling, testing, pages
|
|
3
|
-
paths:
|
|
4
|
-
- ui/src/**
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Frontend
|
|
8
|
-
|
|
9
|
-
## Safety Invariants
|
|
10
|
-
|
|
11
|
-
- `ElevasisUIProvider` in `ui/src/main.tsx` auto-composes shared UI, auth, and API surface -- route files do not wire providers manually
|
|
12
|
-
- `useApiClient()` from `@/lib/hooks/useApiClient` for authenticated API calls -- never raw `fetch` with auth headers
|
|
13
|
-
- `routeTree.gen.ts` is auto-generated on `pnpm dev` -- never edit manually
|
|
14
|
-
- Auth protection: wrap page content with `ProtectedRoute` from `@elevasis/ui/auth`. Admin pages nest `AdminGuard` inside `ProtectedRoute`
|
|
15
|
-
- Never fork `@elevasis/ui` components -- if a published component needs a tweak, that missing capability is a bug in `@elevasis/ui`
|
|
16
|
-
|
|
17
|
-
## Silent-Break Gotchas
|
|
18
|
-
|
|
19
|
-
- Route files vs layout files: `operations.tsx` is a layout (renders `<Outlet />`), `operations/my-page.index.tsx` is a page. Confusing the two breaks routing silently
|
|
20
|
-
- `foundations/` cannot import React or `@elevasis/sdk/worker` -- it is runtime-agnostic shared types only
|
|
21
|
-
- `@/*` resolves to `ui/src/*`, `@foundation/*` resolves to `foundations/*` -- never import from `operations/` (separate runtime)
|
|
22
|
-
|
|
23
|
-
## Stack Constraints
|
|
24
|
-
|
|
25
|
-
- Mantine 8.2.7 for all UI components -- no Radix UI, no Tailwind CSS, no shadcn
|
|
26
|
-
- `@tabler/icons-react` for icons -- never Lucide
|
|
27
|
-
- Server state: TanStack Query. Client state: Zustand + Immer. Never mix the two
|
|
28
|
-
- Glass background is the primary surface treatment: `var(--glass-background)` with `backdrop-filter: var(--glass-blur)`
|
|
29
|
-
- Import shared components from `@elevasis/ui/components`, `@elevasis/ui/layout`, `@elevasis/ui/charts`
|
|
30
|
-
- Import charts from `@elevasis/ui/charts`, not directly from `@mantine/charts`
|
|
31
|
-
|
|
32
|
-
## Integration UI Surfaces
|
|
33
|
-
|
|
34
|
-
When building pages that display external data, use published `@elevasis/ui` components before building custom UI. Use Mantine components and CSS variables exclusively -- no inline hex colors, no custom design tokens. Match existing page density and spacing.
|
|
35
|
-
|
|
36
|
-
## Detailed Reference
|
|
37
|
-
|
|
38
|
-
- `node_modules/@elevasis/sdk/reference/scaffold/ui/recipes.md` -- add a page, add a nav item, theme tokens, feature-scoped components, route patterns (static, nested, dynamic)
|
|
39
|
-
- `node_modules/@elevasis/sdk/reference/scaffold/ui/feature-flags-and-gating.md` -- `featureKey` / `FeatureGuard` / `AdminGuard` model
|
|
40
|
-
- `node_modules/@elevasis/sdk/reference/scaffold/ui/customization.md` -- sidebar composition via manifest overrides
|
|
41
|
-
- `node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md` -- TypeScript shapes (`FeatureModule`, `NavItem`, `OrganizationModel`)
|
|
42
|
-
- `ui/src/config/theme.ts` -- theme configuration and CSS variable definitions
|
|
43
|
-
- `ui/src/config/nav-items.ts` -- sidebar navigation entries
|
|
1
|
+
---
|
|
2
|
+
description: Frontend conventions -- React, routing, state, styling, testing, pages
|
|
3
|
+
paths:
|
|
4
|
+
- ui/src/**
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Frontend
|
|
8
|
+
|
|
9
|
+
## Safety Invariants
|
|
10
|
+
|
|
11
|
+
- `ElevasisUIProvider` in `ui/src/main.tsx` auto-composes shared UI, auth, and API surface -- route files do not wire providers manually
|
|
12
|
+
- `useApiClient()` from `@/lib/hooks/useApiClient` for authenticated API calls -- never raw `fetch` with auth headers
|
|
13
|
+
- `routeTree.gen.ts` is auto-generated on `pnpm dev` -- never edit manually
|
|
14
|
+
- Auth protection: wrap page content with `ProtectedRoute` from `@elevasis/ui/auth`. Admin pages nest `AdminGuard` inside `ProtectedRoute`
|
|
15
|
+
- Never fork `@elevasis/ui` components -- if a published component needs a tweak, that missing capability is a bug in `@elevasis/ui`
|
|
16
|
+
|
|
17
|
+
## Silent-Break Gotchas
|
|
18
|
+
|
|
19
|
+
- Route files vs layout files: `operations.tsx` is a layout (renders `<Outlet />`), `operations/my-page.index.tsx` is a page. Confusing the two breaks routing silently
|
|
20
|
+
- `foundations/` cannot import React or `@elevasis/sdk/worker` -- it is runtime-agnostic shared types only
|
|
21
|
+
- `@/*` resolves to `ui/src/*`, `@foundation/*` resolves to `foundations/*` -- never import from `operations/` (separate runtime)
|
|
22
|
+
|
|
23
|
+
## Stack Constraints
|
|
24
|
+
|
|
25
|
+
- Mantine 8.2.7 for all UI components -- no Radix UI, no Tailwind CSS, no shadcn
|
|
26
|
+
- `@tabler/icons-react` for icons -- never Lucide
|
|
27
|
+
- Server state: TanStack Query. Client state: Zustand + Immer. Never mix the two
|
|
28
|
+
- Glass background is the primary surface treatment: `var(--glass-background)` with `backdrop-filter: var(--glass-blur)`
|
|
29
|
+
- Import shared components from `@elevasis/ui/components`, `@elevasis/ui/layout`, `@elevasis/ui/charts`
|
|
30
|
+
- Import charts from `@elevasis/ui/charts`, not directly from `@mantine/charts`
|
|
31
|
+
|
|
32
|
+
## Integration UI Surfaces
|
|
33
|
+
|
|
34
|
+
When building pages that display external data, use published `@elevasis/ui` components before building custom UI. Use Mantine components and CSS variables exclusively -- no inline hex colors, no custom design tokens. Match existing page density and spacing.
|
|
35
|
+
|
|
36
|
+
## Detailed Reference
|
|
37
|
+
|
|
38
|
+
- `node_modules/@elevasis/sdk/reference/scaffold/ui/recipes.md` -- add a page, add a nav item, theme tokens, feature-scoped components, route patterns (static, nested, dynamic)
|
|
39
|
+
- `node_modules/@elevasis/sdk/reference/scaffold/ui/feature-flags-and-gating.md` -- `featureKey` / `FeatureGuard` / `AdminGuard` model
|
|
40
|
+
- `node_modules/@elevasis/sdk/reference/scaffold/ui/customization.md` -- sidebar composition via manifest overrides
|
|
41
|
+
- `node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md` -- TypeScript shapes (`FeatureModule`, `NavItem`, `OrganizationModel`)
|
|
42
|
+
- `ui/src/config/theme.ts` -- theme configuration and CSS variable definitions
|
|
43
|
+
- `ui/src/config/nav-items.ts` -- sidebar navigation entries
|