@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
@@ -0,0 +1,71 @@
1
+ # Elevasis Workspace Ship-Train
2
+
3
+ ## Why this note exists
4
+
5
+ The Elevasis runtime (`external/elevasis/`) was promoted into the pnpm workspace as `packages/elevasis-{core,operations}/`. That migration exposed two latent SDK pipeline failures -- a rollup `.dts` resolver bug affecting transitive type-only peers (`openai`, `@supabase/*`, `@workos-inc/node`, etc.) and a deploy-validator crash on ESM-only `exports` maps -- both of which are now fixed in `@elevasis/sdk`. The same migration forced a formal subpath boundary contract for `@elevasis/sdk`: the default barrel is now browser-safe only, with `@elevasis/sdk/worker`, `@elevasis/sdk/node`, and `@elevasis/sdk/test-utils` as explicit runtime-gated subpaths, enforced by `no-restricted-imports` lint rules and a build-time bundle-leak test suite. Separately, workflow input/output schemas are now codified as the canonical SSOT through a three-layer pattern (operations contract owns schemas; CC imports from the workflow contract; `apps/api` stays envelope-only). The result is minor bumps to `@elevasis/core`, `@elevasis/ui`, and `@elevasis/sdk`, a `_template` dependency-baseline update, and new boundary rules that external SDK consumers must follow.
6
+
7
+ ## Applies to
8
+
9
+ All template-derived projects that consume `@elevasis/sdk`, `@elevasis/core`, or `@elevasis/ui`. Specifically:
10
+
11
+ - `nirvana-marketing`
12
+ - `ZentaraHQ`
13
+ - Any future external SDK consumer derived from the `_template` baseline
14
+
15
+ `@elevasis/sdk` is now boundary-enforced. Any external project that previously imported Node-only modules from the default `@elevasis/sdk` barrel -- including `knowledge-codegen`, anything touching `node:fs`, or `worker_threads` -- must migrate those imports to `@elevasis/sdk/node`. Workflow handler code that uses `platform.call`, `acqDb`, or adapter factories should already be on `@elevasis/sdk/worker`; verify this is the case.
16
+
17
+ ## Required actions
18
+
19
+ 1. Pull template changes with `/git-sync` after this train publishes so the refreshed package baselines (`core/package.json`, `ui/package.json`, `operations/package.json`) reach the project.
20
+
21
+ 2. After the baseline lands, update package versions in the project:
22
+
23
+ ```bash
24
+ pnpm up @elevasis/core @elevasis/ui @elevasis/sdk --latest
25
+ ```
26
+
27
+ Version baselines are written into the `_template` package files by the release train. Match the versions from `_template` after sync or run `--latest` to pull the published minors.
28
+
29
+ 3. Run `pnpm install` from the project root after the dep bump to ensure the lockfile is updated.
30
+
31
+ 4. **Audit `@elevasis/sdk` import subpaths.** In `operations/src/`, search for any import from `@elevasis/sdk` that touches `knowledge-codegen`, `node:fs`, `worker_threads`, or any other Node-only module. These must move to `@elevasis/sdk/node`. Workflow handler files that use `platform`, `acqDb`, or adapter factories belong on `@elevasis/sdk/worker` -- verify the subpath is explicit.
32
+
33
+ ```ts
34
+ // Before (incorrect for Node-only tooling)
35
+ import { knowledgeCodegen } from '@elevasis/sdk'
36
+
37
+ // After
38
+ import { knowledgeCodegen } from '@elevasis/sdk/node'
39
+ ```
40
+
41
+ 5. **Audit for `@repo/elevasis-core` or `@repo/elevasis-operations` imports.** These package names are workspace-internal to the platform monorepo and are not published. External consumers must use the published packages (`@elevasis/sdk`, `@elevasis/core`, `@elevasis/ui`) exclusively. If a tenant project forked or copied an import path using the `@repo/elevasis-*` namespace, replace it with the appropriate published subpath.
42
+
43
+ 6. **Audit workflow input/output schema usage in `ui/src/`.** Per the schema SSOT pattern, CC code should import schemas from the workflow's `contract.inputSchema` or `contract.outputSchema`, not from hand-duplicated local type declarations. If the project has hand-written copies of workflow input or output schemas in `ui/src/`, flag them for migration to direct imports from the workflow contract. If a workflow's main file imports Node-only code, use the browser-safe sibling-schema pattern (a separate `<workflow-name>-schema.ts` file, importing `node:*`-free schema definitions only) so CC can consume the schema without triggering Vite's `"fs" has been externalized` error.
44
+
45
+ 7. **Rebuild and type-check:**
46
+
47
+ ```bash
48
+ pnpm -C ui build
49
+ pnpm -C ui exec tsc --noEmit
50
+ pnpm -C operations exec tsc --noEmit
51
+ ```
52
+
53
+ ## Verification
54
+
55
+ After applying all actions above:
56
+
57
+ - `pnpm install` completes cleanly with no unresolved peer warnings.
58
+ - `pnpm check-types` passes across all project packages (`ui`, `operations`, `core`).
59
+ - `pnpm test` passes where test suites exist.
60
+ - `pnpm -C ui dev` starts the CC dev server. Navigating to any workflow detail route (e.g., a lead-gen list action form) produces no `Module "fs" has been externalized for browser compatibility` console errors. If those errors appeared before this upgrade, they should be gone.
61
+ - A workflow execution round-trips end-to-end in dev: trigger a workflow from the CC UI, confirm the execution record appears in the monitoring view.
62
+
63
+ ## Not handled by /git-sync
64
+
65
+ `/git-sync` propagates template-authored files (package baselines, scaffold doc copies, sync-managed surfaces) but does NOT:
66
+
67
+ - Run `pnpm up @elevasis/core @elevasis/ui @elevasis/sdk --latest` -- dep bumps are manual after the baseline lands.
68
+ - Infer or apply subpath migrations for `@elevasis/sdk`. If any workflow in `operations/src/` was importing Node-only modules from the default `@elevasis/sdk` barrel, `/git-sync` will not rewrite those import paths to `@elevasis/sdk/node`. That migration is manual per project.
69
+ - Replace hand-duplicated workflow schemas in `ui/src/` with imports from workflow contracts. Tenant-side schema copies need manual migration to use `contract.inputSchema` / `contract.outputSchema`.
70
+ - Remove or update any `no-restricted-imports` lint rule overrides that the project may have added to disable `@elevasis/sdk` subpath enforcement. If the project disabled the rule, re-enable it after sync and resolve any violations it surfaces.
71
+ - Clear the Vite module-graph cache (`ui/node_modules/.vite`). After upgrading the SDK, clear this directory manually and restart the dev server before verifying that browser-safety errors are gone -- stale cache can make fixed boundary violations appear to persist.
@@ -0,0 +1,83 @@
1
+ # Knowledge Bundle Ship-Train
2
+
3
+ ## Why this note exists
4
+
5
+ The Knowledge Map (Browser, CLI, skill, icons, external parity) is being shipped as a coordinated bundle. The Organization Model now treats `knowledge` as a first-class graph domain with `kind`-discriminated nodes (`playbook` / `strategy` / `reference`) connected to features and capabilities through `governs` edges. A new `/knowledge` skill absorbs the prior `/configure` skill as a unified intent-inferring surface (read + describe + codify + toggle); `/configure` is tombstoned via `sync-delete-manifest.json`. A new `knowledge:*` CLI subcommand suite ships on both `elevasis` and `elevasis-sdk` over a shared `@repo/core/knowledge/queries` data layer. The Knowledge Browser is wired into `@elevasis/ui` with reusable primitives (`KnowledgeBrowser`, `KnowledgeTree`, `DescribeNodeView`, `KindChip`, `NodeHeader`, `NodeDescribeShell`, etc.) and a build-time MDX codegen pipeline at `@elevasis/sdk/node`. A unified semantic icon-token catalog lives at `@elevasis/core/organization-model` and is shared across core, SDK, UI, Command Center, and external projects. External-parity work makes the bundle zero-config for tenant projects: a dual-mode Vite plugin walks up to `.elevasis`, runs the two-codegen pipeline in-process, and writes artifacts the published Browser already imports -- no flags, no paths, no recipe steps.
6
+
7
+ ## Applies to
8
+
9
+ All template-derived projects that consume `@elevasis/sdk`, `@elevasis/core`, or `@elevasis/ui`. Specifically:
10
+
11
+ - `nirvana-marketing`
12
+ - `ZentaraHQ`
13
+ - Any future external SDK consumer derived from the `_template` baseline
14
+
15
+ ## Required actions
16
+
17
+ 1. Pull template changes with `/git-sync` after this train publishes so the refreshed knowledge wiring (template OM defaults, starter `welcome.mdx`, vite plugin pre-wiring, `/knowledge` skill, `/configure` tombstone, scaffold recipe) reaches the project.
18
+
19
+ 2. **`/configure` is gone.** The skill was absorbed into `/knowledge`. `/git-sync` removes `external/_template/.claude/skills/configure/` (and its 10 operations files) via `sync-delete-manifest.json` (wave: `knowledge-skill`). Update any tenant-side automation, prompts, or docs that still reference `/configure` -- replace with `/knowledge`. The skill is intent-inferring: classify by natural language (read / describe / codify / toggle), not by verb namespace.
20
+
21
+ 3. **`/knowledge` ceremony is unchanged.** The codify ceremony (snapshot -> propose -> confirm -> write -> validate -> rollback) and the two-level model (Level A config-only edits vs. Level B new Zod extension files) are preserved bit-for-bit. The skill body lives at `.claude/skills/knowledge/SKILL.md` (~245 lines) with 10 operations files: `codify-level-a.md`, `codify-level-b.md`, plus 8 domain references (`identity`, `customers`, `offerings`, `roles`, `goals`, `techStack`, `features`, `labels`).
22
+
23
+ 4. **Vite plugin is pre-wired.** `external/_template/ui/vite.config.ts` imports and spreads `elevasisVite()` from `@elevasis/ui/vite`. After `/git-sync`, the plugin auto-discovers the project via `.elevasis` walk-up, runs both knowledge codegens in-process, and writes:
24
+ - `core/config/knowledge/_generated/nodes.ts`
25
+ - `core/config/knowledge/_generated/knowledge-bodies.tsx`
26
+ - `core/config/knowledge/_generated/knowledge-search-index.json`
27
+
28
+ Same behavior in `vite dev` and `vite build`. No flags, no manual codegen step required for the bundle to work.
29
+
30
+ 5. **Starter knowledge node lands.** `core/config/knowledge/nodes/welcome.mdx` ships in the template so a fresh clone has a non-empty Browser on first `pnpm -C ui dev`. Replace with tenant-authored MDX nodes as the project codifies real organizational knowledge. Tenant nodes go under `core/config/knowledge/nodes/**/*.mdx` with frontmatter declaring `id`, `kind`, `title`, optional `icon` (semantic token), and an MDX body. Default fallback icons by `kind` apply when `icon` is omitted.
31
+
32
+ 6. **Knowledge baseline propagates to the OM.** `core/config/organization-model.ts` now includes baseline knowledge defaults imported from `@elevasis/core/organization-model`. The merge-aware Tier 2 sync preserves tenant overrides while picking up the baseline. After `/git-sync`, verify `resolveOrganizationModel()` still parses (Zod) and `pnpm -C ui exec tsc --noEmit` passes.
33
+
34
+ 7. **`knowledge:*` CLI subcommands are available.** From inside the project (any subdirectory):
35
+
36
+ ```bash
37
+ pnpm exec elevasis-sdk knowledge:ls /by-feature/sales/crm
38
+ pnpm exec elevasis-sdk knowledge:ls /by-kind/playbook
39
+ pnpm exec elevasis-sdk knowledge:cat <node-id>
40
+ pnpm exec elevasis-sdk knowledge:graph <node-id>
41
+ ```
42
+
43
+ These walk up to `.elevasis`, load the project's OM (with tenant nodes), and print results. Output flags: default text, `--json` envelope, `--ids-only` for piping. The Knowledge Browser sidebar copy buttons emit matching skill-resolvable commands (`/knowledge read <node-id>`, `/knowledge read-folder feature:<id>`, `/knowledge read-folder kind:<kind>`).
44
+
45
+ 8. **Semantic icon tokens replace ad-hoc strings.** When authoring or editing nodes (OM or MDX frontmatter), use semantic tokens from the catalog: `nav.*`, `knowledge.*`, `feature.*`, `resource.*`, `integration.*`, plus `custom.*` namespace for tenant extensions. `IconNameSchema` validates them. The UI renders via Tabler mappings in `@elevasis/ui/icons`; library names (`IconBook`, etc.) stay out of the OM/MDX surface.
46
+
47
+ 9. **Rebuild and type-check:**
48
+
49
+ ```bash
50
+ pnpm install
51
+ pnpm -C ui build
52
+ pnpm -C ui exec tsc --noEmit
53
+ pnpm -C operations exec tsc --noEmit
54
+ ```
55
+
56
+ The first `vite dev` or `vite build` after sync triggers the in-process codegen automatically. To regenerate codegen artifacts manually (one-shot, not normally required):
57
+
58
+ ```bash
59
+ pnpm exec elevasis-sdk knowledge:generate
60
+ ```
61
+
62
+ ## Verification
63
+
64
+ After applying all actions above:
65
+
66
+ - `/configure` skill directory is absent: `external/<project>/.claude/skills/configure/` does not exist after sync.
67
+ - `/knowledge` skill is present at `.claude/skills/knowledge/SKILL.md` with the 10 operations files under `.claude/skills/knowledge/operations/`.
68
+ - `core/config/knowledge/nodes/welcome.mdx` exists; `core/config/knowledge/_generated/` has been populated by the vite plugin (3 files).
69
+ - `pnpm -C ui dev` boots; navigating to `/knowledge` renders the Browser with the welcome node visible in the tree.
70
+ - The 5 mount axes resolve: `/knowledge`, `/knowledge/by-feature/$path`, `/knowledge/by-kind/$kind`, `/knowledge/by-owner/$id`, `/knowledge/graph/$nodeId/governs|governed-by`.
71
+ - `pnpm exec elevasis-sdk knowledge:ls /by-kind/playbook` returns text output without error.
72
+ - `pnpm install` completes cleanly with no unresolved peer warnings.
73
+ - `pnpm -C ui exec tsc --noEmit` passes; `pnpm -C operations exec tsc --noEmit` passes.
74
+
75
+ ## Not handled by /git-sync
76
+
77
+ `/git-sync` propagates template-authored files (package baselines, `welcome.mdx` starter node, generated `_generated/` files, `/knowledge` skill, `/configure` tombstones, vite.config.ts wiring, scaffold recipe doc) but does NOT:
78
+
79
+ - Author tenant-specific knowledge MDX nodes. The starter `welcome.mdx` is illustrative; real organizational playbooks, strategies, and reference docs need to be hand-authored under `core/config/knowledge/nodes/**/*.mdx`. Use `/knowledge` for ceremony when codifying.
80
+ - Regenerate `_generated/` artifacts on its own. The vite plugin runs the codegens automatically on next `vite dev` / `vite build`. To regenerate manually before booting, run `pnpm exec elevasis-sdk knowledge:generate`.
81
+ - Migrate references in tenant code from `/configure` to `/knowledge`. Search the project for `/configure` mentions in `.claude/`, `docs/`, `README.md`, prompts, and CI scripts; rewrite to `/knowledge`. The tombstone deletes the skill files but does not edit downstream references.
82
+ - Replace tenant-authored icon strings with semantic tokens. Existing nodes that carried library-specific icon names (`IconBook`, etc.) will continue to render via fallback, but the canonical surface is semantic tokens. Migrate at-touched nodes to `knowledge.*` / `feature.*` / `nav.*` / `custom.*` over time.
83
+ - Clear the Vite module-graph cache (`ui/node_modules/.vite`). After upgrading the bundle, clear this directory manually and restart the dev server before verifying the Browser renders -- stale cache can mask a successful generation.
@@ -0,0 +1,59 @@
1
+ # Template Skills: `/run-ui` and `/tutorial`
2
+
3
+ ## Why this note exists
4
+
5
+ This sync introduces two new template skills and a project-wide tone-block in the always-loaded `agent-start-here` rule:
6
+
7
+ - **`/run-ui`** -- new skill at `.claude/skills/run-ui/SKILL.md`. One-command path to start the project's Vite dev server on port `4300` in the background. Probes the port, branches on free/own-vite/other-holder, asks before killing a non-vite holder, polls Vite stdout for `Local:` / `ready in`, then surfaces the URL and the background shell ID. Resolves the `strictPort: true` failure mode introduced by the `2026-05-02` WorkOS hardcode train -- before this skill, port collisions were a hard manual debug.
8
+ - **`/tutorial`** -- new skill at `.claude/skills/tutorial/{SKILL,vibe-coder,technical,progress-template}.md`. Persona-aware onboarding that forks at first invocation into a `vibe-coder` track (zero technical vocabulary, agent does all the work) or a `technical` track (full SDK depth, code-first). The choice persists to `.claude/memory/profile.md` and ships a tone block applied project-wide for the rest of every session.
9
+ - **`agent-start-here.md` Project Profile section** -- the always-loaded entrypoint rule now reads `profile.md` at session start and applies the per-track tone block to ALL agent output, not just inside `/tutorial`. This is the load-bearing change that lets `/tutorial` actually flip agent behavior across the whole project.
10
+
11
+ The project-owned `CLAUDE.md` Slash Commands table has a new `/tutorial` row in the template, but `CLAUDE.md` is verify-only on `/git-sync` -- derived projects own that file and need to add the row themselves if they want it documented.
12
+
13
+ This sync moves three pieces into derived projects:
14
+
15
+ - `.claude/skills/run-ui/SKILL.md` -- new file, replace-all surface, lands automatically
16
+ - `.claude/skills/tutorial/{SKILL,vibe-coder,technical,progress-template}.md` -- new files, replace-all surface, lands automatically
17
+ - `.claude/rules/agent-start-here.md` -- replace-all surface, the Project Profile section lands automatically
18
+
19
+ ## Applies to
20
+
21
+ All template-derived projects. There are no surface preconditions -- the new skills do not depend on a particular org-model shape, feature set, or workspace topology. Operations-only projects with no `ui/` will receive `/run-ui` but it will not be useful in that context (no Vite dev server to launch); leaving it installed is harmless.
22
+
23
+ `agent-start-here.md` is replace-all: any project that hand-edited that file will lose those local edits on this sync. Run `git diff .claude/rules/agent-start-here.md` after `/git-sync` and re-apply local customizations if needed -- the template version assumes no project-local changes.
24
+
25
+ ## Required actions
26
+
27
+ 1. Pull template changes with `/git-sync` after this train publishes so the new skills and the `agent-start-here.md` Project Profile section reach the project.
28
+
29
+ 2. Optionally run `/tutorial` to set the project's persona track. The first run asks one gate question (`vibe-coder` vs `technical`) and writes the choice to `.claude/memory/profile.md`. Subsequent runs go straight to the menu. If you skip this, the agent behaves normally and prompts you to consider running `/tutorial` only when relevant.
30
+
31
+ 3. If you want the `/tutorial` row visible in the project's own Slash Commands table, manually add a row to `CLAUDE.md` (project-owned, not overwritten by `/git-sync`):
32
+
33
+ ```
34
+ | `/tutorial` | Guided onboarding -- picks one of two tracks (vibe-coder for non-technical users, technical for developers) and walks through the menu interactively |
35
+ ```
36
+
37
+ 4. If the project hand-edited `.claude/rules/agent-start-here.md` for project-local agent behavior, diff against the new template version and re-apply those edits on top of the new Project Profile section. The replace-all behavior of this file is unchanged from prior trains.
38
+
39
+ 5. Optionally run `/run-ui` at the start of UI work. It is an explicit ask to start the dev server, not an ambient hook -- there is no behavior change unless you invoke it.
40
+
41
+ ## Verification
42
+
43
+ After upgrading:
44
+
45
+ - `.claude/skills/run-ui/SKILL.md` exists and is non-empty.
46
+ - `.claude/skills/tutorial/{SKILL,vibe-coder,technical,progress-template}.md` all exist and are non-empty.
47
+ - `.claude/rules/agent-start-here.md` includes a `## Project Profile` section near the top that references `.claude/memory/profile.md` and the `vibe-coder` / `technical` tracks.
48
+ - Running `/run-ui` from a UI-bearing project either starts Vite on `4300` and reports the URL, or detects a port holder and asks before proceeding.
49
+ - Running `/tutorial` for the first time asks the gate question and writes `.claude/memory/profile.md`. Running it a second time skips the question and shows the menu.
50
+ - For a project that ran `/tutorial`: the agent's tone in subsequent (non-`/tutorial`) responses reflects the chosen track per the tone block in `profile.md`. Vibe-coder track: no technical vocabulary, no slash-command surfacing. Technical track: real paths, code-first, no over-explanation.
51
+
52
+ ## Not handled by /git-sync
53
+
54
+ `/git-sync` does not:
55
+
56
+ - create or update `.claude/memory/profile.md`. The file is created on first `/tutorial` invocation. If a project never runs `/tutorial`, the agent operates as if no profile exists -- normal default behavior.
57
+ - write the new `/tutorial` row into the project's own `CLAUDE.md` Slash Commands table. `CLAUDE.md` is project-owned (verify-only); the row is a manual edit if the project wants it documented.
58
+ - preserve project-local edits to `.claude/rules/agent-start-here.md`. That file is replace-all. Re-apply local customizations after the sync if any exist.
59
+ - run smoke tests for either skill. The `/tutorial` task doc explicitly defers smoke testing to a fresh-scaffold pass; `/run-ui` is exercised on first user invocation, not via sync verification.
@@ -32,16 +32,16 @@ There is no local dev server and no separate staging environment. Deployed resou
32
32
 
33
33
  **Single-package project** (e.g. `external/acme/`): both anchors resolve to the same directory. Invoke from anywhere inside the project tree.
34
34
 
35
- **Multi-package workspace** (e.g. `external/elevasis/` with `operations/` as a sub-package):
35
+ **Multi-package workspace** (e.g. `external/_template/` with `operations/` as a sub-package):
36
36
 
37
37
  ```bash
38
38
  # Invoke from operations/ or any subdir inside it
39
- pnpm -C external/elevasis/operations exec elevasis-sdk deploy
39
+ pnpm -C external/_template/operations exec elevasis-sdk deploy
40
40
 
41
41
  # Both CWDs work identically:
42
- # .elevasis root -> external/elevasis/ (auth / .env)
43
- # package root -> external/elevasis/operations/ (bundle, dist/)
44
- # bundle output -> external/elevasis/operations/dist/bundle.js
42
+ # .elevasis root -> external/_template/ (auth / .env)
43
+ # package root -> external/_template/operations/ (bundle, dist/)
44
+ # bundle output -> external/_template/operations/dist/bundle.js
45
45
  ```
46
46
 
47
47
  Each package in a workspace produces its own `dist/bundle.js` when deployed. Run `elevasis-sdk deploy` from within each package separately.
@@ -222,3 +222,43 @@ export const rolesAndGoalsExample = defineOrganizationModel({
222
222
  ]
223
223
  }
224
224
  })
225
+
226
+ // ---------------------------------------------------------------------------
227
+ // Knowledge nodes
228
+ // ---------------------------------------------------------------------------
229
+ export const knowledgeExample = defineOrganizationModel({
230
+ knowledge: {
231
+ nodes: [
232
+ {
233
+ id: 'knowledge.example-outreach-playbook',
234
+ kind: 'playbook',
235
+ title: 'Example Outreach Playbook',
236
+ summary: 'Step-by-step runbook for launching a cold outreach campaign.',
237
+ body: '## Overview\n\nThis playbook walks through prospect sourcing, message templates, scheduling, and reply triage.\n\n## Steps\n\n1. Source prospects from the lead-gen list.\n2. Personalize the cold email template.\n3. Schedule the sending campaign.\n4. Triage replies in the CRM.',
238
+ links: [{ nodeId: 'feature:sales.crm' }, { nodeId: 'feature:sales.lead-gen' }],
239
+ ownerIds: [],
240
+ updatedAt: '2026-05-01'
241
+ },
242
+ {
243
+ id: 'knowledge.example-icp-strategy',
244
+ kind: 'strategy',
245
+ title: 'Example ICP Strategy',
246
+ summary: 'Describes the ideal customer profile and qualification thresholds.',
247
+ body: '## ICP Profile\n\n- **Industry:** SMB marketing agencies\n- **Size:** 5-50 employees\n- **Region:** North America\n\nProspects scoring \\<60 are excluded from outreach.',
248
+ links: [{ nodeId: 'feature:sales' }],
249
+ ownerIds: [],
250
+ updatedAt: '2026-05-01'
251
+ },
252
+ {
253
+ id: 'knowledge.example-org-model-reference',
254
+ kind: 'reference',
255
+ title: 'Example Organization Model Reference',
256
+ summary: 'Glossary of OM domains and how they relate to features and resources.',
257
+ body: '## Domains\n\nThe organization model splits configuration into typed domains: identity, customers, offerings, roles, goals, techStack, features, statuses, operations, knowledge.',
258
+ links: [],
259
+ ownerIds: [],
260
+ updatedAt: '2026-05-01'
261
+ }
262
+ ]
263
+ }
264
+ })
@@ -87,7 +87,7 @@ The agent adapts its communication based on four independent skill dimensions st
87
87
 
88
88
  Each dimension has its own adaptation rules in the [Interaction Guidance](interaction-guidance.mdx) reference. A user who has deep Zapier experience (automation: low-code) but has never called an API directly (apiIntegration: none) will get credential walkthroughs every time while having automation concepts treated as familiar ground.
89
89
 
90
- `/meta init` runs a 6-question assessment: 3 identity questions, 2 competency questions, and 1 communication preference. Platform Navigation and Automation are assessed directly. API & Integration is inferred from the automation level and tools the user already uses. Domain Expertise is inferred from how specifically the user describes their goals.
90
+ `/tutorial` runs the assessment via a single gate question on first invocation: are you here to build automations by describing what you want, or are you a developer who edits code directly. The choice persists to `.claude/memory/profile.md` and shapes the agent's tone, vocabulary, and tool-call visibility for the entire project, not just inside `/tutorial`. Within the chosen track, lessons adapt further -- senior devs in the technical track can mark Section A items complete to skip them.
91
91
 
92
92
  See [Agent System](agent.mdx) for the full assessment question set, dimensional interaction rules, and communication principles.
93
93
 
@@ -1,222 +1,135 @@
1
1
  ---
2
2
  title: Tutorial System
3
- description: Reference for the SDK tutorial system -- 21-item menu across 4 sections, skill-level adaptation rules, progress tracking format, and per-lesson module contents
3
+ description: The /tutorial skill in the external project scaffold -- two-track onboarding (vibe-coder and technical), gate question, track persistence, and escape hatch
4
4
  ---
5
5
 
6
- The tutorial system is available via the `/tutorial` slash command in Claude Code. It is included in the external template project scaffold.
6
+ The `/tutorial` skill is included in every scaffolded external project. Run it from Claude Code inside a project to start interactive onboarding. It forks into two tracks on first invocation and adapts agent tone project-wide based on your choice.
7
7
 
8
8
  ---
9
9
 
10
- ## Menu System
10
+ ## Getting Started
11
11
 
12
- `/tutorial` always shows the full 21-item menu table on invocation. All items are visible at once with progress indicators. No track gating -- any item is available at any time.
12
+ Open a scaffolded external project in Claude Code and run:
13
13
 
14
14
  ```
15
- Elevasis Tutorial
16
- ==================
17
-
18
- INTRODUCTION 0/4
19
- 1 Welcome & Orientation [ ]
20
- 2 How This Workspace Works [ ]
21
- 3 The /meta Command [ ]
22
- 4 /work and /docs [ ]
23
-
24
- CORE CONCEPTS 0/6
25
- 5 Your First Custom Workflow [ ]
26
- 6 Understanding Data (Schemas) [ ]
27
- 7 Using Platform Tools [ ]
28
- 8 Multi-Step Workflows [ ]
29
- 9 Decision Points [ ]
30
- 10 Going to Production [ ]
31
-
32
- ADVANCED MODULES 0/9
33
- 11 Human-in-the-Loop [ ]
34
- 12 Task Scheduling [ ]
35
- 13 Notification System [ ]
36
- 14 Real-World Integrations [ ]
37
- 15 Error Handling Mastery [ ]
38
- 16 Advanced Workflows [ ]
39
- 17 Resource Composition [ ]
40
- 18 LLM Integration [ ]
41
- 19 AI Agents [ ]
42
-
43
- ADVANCED WORKSPACE 0/2
44
- 20 Rules, Memory, and Customization [ ]
45
- 21 Template Lifecycle [ ]
46
-
47
- Pick a number to start.
15
+ /tutorial
48
16
  ```
49
17
 
50
- **Progress indicators:** `[ ]` not started, `[>]` in progress, `[x] YYYY-MM-DD` complete.
51
-
52
- User picks a number to start or resume any item. `"status"` shows the same table.
18
+ On first invocation in a fresh project, the skill asks one gate question:
53
19
 
54
- ---
20
+ > "Are you here to **build automations by describing what you want** (and I handle the technical side), or are you a **developer** who'll edit code directly?"
55
21
 
56
- ## 4 Sections
22
+ Your answer selects a track. The choice is saved to `.claude/memory/profile.md` and shapes agent vocabulary, tool-call visibility, and verbosity for every conversation in the project -- not just `/tutorial` sessions.
57
23
 
58
- - **INTRODUCTION (1-4):** Welcome + workspace orientation (workspace framework, /meta, /work and /docs) -- taught before building
59
- - **CORE CONCEPTS (5-10):** Orchestration lessons (workflows, schemas, tools, multi-step, conditions, production)
60
- - **ADVANCED MODULES (11-19):** Hands-on feature modules (hitl, schedules, notifications, integrations, error-handling, workflows, composition, llm, agents)
61
- - **ADVANCED WORKSPACE (20-21):** Power-user customization (rules/memory, template lifecycle)
24
+ Subsequent `/tutorial` invocations skip the gate question and resume your progress.
62
25
 
63
26
  ---
64
27
 
65
- ## Skill-Level Adaptation
66
-
67
- Assessed during `/meta init`. Two independent dimensions.
68
-
69
- ### automation dimension
28
+ ## Tracks at a Glance
70
29
 
71
- | Level | Context Loading | Delivery | Verification |
72
- | ---------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | ----------------------------------------------------------------- |
73
- | `none` | Glossary, Workflow overview, Platform Tools Overview only. Skip Zod, Execution Model, Design Decisions. | Agent writes all code. No code shown to user. Analogies throughout. | CLI primary. Agent runs `elevasis-sdk exec` and narrates results. |
74
- | `low-code` | All concept sections. Zapier/Make mapping. `adapters-integration.mdx` / `adapters-platform.mdx` on-demand. | Map to Zapier/Make equivalents. Show code with explanations. | CLI primary. |
75
- | `custom` | All docs listed per-lesson and per-module. | Full technical content, code-first. | CLI primary. |
76
-
77
- ### platformNavigation dimension
78
-
79
- | Level | Behavior |
80
- | ------------- | ---------------------------------------------------------------------------------------------------------------------- |
81
- | `none` | Walk through pages step by step with exact navigation paths. Explain each page before asking user to interact with it. |
82
- | `oriented` | Reference pages by name; briefly remind purpose on first mention. |
83
- | `comfortable` | Reference by name only; focus on advanced filtering and schedule types. |
84
-
85
- **General rules (all levels):** Fast users: acknowledge, offer to skip ahead. Level change observed: note in `skills.md` Growth Log. After lesson/module: update progress file.
86
-
87
- ---
30
+ ### Vibe-Coder Track (8 lessons)
88
31
 
89
- ## Progress Logic
32
+ For users who want to describe what they want and have the agent handle the implementation. The agent never uses technical vocabulary -- no TypeScript, no pnpm, no CLI commands shown, no schemas explained. Everything is narrated in plain language.
90
33
 
91
34
  ```
92
- 1. Read .claude/memory/tutorial-progress.md
93
- 2. Show the full menu table with progress indicators filled in
94
- 3. User picks a number -> start or resume that item directly
95
- 4. After completion: mark done in progress file, show updated menu table
96
- 5. All 21 items complete -> congratulate, suggest docs/ or /work
35
+ Your Tutorial
36
+ ==============
37
+ 1 Welcome -- what this place does for you [ ]
38
+ 2 How to talk to me [ ]
39
+ 3 Your business profile [ ]
40
+ 4 Your first automation [ ]
41
+ 5 Your dashboard -- where everything lives [ ]
42
+ 6 Your approval queue -- signing off on things [ ]
43
+ 7 Changing things later [ ]
44
+ 8 When things go wrong [ ]
45
+
46
+ Pick a number to start.
97
47
  ```
98
48
 
99
- ---
49
+ **What each lesson covers:**
100
50
 
101
- ## Introduction: Items 1-4
51
+ - **1. Welcome** -- Plain analogy for the platform. Shows a real automation already running before any building.
52
+ - **2. How to talk to me** -- Conversation patterns for making requests, asking questions, and describing changes. No technical vocabulary introduced.
53
+ - **3. Your business profile** -- Conversational walk through org identity. Agent handles all edits silently; user answers questions.
54
+ - **4. Your first automation** -- User describes what they want. Agent builds, runs, and narrates. User never sees code.
55
+ - **5. Your dashboard** -- Tour of Command Center. Where automations live and how to read the visual map.
56
+ - **6. Your approval queue** -- Show a pending approval, approve it, see the automation continue.
57
+ - **7. Changing things later** -- Plain-language change requests. Agent handles implementation.
58
+ - **8. When things go wrong** -- "Tell me what looks wrong. I'll figure it out and tell you what I did." No error traces shown.
102
59
 
103
- Items 1-4 orient the user to the platform and workspace before any building.
60
+ **Vocabulary rules in this track:** The agent never says workflow, schema, deploy, credential, TypeScript, or pnpm. "Automation" replaces all SDK resource terms. "Make it live" replaces "deploy." "Account connection" replaces "credential." "Your approval queue" replaces HITL.
104
61
 
105
- **Item 1 -- Welcome & Orientation:** Platform tour, deploy echo workflow, Command Center orientation.
62
+ ### Technical Track (19 lessons, 5 sections)
106
63
 
107
- **Item 2 -- How This Workspace Works:** CLAUDE.md as instruction sheet, four commands, creds skill, memory system overview.
64
+ For developers who will read and edit code directly. Lessons are code-first. All SDK concepts, CLI commands, and file structures are covered.
108
65
 
109
- **Item 3 -- The /meta Command:** Project dashboard, /meta fix, /meta deploy, /meta health.
66
+ ```
67
+ SECTION A -- The workspace (3 items)
68
+ 1 What is this workspace [ ]
69
+ 2 The skill layer -- slash commands you'll use [ ]
70
+ 3 The vibe layer -- ambient intent classification [ ]
71
+
72
+ SECTION B -- Build your first thing (5 items)
73
+ 4 Echo workflow tour [ ]
74
+ 5 Custom workflow with schemas [ ]
75
+ 6 Platform tools and credentials [ ]
76
+ 7 Multi-step and conditionals [ ]
77
+ 8 Going to production [ ]
78
+
79
+ SECTION C -- The Organization Model (3 items)
80
+ 9 /knowledge ceremony -- identity, customers, [ ]
81
+ offerings via the layered flow
82
+ 10 Features and labels [ ]
83
+ 11 Entity extensions -- BaseProject, BaseDeal [ ]
84
+
85
+ SECTION D -- Modules (load on demand) (~6 items)
86
+ 12 HITL [ ]
87
+ 13 Schedules [ ]
88
+ 14 Notifications + integrations [ ]
89
+ 15 Error handling [ ]
90
+ 16 LLM and agents [ ]
91
+ 17 Composition (execution.trigger) [ ]
92
+
93
+ SECTION E -- Power user (2 items)
94
+ 18 Rules, memory, scaffold registry [ ]
95
+ 19 Template lifecycle and /git-sync [ ]
96
+ ```
110
97
 
111
- **Item 4 -- /work and /docs:** Cross-session task tracking, documentation lifecycle, /work vs /docs boundary.
98
+ Section D modules are available any time -- no section order prerequisite. Sections A-C are designed to be completed in order on a first pass, though any item can be picked directly.
112
99
 
113
100
  ---
114
101
 
115
- ## Core Path: Lessons 5-10
116
-
117
- Each lesson: (1) announce title and goal, (2) explain concept per skill level, (3) build or modify something, (4) verify it works, (5) record observations, ask "ready for next?"
118
-
119
- **Lesson 5 -- Your First Custom Workflow**
120
-
121
- - `automation: none` -- "A recipe." Agent writes all code. Agent runs `elevasis-sdk exec` and narrates result.
122
- - `automation: low-code or custom` -- Modify echo workflow. Walk through `config`, `contract`, `steps`, `entryPoint`. Deploy with `elevasis-sdk check` then `elevasis-sdk deploy`.
123
-
124
- **Lesson 6 -- Understanding Data (Schemas)**
125
-
126
- - `automation: none` -- "What information does your automation need?" No Zod, no code shown. Agent reads identity.md goals and writes the schema.
127
- - `automation: low-code` -- "Field mapping like Zapier, but with validation." Show Zod types briefly.
128
- - `automation: custom` -- Full Zod explanation. `z.infer`. Show how schema fields define CLI input structure.
129
-
130
- **Lesson 7 -- Using Platform Tools**
102
+ ## Track Persistence
131
103
 
132
- - `automation: none` -- Agent makes all code edits. Credential creation guided via Command Center UI.
133
- - `automation: low-code or custom` -- Explain adapter pattern: `createAttioAdapter('cred')`. Show singleton pattern: `import { scheduler, llm } from '@elevasis/sdk/worker'`.
104
+ The track choice is saved to `.claude/memory/profile.md` on selection. The agent reads this file at session start alongside `agent-start-here.md`. This means:
134
105
 
135
- **Lesson 8 -- Multi-Step Workflows**
136
-
137
- - `automation: none` -- "Step 1 passes its result to Step 2, like a relay race." Command View is PRIMARY teaching tool.
138
- - `automation: low-code or custom` -- Chain steps with `StepType.LINEAR`. Show relationship edges in Command View.
139
-
140
- **Lesson 9 -- Decision Points**
141
-
142
- - `automation: none` -- "If the customer is VIP, do this -- otherwise, do that." Agent runs both paths. Open Execution Logs.
143
- - `automation: low-code or custom` -- Conditional routing with `StepType.CONDITIONAL`. Show step trace in Execution Logs.
144
-
145
- **Lesson 10 -- Going to Production**
146
-
147
- - `automation: none` -- "Draft vs live." Create Recurring schedule in Task Scheduler.
148
- - `automation: low-code or custom` -- Change `status: dev` -> `prod`. Cover `try/catch`, `ExecutionError`, `PlatformToolError`. CLI monitoring: `elevasis-sdk executions`.
106
+ - Agent vocabulary and tone adjust for every conversation in the project, not just `/tutorial`
107
+ - The vibe-coder track suppresses all technical surface globally until switched
108
+ - Progress is tracked separately in `.claude/memory/tutorial-progress.md`
149
109
 
150
110
  ---
151
111
 
152
- ## Module System: Items 11-19
153
-
154
- Modules are available any time -- no core path prerequisite. After completing a module the full menu table is shown again.
112
+ ## Switching Tracks
155
113
 
156
- | # | Module | Reference Docs | Build | Key Concepts |
157
- | --- | ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
158
- | 11 | `hitl` | `command-center.mdx` (Command Queue) | Approval gate with `approval.create()`. Full lifecycle: trigger -> Command Queue -> approve/reject -> resume. | `approval` adapter, pending state, Command Queue UI |
159
- | 12 | `schedules` | `command-center.mdx` (Task Scheduler) | All three schedule types: Recurring, Relative, Absolute. `scheduler` adapter for in-workflow. | Cron syntax, schedule types, Task Scheduler UI |
160
- | 13 | `notifications` | `adapters-platform.mdx` (notifications, email) | Notification + email steps. Alerts on completion. | `notifications` singleton, `email` singleton |
161
- | 14 | `integrations` | `platform-tools/index.mdx` (Credential Security), `adapters-integration.mdx` | Real adapter from `identity.md`. Full end-to-end with OAuth or API key credential. | Adapter pattern, credential scoping, external call error handling |
162
- | 15 | `error-handling` | `patterns.mdx` (error handling), `troubleshooting.mdx` | Workflow demonstrating all three error types. `try/catch`, `context.logger`, recovery. | `ExecutionError`, `PlatformToolError`, `ToolingError` |
163
- | 16 | `workflows` | `patterns.mdx` (store, logging, organization) | Refactor with `context.store`, `context.logger`, domain directories. Advanced schema patterns. | `context.store`, `context.logger`, schema depth |
164
- | 17 | `composition` | `command-center.mdx` (Command View), `patterns.mdx` | Two workflows: first triggers second with `execution.trigger()`. Declare relationship. | `execution.trigger`, relationship declarations, Command View edges |
165
- | 18 | `llm` | `adapters-platform.mdx` (llm singleton) | `llm.generate()` with structured output. Model selection and temperature. | `llm` singleton, structured output, temperature |
166
- | 19 | `agents` | `framework/agent.mdx` | Agent definition with tools. LLM tool calling. Agent vs workflow comparison. | Agent definition, tool registration, execution trace |
114
+ Run `/tutorial switch` at any time to flip tracks and restart the menu. Progress from the previous track is preserved in the progress file for reference but the active lesson resets.
167
115
 
168
116
  ---
169
117
 
170
- ## Advanced Workspace: Items 20-21
118
+ ## Progress Indicators
171
119
 
172
- **Item 20 -- Rules, Memory, and Customization**
120
+ The menu uses three states:
173
121
 
174
- - `none` -- "Sticky notes the agent reads automatically." Show `.claude/rules/workspace-patterns.md` without technical detail.
175
- - `low-code` -- Show `.claude/rules/` directory. Explain MANAGED (`sdk-patterns.md`) vs INIT_ONLY (`workspace-patterns.md`). Explain error promotion: 3+ recurrences -> add a rule.
176
- - `custom` -- Read both rules files. Walk through memory layout: `index.md`, `profile/`, `errors/`, `tutorial-progress.md`. Walk through adding a new rule.
122
+ - `[ ]` -- not started
123
+ - `[>]` -- in progress
124
+ - `[x] YYYY-MM-DD` -- complete
177
125
 
178
- **Item 21 -- Template Lifecycle**
179
-
180
- - `none` -- "SDK releases automatically update your workspace." Explain `/meta fix` as the update command.
181
- - `low-code` -- Explain MANAGED vs INIT_ONLY file types. Show how `/meta fix` handles conflicts.
182
- - `custom` -- Full template lifecycle: the external template handles initial project creation. `/meta fix` performs drift repair and SDK upgrade. Conflict resolution merges current files against the template, preserving customizations in INIT_ONLY files.
126
+ Run `/tutorial` with no argument at any time to see the current menu with progress filled in. Run `/tutorial status` for the same view.
183
127
 
184
128
  ---
185
129
 
186
- ## Progress File Format
187
-
188
- Stored at `.claude/memory/tutorial-progress.md`.
189
-
190
- ```markdown
191
- # Tutorial Progress
192
-
193
- Current: <free-form, e.g. "4: /work and /docs" or "M:integrations">
194
- Started: YYYY-MM-DD
195
- Last Session: YYYY-MM-DD
196
-
197
- ## Completed Lessons
198
-
199
- | Item | Title | Completed | Duration |
200
- | --- | --- | --- | --- |
201
- | 1 | Welcome & Orientation | 2026-03-01 | 25 min |
202
-
203
- ## Completed Modules
204
-
205
- | Module | Title | Completed | Duration |
206
- | --- | --- | --- | --- |
207
- | hitl | Human-in-the-Loop | 2026-03-03 | 40 min |
208
-
209
- ## Capability Observations
210
-
211
- | Source | Observation |
212
- | --- | --- |
213
- | 1 | Navigated Command View without guidance |
214
-
215
- ## Assessment Notes
216
-
217
- - Strong automation background, slow on TypeScript syntax
218
- ```
219
-
220
- ---
130
+ ## Related Docs
221
131
 
222
- **Last Updated:** 2026-03-05
132
+ - [SDK Concepts](../concepts.mdx) -- full technical reference for workflows, schemas, adapters, and the org model
133
+ - [Getting Started](../getting-started.mdx) -- scaffold setup and first deploy
134
+ - [CLI Reference](../cli.mdx) -- `elevasis-sdk` commands referenced in the technical track
135
+ - [Framework Overview](index.mdx) -- skill layer, memory system, and interaction guidance