@jskit-ai/agent-docs 0.1.2 → 0.1.4

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 (45) hide show
  1. package/DISTR_AGENT.md +20 -3
  2. package/guide/agent/app-extras/assistant.md +1 -1
  3. package/guide/agent/app-extras/realtime.md +1 -1
  4. package/guide/agent/app-setup/a-more-interesting-shell.md +1 -1
  5. package/guide/agent/app-setup/authentication.md +9 -1
  6. package/guide/agent/app-setup/console.md +1 -1
  7. package/guide/agent/app-setup/database-layer.md +1 -1
  8. package/guide/agent/app-setup/initial-scaffolding.md +22 -5
  9. package/guide/agent/app-setup/multi-homing.md +3 -1
  10. package/guide/agent/app-setup/users.md +1 -1
  11. package/guide/agent/app-setup/working-with-the-jskit-cli.md +54 -2
  12. package/guide/agent/generators/advanced-cruds.md +163 -1
  13. package/guide/agent/generators/crud-generators.md +30 -1
  14. package/guide/agent/generators/intro.md +1 -1
  15. package/guide/agent/generators/ui-generators.md +1 -1
  16. package/guide/agent/index.md +1 -1
  17. package/package.json +2 -1
  18. package/reference/autogen/packages/agent-docs.md +18 -0
  19. package/reference/autogen/tooling/jskit-cli.md +61 -0
  20. package/skills/jskit-review/SKILL.md +94 -0
  21. package/skills/jskit-review/agents/openai.yaml +4 -0
  22. package/templates/APP_BLUEPRINT.md +23 -0
  23. package/templates/WORKBOARD.md +46 -0
  24. package/templates/app/AGENTS.md +28 -3
  25. package/workflow/app-state.md +2 -1
  26. package/workflow/bootstrap.md +38 -3
  27. package/workflow/feature-delivery.md +49 -7
  28. package/workflow/review.md +33 -8
  29. package/workflow/scoping.md +24 -3
  30. package/workflow/workboard.md +29 -0
  31. package/guide/human/app-extras/assistant.md +0 -695
  32. package/guide/human/app-extras/realtime.md +0 -270
  33. package/guide/human/app-setup/a-more-interesting-shell.md +0 -734
  34. package/guide/human/app-setup/authentication.md +0 -963
  35. package/guide/human/app-setup/console.md +0 -352
  36. package/guide/human/app-setup/database-layer.md +0 -822
  37. package/guide/human/app-setup/initial-scaffolding.md +0 -738
  38. package/guide/human/app-setup/multi-homing.md +0 -795
  39. package/guide/human/app-setup/users.md +0 -404
  40. package/guide/human/app-setup/working-with-the-jskit-cli.md +0 -997
  41. package/guide/human/generators/advanced-cruds.md +0 -923
  42. package/guide/human/generators/crud-generators.md +0 -556
  43. package/guide/human/generators/intro.md +0 -109
  44. package/guide/human/generators/ui-generators.md +0 -665
  45. package/guide/human/index.md +0 -39
@@ -1,270 +0,0 @@
1
- <!-- Generated by `npm run agent-docs:build` from `docs/guide/app-extras/realtime.md`. Do not edit manually. -->
2
-
3
- # Realtime
4
-
5
- At the end of the previous chapter, the app already had a real shell, authenticated users, operator tooling, and workspace-aware routing. What it still did not have was a live transport for pushing updates into that shell.
6
-
7
- This chapter installs `realtime`, which adds JSKIT's socket.io runtime, Vite websocket proxy wiring, and a small connection indicator in the shell.
8
-
9
- This package is a good example of an "extra" rather than a new structural layer. It does not create new surfaces and it does not generate new pages. Instead, it plugs live behavior into things the guide has already scaffolded.
10
-
11
- ## Recap from previous chapters
12
-
13
- To get back to the same starting point as the end of the previous chapter, run:
14
-
15
- ```bash
16
- SUPABASE_URL=...
17
- SUPABASE_KEY=...
18
- DB_HOST=127.0.0.1
19
- DB_PORT=3306
20
- DB_NAME=exampleapp
21
- DB_USER=exampleapp
22
- DB_PASSWORD=secret
23
-
24
- npx @jskit-ai/create-app exampleapp --tenancy-mode personal
25
- cd exampleapp
26
- npm install
27
-
28
- npx jskit add package shell-web
29
- npx jskit add package auth-provider-supabase-core \
30
- --auth-supabase-url "$SUPABASE_URL" \
31
- --auth-supabase-publishable-key "$SUPABASE_KEY" \
32
- --app-public-url "http://localhost:5173"
33
- npx jskit add bundle auth-base
34
- npx jskit add package database-runtime-mysql \
35
- --db-host "$DB_HOST" \
36
- --db-port "$DB_PORT" \
37
- --db-name "$DB_NAME" \
38
- --db-user "$DB_USER" \
39
- --db-password "$DB_PASSWORD"
40
- npx jskit add package users-web
41
- npx jskit add package console-web
42
- npx jskit add package workspaces-core
43
- npx jskit add package workspaces-web
44
- npm install
45
- npm run db:migrate
46
- ```
47
-
48
- If you are already continuing from the previous chapter, you are already in the right place and can skip that setup.
49
-
50
- <DocsTerminalTip label="Redis" title="Empty Is Fine Locally">
51
- `realtime` writes `REALTIME_REDIS_URL` into `.env`, but leaving it empty is a perfectly normal local setup.
52
-
53
- With no Redis URL, the package uses the in-memory socket adapter inside your single local Node process. That is enough for local development and for small single-instance deployments.
54
-
55
- You only need to set `REALTIME_REDIS_URL` when you want several server instances to share socket events through Redis.
56
- </DocsTerminalTip>
57
-
58
- ## Installing `realtime`
59
-
60
- From inside `exampleapp`, run:
61
-
62
- ```bash
63
- npx jskit add package realtime
64
- npm install
65
- ```
66
-
67
- The first command records the runtime package in the app and updates the existing scaffold. The second command downloads the new dependencies, especially `socket.io`, `socket.io-client`, and the optional Redis adapter pieces.
68
-
69
- Unlike the database, users, console, and workspace chapters, this one does **not** need `npm run db:migrate`. `realtime` does not add schema files. It is transport infrastructure, not persistence.
70
-
71
- ## What changes now
72
-
73
- Installing `realtime` changes the app in three important ways.
74
-
75
- ### The app gets a realtime transport
76
-
77
- The server now mounts a socket.io runtime on the same Fastify server that already serves your JSKIT surfaces. The browser gets a matching socket.io client runtime through the normal client boot process.
78
-
79
- That means later modules, or your own app code, can stop thinking only in terms of request/response HTTP flows. They can start publishing live events and listening for them in Vue.
80
-
81
- ### The shell gets a connection indicator
82
-
83
- The package also uses the shell scaffolding that already exists.
84
-
85
- `realtime` appends a placement entry into `src/placement.js` that targets `shell-layout:top-right`, so the shell starts showing a small status dot without you having to create a new page for it.
86
-
87
- That dot is:
88
-
89
- - green when the realtime socket is connected
90
- - red when the socket is disconnected or still reconnecting
91
-
92
- So the first visible value of the package is not a whole new screen. It is a tiny live status element plugged straight into the existing shell.
93
-
94
- ### Vite starts proxying websocket traffic too
95
-
96
- The app already had a browser dev server on `5173` and a backend runtime on `3000`.
97
-
98
- `realtime` extends that setup by writing a websocket proxy entry into `.jskit/vite.dev.proxy.json` for `/socket.io`. That matters because the browser should still talk to the frontend dev server on `5173`, while Vite quietly forwards websocket traffic to the backend runtime on `3000`.
99
-
100
- So one of the main values of this package is that you do **not** have to hand-edit Vite config just to make socket.io work in local development.
101
-
102
- ### There are still no new pages
103
-
104
- This is worth saying clearly because it can otherwise feel surprising.
105
-
106
- After installing `realtime`:
107
-
108
- - there is still no `/realtime` page
109
- - there is still no new surface
110
- - there is still no app-owned `src/pages/...` scaffold
111
-
112
- That is intentional. `realtime` is infrastructure. It makes the existing shell and later runtime packages live-capable instead of giving the app a new section of its own.
113
-
114
- ## What to look at in the browser
115
-
116
- Start both processes again:
117
-
118
- ```bash
119
- npm run dev
120
- npm run server
121
- ```
122
-
123
- Then open `http://localhost:5173/home`.
124
-
125
- The important visible change is in the top-right of the shell. You should now see the realtime status dot alongside the other shell controls.
126
-
127
- If the websocket connects successfully, the dot is green. If the backend is unavailable or the socket is reconnecting, the dot is red. Hovering it shows the current status text.
128
-
129
- That small change is the whole point of this chapter's browser check: the package is already active even though it did not create a page of its own.
130
-
131
- ## Using the client runtime
132
-
133
- The connection indicator is useful, but the real reason to install `realtime` is to let client code subscribe to live events.
134
-
135
- The smallest client-side example looks like this:
136
-
137
- ```vue
138
- <script setup>
139
- import { ref } from "vue";
140
- import { useRealtimeEvent } from "@jskit-ai/realtime/client/composables/useRealtimeEvent";
141
-
142
- const lastEvent = ref("Nothing received yet.");
143
-
144
- useRealtimeEvent({
145
- event: "demo.ping",
146
- onEvent({ payload }) {
147
- lastEvent.value = JSON.stringify(payload);
148
- }
149
- });
150
- </script>
151
-
152
- <template>
153
- <p>{{ lastEvent }}</p>
154
- </template>
155
- ```
156
-
157
- That composable does not create any server-side events by itself. It only subscribes the component to the client socket.
158
-
159
- The important pieces are:
160
-
161
- - `event`
162
- - the event name to listen for
163
- - if you omit it, the composable listens to `*`
164
- - `onEvent`
165
- - the handler that receives `{ event, payload, socket }`
166
- - `matches`
167
- - an optional predicate if you want to filter events before the handler runs
168
-
169
- So the mental model is:
170
-
171
- - `realtime` gives the app a live transport
172
- - your own app code, or later packages, decide which events should travel across it
173
-
174
- ## What `realtime` adds to the app
175
-
176
- This chapter is small enough that it is worth looking directly at the app-owned files it changes.
177
-
178
- ### `.env` gains the Redis adapter setting
179
-
180
- The install writes:
181
-
182
- ```dotenv
183
- REALTIME_REDIS_URL=
184
- ```
185
-
186
- That empty value is deliberate. It means the app can start with the in-memory adapter locally, and you can fill in a real Redis URL later if you need cross-instance fan-out.
187
-
188
- ### `.jskit/vite.dev.proxy.json` gains a websocket proxy entry
189
-
190
- After the install, the app has:
191
-
192
- ```json
193
- {
194
- "version": 1,
195
- "entries": [
196
- {
197
- "packageId": "@jskit-ai/realtime",
198
- "id": "realtime-socket-io",
199
- "path": "/socket.io",
200
- "changeOrigin": true,
201
- "ws": true
202
- }
203
- ]
204
- }
205
- ```
206
-
207
- That one entry is what lets the browser dev server proxy websocket traffic correctly during local development.
208
-
209
- ### `src/placement.js` grows one new shell placement
210
-
211
- The package appends this placement:
212
-
213
- ```js
214
- addPlacement({
215
- id: "realtime.connection.indicator",
216
- target: "shell-layout:top-right",
217
- surfaces: ["*"],
218
- order: 950,
219
- componentToken: "realtime.web.connection.indicator"
220
- });
221
- ```
222
-
223
- That is a good example of JSKIT's placement model working as intended.
224
-
225
- `realtime` does not need to own your shell component. It just contributes one widget into an outlet that `shell-web` already exposed.
226
-
227
- ### `package.json` gets the runtime dependencies
228
-
229
- The install also adds the runtime packages needed for transport:
230
-
231
- - `@jskit-ai/realtime`
232
- - `socket.io`
233
- - `socket.io-client`
234
- - Redis adapter dependencies for scaled deployments
235
-
236
- That is why `npm install` is still required even though this chapter only touches a small number of app-owned files.
237
-
238
- ## Under the hood
239
-
240
- The internal model is simple.
241
-
242
- - the server provider mounts socket.io at `/socket.io`
243
- - the client provider creates one shared socket client for the Vue app
244
- - the shell status dot is registered as `realtime.web.connection.indicator`
245
-
246
- On the server side, the package also publishes container tokens such as:
247
-
248
- - `runtime.realtime`
249
- - `runtime.realtime.io`
250
-
251
- And on the client side it publishes:
252
-
253
- - `runtime.realtime.client.socket`
254
-
255
- If `REALTIME_REDIS_URL` is empty, the server uses a normal single-process socket.io server. If the URL is set, the package enables the Redis adapter so several Node processes can share realtime events.
256
-
257
- That is the right level of abstraction for this package:
258
-
259
- - generic transport in the runtime
260
- - visible status in the shell
261
- - actual event meaning left to the app or to later packages
262
-
263
- ## Summary
264
-
265
- This chapter does not make the app look radically different, but it adds an important new capability.
266
-
267
- - the backend can now host a realtime socket server
268
- - the frontend can now keep one shared websocket connection alive
269
- - the shell now exposes a live connection indicator
270
- - later modules can build live behavior on top of that transport without inventing their own websocket setup