@elevasis/sdk 1.7.0 → 1.8.1
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 +525 -4562
- package/dist/index.d.ts +72 -16
- package/package.json +2 -2
- package/reference/claude-config/hooks/post-edit-validate.mjs +0 -11
- package/reference/claude-config/hooks/scaffold-registry-reminder.mjs +188 -0
- package/reference/claude-config/logs/pre-edit-vibe-gate.log +17 -0
- package/reference/claude-config/logs/scaffold-registry-reminder.log +34 -0
- package/reference/claude-config/rules/active-change-index.md +80 -0
- package/reference/claude-config/rules/agent-start-here.md +254 -0
- package/reference/claude-config/rules/deployment.md +0 -1
- package/reference/claude-config/rules/observability.md +2 -2
- package/reference/claude-config/rules/operations.md +64 -0
- package/reference/claude-config/rules/organization-model.md +44 -0
- package/reference/claude-config/rules/organization-os.md +2 -4
- package/reference/claude-config/rules/task-tracking.md +4 -4
- package/reference/claude-config/rules/ui.md +202 -0
- package/reference/claude-config/rules/vibe.md +0 -8
- package/reference/claude-config/settings.json +4 -11
- package/reference/claude-config/skills/configure/SKILL.md +0 -2
- package/reference/claude-config/skills/configure/operations/features.md +10 -11
- package/reference/claude-config/skills/deploy/SKILL.md +4 -14
- package/reference/claude-config/skills/dsp/SKILL.md +2 -2
- package/reference/claude-config/skills/elevasis/SKILL.md +24 -28
- package/reference/claude-config/skills/explore/SKILL.md +5 -5
- package/reference/claude-config/skills/project/SKILL.md +33 -1
- package/reference/claude-config/skills/save/SKILL.md +8 -22
- package/reference/claude-config/skills/setup/SKILL.md +32 -16
- package/reference/claude-config/skills/status/SKILL.md +2 -3
- package/reference/claude-config/skills/submit-request/SKILL.md +1 -1
- package/reference/deployment/command-center.mdx +0 -17
- package/reference/framework/project-structure.mdx +1 -5
- package/reference/packages/ui/src/hooks/README.md +1 -2
- package/reference/scaffold/operations/propagation-pipeline.md +10 -11
- package/reference/scaffold/operations/scaffold-maintenance.md +1 -4
- package/reference/scaffold/recipes/add-a-resource.md +3 -12
- package/reference/scaffold/reference/contracts.md +1 -1
- package/reference/claude-config/hooks/__tests__/pre-edit-vibe-gate.test.mjs +0 -169
- package/reference/claude-config/hooks/pre-edit-vibe-gate.mjs +0 -128
- package/reference/claude-config/rules/docs.md +0 -26
|
@@ -0,0 +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.
|
|
@@ -33,7 +33,6 @@ Deploy accepts `--major`, `--minor`, `--patch` flags to bump the deployment vers
|
|
|
33
33
|
|
|
34
34
|
1. **Bundle:** esbuild compiles `src/index.ts` + all dependencies into a single self-contained CJS file. No `node_modules` needed at runtime.
|
|
35
35
|
2. **Metadata:** Resource definitions, Zod schemas (converted to JSON Schema), relationships, triggers.
|
|
36
|
-
3. **Docs:** All `.md` and `.mdx` files in `docs/` (max 100KB per file, 1MB total). The SDK scans the directory configured as `docsDir` in `elevasis.config.ts` (defaults to `docs/`, set to `../docs/` in this template). Two auto-generated files are regenerated by `/deploy` and `/elevasis deploy` before upload: `docs/index.md` (navigation hub) and `docs/resources.md` (platform resource inventory).
|
|
37
36
|
|
|
38
37
|
## Environment
|
|
39
38
|
|
|
@@ -22,8 +22,8 @@ paths:
|
|
|
22
22
|
## Inspecting Executions
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
|
-
pnpm
|
|
26
|
-
pnpm
|
|
25
|
+
pnpm elevasis-sdk execution <resourceId> <executionId>
|
|
26
|
+
pnpm elevasis-sdk executions <resourceId>
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
## Detailed Reference
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Platform workflows, agents, resource definitions, and deployment for the operations/ surface
|
|
3
|
+
paths:
|
|
4
|
+
- operations/**
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Operations
|
|
8
|
+
|
|
9
|
+
**Status:** Stable
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
The `operations/` directory contains platform resources and deployment metadata that deploy to the Elevasis platform. It is a standalone TypeScript project with its own `package.json`, `tsconfig.json`, and dependencies.
|
|
14
|
+
|
|
15
|
+
**Discovering deployed resources:** Glob `operations/resources/**` for local source files, or run `pnpm elevasis-sdk project:list --pretty` against the live DB for the deployed surface. No static resource map exists -- the file system and CLI are authoritative.
|
|
16
|
+
|
|
17
|
+
## Echo Workflow (Starter Example)
|
|
18
|
+
|
|
19
|
+
**Location:** `operations/src/example/echo.ts`
|
|
20
|
+
|
|
21
|
+
The echo workflow accepts a message string and returns it unchanged. Its purpose is the wiring, not the logic: input and output schemas are defined in `foundations/types/index.ts` and imported by both the workflow and the frontend.
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
foundations/types/index.ts -- defines echoInputSchema, echoOutputSchema
|
|
25
|
+
operations/src/example/echo.ts -- imports schemas for workflow contract
|
|
26
|
+
ui/src/routes/ -- imports schemas for form validation and display
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The workflow is registered in `operations/src/index.ts` as part of the `example` group and deployed with `pnpm -C operations deploy`.
|
|
30
|
+
|
|
31
|
+
## Adding a New Workflow
|
|
32
|
+
|
|
33
|
+
1. **Define the contract in `foundations/`** -- Add Zod schemas and inferred types to `foundations/types/index.ts` (or a new file under `foundations/types/`).
|
|
34
|
+
|
|
35
|
+
2. **Implement the workflow in `operations/src/`** -- Create a new directory under `operations/src/` for the feature. Export the workflow from its `index.ts` and register it in `operations/src/index.ts`.
|
|
36
|
+
|
|
37
|
+
3. **Add the UI in `ui/src/routes/`** -- Create a new route file. Use TanStack Query to call the workflow execution endpoint. Import schemas from `@foundation/types` for validation and type inference.
|
|
38
|
+
|
|
39
|
+
4. **Deploy and verify:**
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pnpm -C operations check # validate resource definitions
|
|
43
|
+
pnpm -C operations deploy # deploy to dev
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Resource Registry
|
|
47
|
+
|
|
48
|
+
`operations/src/index.ts` default-exports a `DeploymentSpec` with `version`, `workflows`, `agents`, and optional topology-oriented metadata such as `triggers`, `integrations`, `relationships`, `humanCheckpoints`, and `externalResources`. Each feature group exports `workflows` and `agents` arrays from its own `index.ts`, spread into the top-level spec.
|
|
49
|
+
|
|
50
|
+
When you need breadth first, read:
|
|
51
|
+
|
|
52
|
+
- `operations/src/README.md` for the source boundary and drill-down guidance
|
|
53
|
+
- Glob `operations/resources/**` or run `pnpm elevasis-sdk project:list --pretty` for the live deployed surface
|
|
54
|
+
|
|
55
|
+
## Commands
|
|
56
|
+
|
|
57
|
+
| Command | Purpose |
|
|
58
|
+
| -------------------------------- | ----------------------------- |
|
|
59
|
+
| `pnpm -C operations check` | Validate resource definitions |
|
|
60
|
+
| `pnpm -C operations check-types` | TypeScript type-check |
|
|
61
|
+
| `pnpm -C operations deploy` | Deploy to dev |
|
|
62
|
+
| `pnpm -C operations deploy:prod` | Deploy to production |
|
|
63
|
+
|
|
64
|
+
Always run `check` before `deploy`.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Edits to the canonical organization model go through /configure
|
|
3
|
+
paths:
|
|
4
|
+
- operations/foundations/config/organization-model.ts
|
|
5
|
+
- operations/foundations/config/organization-model.override.ts
|
|
6
|
+
- operations/foundations/config/extensions/**/*.ts
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Organization Model Edit Guide
|
|
10
|
+
|
|
11
|
+
`foundations/config/organization-model.ts` is the single source of truth for this
|
|
12
|
+
project's organizational identity -- it encodes customers, offerings, roles, goals,
|
|
13
|
+
features, statuses, and resource mappings that agents, workflows, and the UI shell all
|
|
14
|
+
consume at runtime.
|
|
15
|
+
|
|
16
|
+
## Preferred Entry Point: `/configure`
|
|
17
|
+
|
|
18
|
+
Direct edits to `organization-model.ts` are discouraged. Instead, use `/configure` (or
|
|
19
|
+
`/configure <domain>`) to run the read → propose → confirm → write → validate ceremony:
|
|
20
|
+
|
|
21
|
+
1. The skill reads the current model so proposals start from ground truth.
|
|
22
|
+
2. It drafts only the specific block being changed, leaving everything else intact.
|
|
23
|
+
3. The user confirms before any file is written.
|
|
24
|
+
4. After writing, `pnpm -C operations check-types` runs and `OrganizationModelSchema.parse()`
|
|
25
|
+
is verified. On failure the file is rolled back automatically.
|
|
26
|
+
|
|
27
|
+
Use `/configure <domain>` for targeted edits: `identity`, `customers`, `offerings`,
|
|
28
|
+
`roles`, `goals`, `techStack`, `features`, or `labels`.
|
|
29
|
+
|
|
30
|
+
## Runtime Validation
|
|
31
|
+
|
|
32
|
+
The model is validated at startup via `resolveOrganizationModel()` followed by
|
|
33
|
+
`OrganizationModelSchema.parse()`. Cross-reference checks (segment ID refs in offerings,
|
|
34
|
+
role reporting lines, period ordering in goals) are runtime-only and not caught by tsc
|
|
35
|
+
alone -- always let the ceremony run both checks before treating a change as complete.
|
|
36
|
+
|
|
37
|
+
## Extension Files
|
|
38
|
+
|
|
39
|
+
New Zod extension files under `foundations/config/extensions/` are Level B codify
|
|
40
|
+
operations. Route these through `/configure <domain>` as well -- the skill gates Level B
|
|
41
|
+
to explicit user confirmation before scaffolding a new `.ts` file.
|
|
42
|
+
|
|
43
|
+
This is a soft guide, not a hard block. The ceremony exists to prevent silent schema
|
|
44
|
+
drift and to keep the model's editorial history visible.
|
|
@@ -61,9 +61,7 @@ All paths under `node_modules/@elevasis/sdk/reference/scaffold/`:
|
|
|
61
61
|
|
|
62
62
|
### Local Project Docs
|
|
63
63
|
|
|
64
|
-
-
|
|
65
|
-
- `docs/resources.md` -- auto-generated project resource topology
|
|
66
|
-
- `docs/agent-start-here.md` -- canonical first-read for agents (includes task-class routing)
|
|
64
|
+
- `.claude/rules/agent-start-here.md` -- canonical first-read for agents (includes task-class routing)
|
|
67
65
|
|
|
68
66
|
## Published Subpaths and Constants
|
|
69
67
|
|
|
@@ -78,7 +76,7 @@ All paths under `node_modules/@elevasis/sdk/reference/scaffold/`:
|
|
|
78
76
|
|
|
79
77
|
## When Working with Organization OS
|
|
80
78
|
|
|
81
|
-
- **Changing org model (structural reality):** Use `/configure` as the entry point.
|
|
79
|
+
- **Changing org model (structural reality):** Use `/configure` as the entry point. Direct edits to `foundations/config/organization-model.ts` are discouraged -- `/configure` runs the read → propose → confirm → write → validate ceremony. Run `/configure` for the full layered flow or `/configure \<domain>` for a targeted domain.
|
|
82
80
|
- **Adding a feature:** Follow `node_modules/@elevasis/sdk/reference/scaffold/recipes/add-a-feature.md`. For toggling an existing feature, use `/configure features`.
|
|
83
81
|
- **Adding a resource:** Follow `node_modules/@elevasis/sdk/reference/scaffold/recipes/add-a-resource.md`.
|
|
84
82
|
- **Extending entities:** Start with `foundations/types/entities.ts` for the demo extension pattern. Base shapes come from `@elevasis/core/entities`.
|
|
@@ -30,7 +30,7 @@ The agent auto-saves progress (no user action needed) when:
|
|
|
30
30
|
- Significant progress has been made (2+ steps completed without saving)
|
|
31
31
|
- Before a context reset
|
|
32
32
|
|
|
33
|
-
Auto-save updates the task doc's Progress and Resume Context sections silently, then briefly confirms. The canonical persistence path is `pnpm
|
|
33
|
+
Auto-save updates the task doc's Progress and Resume Context sections silently, then briefly confirms. The canonical persistence path is `pnpm elevasis-sdk project:task:save` -- the CLI writes through to `prj_tasks.resume_context` (JSONB) so another agent can resume without re-deriving intent.
|
|
34
34
|
|
|
35
35
|
## Completion Suggestions
|
|
36
36
|
|
|
@@ -40,8 +40,8 @@ When all plan steps are marked COMPLETE, **suggest** completing the task -- neve
|
|
|
40
40
|
|
|
41
41
|
Project tasks for this template live in the `prj_tasks` Supabase table, not in repo-local files. Operate on them via the SDK CLI:
|
|
42
42
|
|
|
43
|
-
- `pnpm
|
|
44
|
-
- `pnpm
|
|
45
|
-
- `pnpm
|
|
43
|
+
- `pnpm elevasis-sdk project:work` -- entrypoint for task work (resume / new intent detection)
|
|
44
|
+
- `pnpm elevasis-sdk project:list` -- portfolio / task listing
|
|
45
|
+
- `pnpm elevasis-sdk project:task:save` -- persist progress + `resume_context` to the DB
|
|
46
46
|
|
|
47
47
|
The monorepo-side `/work` slash command still exists for monorepo task docs under `apps/docs/content/docs/in-progress/**`; that flow is unchanged. What went away is the external template's own `/work` skill and its `docs/in-progress/` directory -- external projects now route through the DB-backed `project:*` surface above.
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: UI shell, route structure, auth flow, API access, and template customization points for the ui/ surface
|
|
3
|
+
paths:
|
|
4
|
+
- ui/**
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# UI Features
|
|
8
|
+
|
|
9
|
+
**Status:** Stable
|
|
10
|
+
|
|
11
|
+
## App Shell Overview
|
|
12
|
+
|
|
13
|
+
The template frontend is a React 19 + TanStack Router app that composes a local dashboard shell with published feature manifests from `@elevasis/ui`.
|
|
14
|
+
|
|
15
|
+
The main join points are:
|
|
16
|
+
|
|
17
|
+
- `ui/src/main.tsx` -- boots the app with `ElevasisUIProvider`, query client, theme config, WorkOS AuthKit, notifications, and the generated route tree
|
|
18
|
+
- `ui/src/routes/__root.tsx` -- composes the authenticated shell with `ElevasisFeaturesProvider`, published feature manifests, app-local dashboard nav, shell runtime dependencies, and `FeatureShell`
|
|
19
|
+
- `ui/src/config/nav-items.ts` -- keeps the host-local dashboard entry separate from the published feature manifests
|
|
20
|
+
- `foundations/config/organization-model.ts` -- is the template's semantic source of truth, adapting `@elevasis/core/organization-model` into the preserved branding, dashboard label, quick-access, feature-label, and legacy surface helpers the shell still uses
|
|
21
|
+
|
|
22
|
+
Published feature manifests mounted by the template shell:
|
|
23
|
+
|
|
24
|
+
- `lead-gen`
|
|
25
|
+
- `crm`
|
|
26
|
+
- `delivery` at `/projects`
|
|
27
|
+
- `operations`
|
|
28
|
+
- `monitoring`
|
|
29
|
+
- `settings`
|
|
30
|
+
|
|
31
|
+
Important distinction:
|
|
32
|
+
|
|
33
|
+
- shared manifests gate on grouped org-model keys such as `acquisition` and `delivery`
|
|
34
|
+
- template routes and local nav may still use legacy aliases such as `crm`, `lead-gen`, and `projects`
|
|
35
|
+
- `foundations/config/organization-model.ts` and `ui/src/lib/hooks/useFeatureAccess.ts` are the bridge between those two vocabularies
|
|
36
|
+
|
|
37
|
+
Dashboard remains a host-local route at `/`, not a shared feature manifest.
|
|
38
|
+
|
|
39
|
+
This template should be treated as the downstream reference implementation for this composition:
|
|
40
|
+
|
|
41
|
+
- foundations owns the organization/runtime semantics
|
|
42
|
+
- `ui/src/config/nav-items.ts` preserves the host-local dashboard entry instead of pushing that concern into shared manifests
|
|
43
|
+
- `ui/src/routes/__root.tsx` threads `canonicalOrganizationModel` from foundations into `ElevasisFeaturesProvider` so the shared shell/runtime uses the same semantic source of truth as the local template helpers
|
|
44
|
+
- host-local customizations still stay local: dashboard remains app-owned nav, branding stays in app config, and quick-access/dashboard UX stays in the template app
|
|
45
|
+
|
|
46
|
+
## Auth and Initialization
|
|
47
|
+
|
|
48
|
+
The app uses WorkOS AuthKit through `ElevasisUIProvider`. Authentication is enforced by the local `ProtectedRoute` wrapper in `ui/src/features/auth/ProtectedRoute.tsx`.
|
|
49
|
+
|
|
50
|
+
**Sign-in flow:**
|
|
51
|
+
|
|
52
|
+
1. Unauthenticated user hits a protected route -- `ProtectedRoute` redirects to `/login?returnTo=<path>`
|
|
53
|
+
2. `/login` renders a sign-in card; user clicks Sign In, triggering `signIn({ returnTo })` from `useAuth()`
|
|
54
|
+
3. User authenticates on the WorkOS-hosted sign-in page
|
|
55
|
+
4. WorkOS redirects back to `/auth-redirect` -- `ui/src/routes/auth-redirect.tsx` waits for auth to complete, then navigates to the requested path or `/`
|
|
56
|
+
5. User lands on the home page, fully authenticated
|
|
57
|
+
|
|
58
|
+
**Route protection:**
|
|
59
|
+
|
|
60
|
+
Wrap protected route components with the local `ProtectedRoute` from `@/features/auth`, which adds the full-screen loader and delegates to the shared guard from `@elevasis/ui/auth`:
|
|
61
|
+
|
|
62
|
+
```tsx
|
|
63
|
+
import { ProtectedRoute } from '@/features/auth'
|
|
64
|
+
|
|
65
|
+
function HomePageGuarded() {
|
|
66
|
+
return (
|
|
67
|
+
<ProtectedRoute>
|
|
68
|
+
<HomePage />
|
|
69
|
+
</ProtectedRoute>
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Initialization state:**
|
|
75
|
+
|
|
76
|
+
Use `useInitialization()` from `@elevasis/ui/initialization` anywhere inside the app to read aggregated auth + org readiness:
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
const { allReady, userReady, isInitializing, error, retry, profile } = useInitialization()
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Organization context:**
|
|
83
|
+
|
|
84
|
+
Use `useOrganization()` from `@elevasis/ui/organization` to access org-scoped IDs and memberships:
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
const { currentWorkOSOrganizationId, currentSupabaseOrganizationId, memberships, switchOrganization } = useOrganization()
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## API and Streaming
|
|
91
|
+
|
|
92
|
+
Use `useApiClient()` from `@/lib/hooks/useApiClient` in route components and feature hooks:
|
|
93
|
+
|
|
94
|
+
```ts
|
|
95
|
+
const { apiRequest, isOrganizationReady } = useApiClient()
|
|
96
|
+
const data = await apiRequest('/executions', { method: 'GET' })
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
The template also re-exports `useApiClientContext()` and the shared API client types from `@/lib/hooks/useApiClient`.
|
|
100
|
+
|
|
101
|
+
For real-time updates, feature surfaces use the local singleton wrapper:
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
import { sseConnectionManager } from '@/lib/sse/SSEConnectionManager'
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Required env vars:**
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
VITE_WORKOS_CLIENT_ID=client_...
|
|
111
|
+
VITE_WORKOS_REDIRECT_URI=http://localhost:4300/auth-redirect
|
|
112
|
+
VITE_WORKOS_SIGNOUT_URI=http://localhost:4300/login
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
The API URL is centralized in `ui/src/lib/constants/api.ts`. In the current template it is hard-coded to `https://api.elevasis.io`, so if the bootstrap is repointed to another API target, that file is the source of truth.
|
|
116
|
+
|
|
117
|
+
## Route Structure
|
|
118
|
+
|
|
119
|
+
Current top-level app sections:
|
|
120
|
+
|
|
121
|
+
- `/` -- host-local dashboard entrypoint with quick links derived from `organizationModel.navigation.quickAccessSurfaceIds`
|
|
122
|
+
- `/lead-gen/*` -- lead generation pages (`lists`, `companies`, `contacts`, `deliverability`)
|
|
123
|
+
- `/crm/*` -- CRM overview, pipeline, and deals
|
|
124
|
+
- `/projects/*` -- delivery feature pages (projects, milestones, tasks, notes)
|
|
125
|
+
- `/operations/*` -- operations overview, resources, command queue, command view, sessions, task scheduler
|
|
126
|
+
- `/monitoring/*` -- execution logs, execution health, activity log, cost analytics, notifications
|
|
127
|
+
- `/settings/*` -- account, organization, credentials, API keys, deployments, webhooks, and appearance
|
|
128
|
+
- `/login` and `/auth-redirect` -- auth entry/callback routes
|
|
129
|
+
|
|
130
|
+
Section guards currently follow this pattern:
|
|
131
|
+
|
|
132
|
+
- `ProtectedRoute` for all authenticated sections
|
|
133
|
+
- `FeatureGuard` on all feature sections that should hard-stop when a feature is disabled: `crm`, `lead-gen`, `projects`, `operations`, and `monitoring`
|
|
134
|
+
- provider-level shell gating for shared feature nav and sub-shell behavior
|
|
135
|
+
|
|
136
|
+
The app shell in `__root.tsx` derives visible nav from `shellModel.navItems`, filters admin-only entries locally using the signed-in profile, and passes `canonicalOrganizationModel` into `ElevasisFeaturesProvider` so shared nav labels, paths, and graph runtime behavior resolve from the same foundations-backed semantic model.
|
|
137
|
+
|
|
138
|
+
## Dashboard and Feature Areas
|
|
139
|
+
|
|
140
|
+
**Dashboard**
|
|
141
|
+
|
|
142
|
+
`ui/src/features/dashboard/components/Dashboard.tsx` is intentionally lightweight. It acts as the host-owned landing page and renders quick access cards for the most important organization surfaces instead of duplicating the shared operations overview.
|
|
143
|
+
|
|
144
|
+
**Operations**
|
|
145
|
+
|
|
146
|
+
The operations area is the richest shared shell in the template. It includes:
|
|
147
|
+
|
|
148
|
+
- resource inventory and detail pages
|
|
149
|
+
- command queue and command view
|
|
150
|
+
- sessions screens
|
|
151
|
+
- the shared operations overview at `/operations/`
|
|
152
|
+
|
|
153
|
+
**Monitoring**
|
|
154
|
+
|
|
155
|
+
Monitoring is scaffolded as a shared feature area with route files for:
|
|
156
|
+
|
|
157
|
+
- activity log
|
|
158
|
+
- cost analytics
|
|
159
|
+
- execution health
|
|
160
|
+
- execution logs
|
|
161
|
+
- notifications
|
|
162
|
+
|
|
163
|
+
## Customization Points
|
|
164
|
+
|
|
165
|
+
The main template-owned customization surfaces are:
|
|
166
|
+
|
|
167
|
+
- `ui/src/config/app-config.ts` -- brand name, logos, and app version
|
|
168
|
+
- `ui/src/config/theme.ts` -- theme presets and defaults
|
|
169
|
+
- `ui/src/config/background.tsx` -- shared background treatment
|
|
170
|
+
- `ui/src/config/loader.tsx` -- global loader element
|
|
171
|
+
- `ui/src/config/nav-items.ts` -- app-local nav entries, including the preserved dashboard/home entry
|
|
172
|
+
- `foundations/config/organization-model.ts` -- product labels, feature enablement, semantic surfaces, canonical-to-legacy surface aliases, and quick-access behavior
|
|
173
|
+
- `ui/src/config/README.md` -- the deeper guide for those config files
|
|
174
|
+
|
|
175
|
+
## Customizing Feature Sidebars
|
|
176
|
+
|
|
177
|
+
The template demonstrates one override pattern in `ui/src/routes/__root.tsx`: it extends `CRM_ITEMS` with a template-owned Reports link and replaces `crmManifest` with `customCrmManifest` in the feature manifest array. The backing route lives at `ui/src/routes/crm/reports.tsx` -- delete both the nav item and the route if you don't need them.
|
|
178
|
+
|
|
179
|
+
Two customization layers are available for every shared feature sidebar:
|
|
180
|
+
|
|
181
|
+
1. **Nav-item shortcut (`items` prop)** -- when you just need to swap or extend the nav array, spread the published items constant and pass the result to `*SidebarMiddle`. The template's CRM customization uses this path.
|
|
182
|
+
|
|
183
|
+
```tsx
|
|
184
|
+
import { crmManifest, CrmSidebar, CrmSidebarMiddle, CRM_ITEMS } from '@elevasis/ui/features/crm'
|
|
185
|
+
import type { NavItem } from '@elevasis/ui/layout'
|
|
186
|
+
|
|
187
|
+
const customItems: NavItem[] = [...CRM_ITEMS, { label: 'Reports', to: '/crm/reports', icon: IconFileText, exact: false }]
|
|
188
|
+
const CustomCrmSidebar = () => <CrmSidebar><CrmSidebarMiddle items={customItems} /></CrmSidebar>
|
|
189
|
+
const customCrmManifest = { ...crmManifest, sidebar: CustomCrmSidebar }
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
2. **Compose-primitives (structural changes)** -- when you need to inject panels, reorder sections, or add a new section, drop down to `CrmSidebarTop` + `SubshellNavList` + `SubshellSidebarSection` + published panels (`MyTasksPanel`, `QuickCreateActions`) and compose your own Middle.
|
|
193
|
+
|
|
194
|
+
`manifest.sidebar` accepts any component, so arbitrary customization is always available. The `items` prop is an abstraction barrier for the common case, not a limit.
|
|
195
|
+
|
|
196
|
+
See `node_modules/@elevasis/sdk/reference/scaffold/ui/customization.md` for the decision tree, page-wrapping pattern, and delivery's three-section variant. See `node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md` for `NavItem`, `FeatureModule`, and related TypeScript shapes.
|
|
197
|
+
|
|
198
|
+
## Notes
|
|
199
|
+
|
|
200
|
+
- `ui/src/routeTree.gen.ts` is generated by TanStack Router tooling. Do not hand-edit it.
|
|
201
|
+
- The template ships a broad route surface so downstream projects can trim or reshape features without having to re-derive the shared shell contract from scratch.
|
|
202
|
+
- For package-export discovery, glob `node_modules/@elevasis/sdk/reference/` or `node_modules/@repo/ui/dist/` for the current SDK/UI package surface.
|
|
@@ -172,14 +172,6 @@ Example: "That could be a note to capture or a status update on the current task
|
|
|
172
172
|
|
|
173
173
|
Never ask more than one question per ambiguous input. If the user's reply is still ambiguous, ask once more, then surface the options explicitly.
|
|
174
174
|
|
|
175
|
-
## Enforcement and Trust Marker
|
|
176
|
-
|
|
177
|
-
Raw edits to `foundations/config/organization-model.ts` and `foundations/config/extensions/*.ts` are blocked by the `pre-edit-vibe-gate.mjs` PreToolUse hook unless the `VIBE_APPROVED=1` environment variable is set.
|
|
178
|
-
|
|
179
|
-
This variable is set automatically by `/configure` after the user confirms a codify or toggle ceremony. It is subshell-scoped -- no filesystem state to clean up. Power users who invoke `/configure` directly get the marker without triggering the hook error.
|
|
180
|
-
|
|
181
|
-
If you encounter the hook block outside of a `/configure` ceremony, do not attempt to bypass it. Surface the message to the user and suggest running `/configure \<domain>` to proceed through the approved ceremony.
|
|
182
|
-
|
|
183
175
|
## Classifier Threshold
|
|
184
176
|
|
|
185
177
|
Default threshold: `balanced`.
|