@jskit-ai/agent-docs 0.1.20 → 0.1.21

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.
@@ -1030,6 +1030,14 @@ npx jskit app verify-ui \
1030
1030
  --auth-mode dev-auth-login-as
1031
1031
  ```
1032
1032
 
1033
+ For local pre-merge review, the next step after recording that Playwright run is usually:
1034
+
1035
+ ```bash
1036
+ npx jskit doctor --against origin/main
1037
+ ```
1038
+
1039
+ Advanced CI pipelines can use the same `--against` contract too, but JSKIT does not scaffold hosted auth/database/browser verification by default.
1040
+
1033
1041
  That flow is preferable to driving the real sign-in form in feature tests because it keeps the test focused on the UI feature being added, not on an external auth dependency. If a chunk changes user-facing UI and the flow requires login, the expected JSKIT review standard is:
1034
1042
 
1035
1043
  - use Playwright
@@ -151,6 +151,8 @@ That matters because JSKIT maintenance policy changes over time. If the scaffold
151
151
 
152
152
  `jskit app verify` is worth noticing specifically. Linting, tests, and builds check your source code and runtime behavior. The JSKIT part of that flow runs `doctor`, which checks JSKIT-managed app state: installed package visibility, lock-file-backed managed files, and other JSKIT-specific health rules. It is there because a JSKIT app is not only code. It is also a descriptor-driven managed project.
153
153
 
154
+ The starter scaffold also writes `.github/workflows/verify.yml`. That workflow stays intentionally small: it runs `npm run verify` for the normal GitHub Actions gate and leaves browser/auth/database-heavy review flows to app-specific local or CI setups. The `--against <base-ref>` review mode exists in the CLI for local pre-merge checks and for advanced CI pipelines, but it is not assumed by the starter scaffold.
155
+
154
156
  The surface-specific script names are also worth noticing early, even in this tiny app. `dev:home`, `server:home`, and `build:home` are the first concrete places where surface selection shows up in the scaffold. They work by setting `VITE_SURFACE=home` on the client side and `SERVER_SURFACE=home` on the server side. In this first chapter, where `home` is the only surface, those variants behave almost the same as the default commands. Later, once more surfaces exist, those scripts become the simplest way to run or build just one surface at a time.
155
157
 
156
158
  ### App surfaces in JSKIT
@@ -0,0 +1,214 @@
1
+ <!-- Generated by `npm run agent-docs:build` from `packages/agent-docs/site/guide/app-setup/quickstart.md`. Do not edit manually. -->
2
+
3
+ ---
4
+ title: Quickstart
5
+ description: The fastest path to a real JSKIT app, plus the first page-extension patterns you will usually need.
6
+ ---
7
+
8
+ # Quickstart
9
+
10
+ This chapter is the fastest reproducible path to a real JSKIT app.
11
+
12
+ The base flow below gives you:
13
+
14
+ - personal workspaces
15
+ - users
16
+ - console
17
+ - MySQL
18
+ - Supabase auth
19
+ - one `admin` assistant configured from `console`
20
+
21
+ It also shows the first page-extension moves most apps need:
22
+
23
+ - add two workspace settings pages
24
+ - make one of them the default landing page
25
+ - add a page to the admin cog
26
+ - add a normal left-menu page
27
+ - inspect placement destinations and understand why some links are inferred automatically
28
+
29
+ ## Step 1: Create the app
30
+
31
+ Set these values first:
32
+
33
+ ```bash
34
+ OPENAI_API_KEY=...
35
+ SUPABASE_URL=...
36
+ SUPABASE_KEY=...
37
+ DB_HOST=127.0.0.1
38
+ DB_PORT=3306
39
+ DB_NAME=testapp
40
+ DB_USER=...
41
+ DB_PASSWORD=...
42
+ ```
43
+
44
+ Then run the exact sequence below:
45
+
46
+ ```bash
47
+ npx @jskit-ai/create-app testapp --tenancy-mode personal
48
+ cd testapp
49
+ npm install
50
+
51
+ npx jskit add package shell-web
52
+
53
+ npx jskit add package auth-provider-supabase-core \
54
+ --auth-supabase-url "$SUPABASE_URL" \
55
+ --auth-supabase-publishable-key "$SUPABASE_KEY" \
56
+ --app-public-url "http://localhost:5173"
57
+
58
+ npx jskit add bundle auth-base
59
+
60
+ npx jskit add package database-runtime-mysql \
61
+ --db-host "$DB_HOST" \
62
+ --db-port "$DB_PORT" \
63
+ --db-name "$DB_NAME" \
64
+ --db-user "$DB_USER" \
65
+ --db-password "$DB_PASSWORD"
66
+
67
+ npx jskit add package users-web
68
+ npx jskit add package console-web
69
+ npx jskit add package workspaces-core
70
+ npx jskit add package workspaces-web
71
+
72
+ npx jskit generate assistant setup \
73
+ --surface admin \
74
+ --settings-surface console \
75
+ --config-scope global \
76
+ --ai-provider openai \
77
+ --ai-api-key "$OPENAI_API_KEY"
78
+
79
+ npx jskit generate assistant page \
80
+ w/[workspaceSlug]/admin/assistant/index.vue \
81
+ --name "Assistant"
82
+
83
+ npx jskit generate assistant settings-page \
84
+ console/settings/admin-assistant/index.vue \
85
+ --surface admin \
86
+ --name "Admin Assistant" \
87
+ --link-placement console-settings:primary-menu \
88
+ --link-component-token local.main.ui.surface-aware-menu-link-item
89
+
90
+ npm install
91
+ npm run db:migrate
92
+ ```
93
+
94
+ At this point you have:
95
+
96
+ - a workspace-enabled app with `tenancyMode = "personal"`
97
+ - an `admin` assistant at `/w/[workspaceSlug]/admin/assistant`
98
+ - an assistant settings page at `/console/settings/admin-assistant`
99
+
100
+ ## Step 2: Add two workspace settings pages
101
+
102
+ Generate two child pages under the workspace settings host:
103
+
104
+ ```bash
105
+ npx jskit generate ui-generator page \
106
+ w/[workspaceSlug]/admin/workspace/settings/billing/index.vue \
107
+ --name "Billing"
108
+
109
+ npx jskit generate ui-generator page \
110
+ w/[workspaceSlug]/admin/workspace/settings/branding/index.vue \
111
+ --name "Branding"
112
+ ```
113
+
114
+ These commands create:
115
+
116
+ - `src/pages/w/[workspaceSlug]/admin/workspace/settings/billing/index.vue`
117
+ - `src/pages/w/[workspaceSlug]/admin/workspace/settings/branding/index.vue`
118
+
119
+ They also append matching menu entries into `src/placement.js`.
120
+
121
+ ## Step 3: Make one settings page the default
122
+
123
+ Best practice is to make the default child explicit.
124
+
125
+ Edit:
126
+
127
+ ```text
128
+ src/pages/w/[workspaceSlug]/admin/workspace/settings/index.vue
129
+ ```
130
+
131
+ and replace its contents with:
132
+
133
+ ```vue
134
+ <script setup>
135
+ import { redirectToChild } from "@jskit-ai/kernel/client/pageRedirects";
136
+
137
+ definePage({
138
+ redirect: redirectToChild("billing")
139
+ });
140
+ </script>
141
+ ```
142
+
143
+ That makes `/w/[workspaceSlug]/admin/workspace/settings` land on `/w/[workspaceSlug]/admin/workspace/settings/billing`.
144
+
145
+ Use this explicit redirect pattern instead of trying to infer the default child from placement order or “the first generated page”.
146
+
147
+ ## Step 4: Add a page to the admin cog
148
+
149
+ First list the available placement destinations:
150
+
151
+ ```bash
152
+ npx jskit list-placements
153
+ ```
154
+
155
+ In a workspace-enabled app, that output includes `admin-cog:primary-menu`.
156
+
157
+ Then generate the page:
158
+
159
+ ```bash
160
+ npx jskit generate ui-generator page \
161
+ w/[workspaceSlug]/admin/catalogue/index.vue \
162
+ --name "Catalogue" \
163
+ --link-placement admin-cog:primary-menu
164
+ ```
165
+
166
+ `--link-placement` is necessary here because this is just a normal `admin` page. It is not a child page under a local route host that already owns a nested outlet.
167
+
168
+ ## Step 5: Add a normal left-menu page
169
+
170
+ Generate a normal `admin` page without an explicit placement:
171
+
172
+ ```bash
173
+ npx jskit generate ui-generator page \
174
+ w/[workspaceSlug]/admin/reports/index.vue \
175
+ --name "Reports"
176
+ ```
177
+
178
+ Because this page is not under a more specific local host, JSKIT falls back to the app's default shell menu outlet. In practice, that means a normal left-menu entry.
179
+
180
+ ## Step 6: Understand the placement "magic"
181
+
182
+ The workspace settings pages in Step 2 auto-linked into the settings menu for two reasons:
183
+
184
+ 1. The parent host already exposes a named outlet:
185
+
186
+ ```vue
187
+ <ShellOutlet
188
+ target="admin-settings:primary-menu"
189
+ default-link-component-token="local.main.ui.surface-aware-menu-link-item"
190
+ />
191
+ ```
192
+
193
+ 2. Your generated pages live under that host route:
194
+
195
+ ```text
196
+ w/[workspaceSlug]/admin/workspace/settings/...
197
+ ```
198
+
199
+ So JSKIT can infer both:
200
+
201
+ - the placement target: `admin-settings:primary-menu`
202
+ - the default link renderer: `local.main.ui.surface-aware-menu-link-item`
203
+
204
+ That is why the simple settings-page commands do not need `--link-placement` or `--link-component-token`.
205
+
206
+ The admin cog example is different. `w/[workspaceSlug]/admin/catalogue/index.vue` is just a normal admin page, so there is no local nested outlet to infer. That is why you must pass `--link-placement admin-cog:primary-menu` there.
207
+
208
+ If you want a little more context than the raw destination list, this is also useful:
209
+
210
+ ```bash
211
+ npx jskit show @jskit-ai/workspaces-web --details
212
+ ```
213
+
214
+ That output shows both the workspace-owned placement outlets and the default entries already targeting them.
@@ -80,6 +80,8 @@ This gives you a clean ownership split:
80
80
 
81
81
  That split is worth keeping in mind through the rest of the guide. When you see `npm run verify`, that is now shorthand for "run the app's JSKIT baseline verification policy, then any app-specific extra verification hook".
82
82
 
83
+ The starter scaffold also includes `.github/workflows/verify.yml`. That workflow is intentionally conservative: it runs `npm run verify` and does not assume that every app can stand up full browser, auth, seed-data, and database verification inside hosted CI.
84
+
83
85
  If your app uses a non-default npm registry for JSKIT packages, pass it to the maintained CLI command rather than hard-coding it in the scaffold. For example:
84
86
 
85
87
  ```bash
@@ -747,6 +749,20 @@ That command does two things:
747
749
 
748
750
  `doctor` then compares the current changed UI files to that receipt. If you edit the UI again afterwards, the receipt is stale and `doctor` tells you to rerun `jskit app verify-ui`.
749
751
 
752
+ For local pre-merge review, use `--against <base-ref>` so JSKIT compares against the branch delta instead of only the current dirty worktree. The common shape is:
753
+
754
+ ```bash
755
+ npx jskit doctor --against origin/main
756
+ ```
757
+
758
+ If the UI changed, the normal local sequence is:
759
+
760
+ 1. run the targeted Playwright flow locally
761
+ 2. record it with `jskit app verify-ui ...`
762
+ 3. run `jskit doctor --against <base-ref>`
763
+
764
+ Advanced CI pipelines can also use `--against <base-ref>`, but that is intentionally app-specific. JSKIT does not scaffold hosted browser/auth/database verification by default, because many real apps need secrets, seeded databases, local auth bypass, or environment-specific bootstrap paths that do not belong in a one-size-fits-all template.
765
+
750
766
  ### Why `--json` exists
751
767
 
752
768
  If you want machine-readable output, use:
@@ -4,12 +4,13 @@
4
4
 
5
5
  This guide is the main hands-on path through JSKIT.
6
6
 
7
- It starts with the smallest scaffold, then explains how to work with the JSKIT CLI itself before adding the shell and authentication. After that, it introduces the database-backed users layer, expands into console and workspace-aware app structure, and adds a small `App extras` section for optional runtime packages such as realtime and assistant. Finally, the guide breaks out generator-specific workflows into their own section.
7
+ It now starts with a fast reproducible Quickstart, then steps back to the smaller scaffold-first chapters that explain how the app is assembled piece by piece. After that, it introduces the database-backed users layer, expands into console and workspace-aware app structure, and adds a small `App extras` section for optional runtime packages such as realtime and assistant. Finally, the guide breaks out generator-specific workflows into their own section.
8
8
 
9
9
  ## Table of Contents
10
10
 
11
11
  ### App Setup
12
12
 
13
+ - [Quickstart](/guide/app-setup/quickstart)
13
14
  - [Initial Scaffolding](/guide/app-setup/initial-scaffolding)
14
15
  - [Working With The JSKIT CLI](/guide/app-setup/working-with-the-jskit-cli)
15
16
  - [A More Interesting Shell](/guide/app-setup/a-more-interesting-shell)
@@ -33,7 +34,8 @@ It starts with the smallest scaffold, then explains how to work with the JSKIT C
33
34
 
34
35
  ## How to use this guide
35
36
 
36
- - Start with `App Setup` if you are building up a JSKIT app from scratch.
37
+ - Start with `Quickstart` if you want the fastest route to a real workspace-enabled app and the first page-extension patterns.
38
+ - Start with the rest of `App Setup` if you want to understand the base scaffold layer by layer.
37
39
  - Use `App Extras` once the base app structure is in place and you want optional runtime packages.
38
40
  - Jump into `Generators` if you already understand the runtime packages and want app-owned scaffolding workflows.
39
41
  - Inside `Generators`, read `CRUD Generators` before `Advanced CRUDs`: the first chapter teaches the workflow, and the second explains the generated anatomy and customization points.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/agent-docs",
3
- "version": "0.1.20",
3
+ "version": "0.1.21",
4
4
  "description": "Distributed JSKIT agent workflows, guides, and generated reference maps.",
5
5
  "type": "module",
6
6
  "files": [
@@ -12,6 +12,8 @@ Rules:
12
12
  - Any chunk that adds or changes user-facing UI must include a Playwright flow that exercises the changed behavior before the chunk is done.
13
13
  - Record that Playwright run with `jskit app verify-ui --command "<playwright command>" --feature "<label>" --auth-mode <mode>`.
14
14
  - `jskit doctor` expects `.jskit/verification/ui.json` to match the current dirty UI file set when UI files are changed.
15
+ - For local pre-merge review, follow the recorded Playwright run with `jskit doctor --against <base-ref>` so `doctor` compares against the branch delta instead of only the local dirty worktree.
16
+ - Advanced CI setups may also use `--against <base-ref>`, but JSKIT does not scaffold hosted browser/auth/database verification by default.
15
17
  - Do not rely on a live external auth provider for Playwright verification of normal app features.
16
18
  - For authenticated UI in the standard JSKIT auth stack, use the development-only dev auth bypass route instead.
17
19
  - The standard route is `POST /api/dev-auth/login-as`.
@@ -31,6 +33,12 @@ npx jskit app verify-ui \
31
33
  --auth-mode dev-auth-login-as
32
34
  ```
33
35
 
36
+ Local pre-merge follow-up:
37
+
38
+ ```bash
39
+ npx jskit doctor --against origin/main
40
+ ```
41
+
34
42
  The Playwright command itself should follow this setup shape when login is needed:
35
43
 
36
44
  ```ts
@@ -190,6 +190,12 @@ Local functions
190
190
  - `cloneProfile(profile)`
191
191
  - `createEmailConflictError()`
192
192
 
193
+ ### `src/server/lib/supabaseClientOptions.js`
194
+ Exports
195
+ - `buildSupabaseServerClientOptions(options = {})`
196
+ Local functions
197
+ - `resolveRealtimeTransport({ nativeWebSocket = globalThis.WebSocket, fallbackTransport = WebSocket } = {})`
198
+
193
199
  ### `src/server/lib/test-utils.js`
194
200
  Exports
195
201
  - `createAccountFlows`
@@ -701,7 +701,8 @@ Exports
701
701
  - `isUiVerificationPath(relativePath = "")`
702
702
  - `isValidUiVerificationReceipt(receipt)`
703
703
  - `normalizeUiVerificationReceipt(rawReceipt = {})`
704
- - `resolveChangedUiFilesFromGit(appRoot = "")`
704
+ - `resolveChangedPathsFromGit(appRoot = "", { against = "", pathspecs = ["src", "packages"] } = {})`
705
+ - `resolveChangedUiFilesFromGit(appRoot = "", { against = "" } = {})`
705
706
  - `sortUniqueStrings(values = [])`
706
707
  Local functions
707
708
  - `normalizeText(value = "")`
@@ -73,7 +73,7 @@ Core rules:
73
73
  - For CRUD chunks, ask the developer which operations are allowed, which fields belong in the list view if one exists, and the intended look of the view and edit/new forms before generating code.
74
74
  - Every user-facing screen must pass a Material Design and Vuetify quality review before the chunk is considered done.
75
75
  - Any chunk that adds or changes user-facing UI must include a Playwright check that exercises the changed behavior before the chunk is considered done.
76
- - Record that Playwright run with `jskit app verify-ui --command "<playwright command>" --feature "<label>" --auth-mode <mode>` so `jskit doctor` can verify the receipt.
76
+ - Record that Playwright run with `jskit app verify-ui --command "<playwright command>" --feature "<label>" --auth-mode <mode>` so `jskit doctor` can verify the receipt. For local pre-merge review, normally follow it with `jskit doctor --against <base-ref>`. Advanced CI setups may also use `--against <base-ref>`, but that is app-specific.
77
77
  - If the UI flow requires login, use the app's development-only auth bypass or session bootstrap path instead of a live external auth login flow.
78
78
  - In JSKIT apps using the standard auth stack, that means enabling the dev auth bypass in development and using `POST /api/dev-auth/login-as` during Playwright setup.
79
79
  - If authenticated UI work has no usable local auth bootstrap path yet, treat that as a testability gap and call it out before the chunk can be considered complete.
@@ -62,6 +62,8 @@ Playwright note:
62
62
 
63
63
  - When login is required, use a test-only auth bypass or session bootstrap path instead of dependence on a live external auth provider.
64
64
  - Record the run through `jskit app verify-ui --command "<playwright command>" --feature "<label>" --auth-mode <mode>` so `jskit doctor` can verify the receipt against the current changed UI files.
65
+ - In local pre-merge review, use `jskit doctor --against <base-ref>` after the recorded Playwright run so JSKIT compares against the branch delta, not only the current dirty worktree.
66
+ - Advanced CI setups may also use `--against <base-ref>`, but JSKIT does not scaffold hosted browser/auth/database verification by default.
65
67
  - In the standard JSKIT auth stack, the default development path is `POST /api/dev-auth/login-as`, guarded by `AUTH_DEV_BYPASS_ENABLED=true` and `AUTH_DEV_BYPASS_SECRET=...`.
66
68
  - That route is development-only and must not be enabled in production.
67
69
  - Because it is still an unsafe POST, fetch `csrfToken` from `/api/session`, send it as the `csrf-token` header, and make the request in the same browser context that will run the Playwright assertions so the session cookies land in the page session.
@@ -33,6 +33,7 @@ Before calling a chunk or a whole changeset done, review it in four passes:
33
33
  - run the widest relevant verification commands for a whole changeset
34
34
  - any added or changed user-facing UI must be exercised with Playwright
35
35
  - that Playwright run should normally be recorded through `jskit app verify-ui`
36
+ - for local pre-merge review, prefer following that receipt with `jskit doctor --against <base-ref>`
36
37
  - if login is required, use the chosen local test-auth path instead of live external auth
37
38
  - in the standard JSKIT auth stack, prefer the development-only `POST /api/dev-auth/login-as` path
38
39
  - if there is no usable local auth bootstrap path, explicitly record that as a blocking testability gap