@jskit-ai/agent-docs 0.1.324 → 0.1.326
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/guide/agent/app-setup/authentication.md +109 -1
- package/guide/agent/framework/data-pass.md +160 -0
- package/guide/agent/framework/quality-pass.md +99 -0
- package/guide/agent/framework/visual-identity.md +152 -0
- package/guide/agent/index.md +6 -0
- package/package.json +1 -1
- package/patterns/minimal-foundation/example/package.json +2 -2
- package/patterns/shell-foundation/example/package.json +3 -3
- package/reference/autogen/PATTERN_INDEX.md +19 -19
- package/reference/autogen/packages/auth-core.md +13 -0
- package/reference/autogen/packages/auth-provider-local-core.md +19 -1
- package/reference/autogen/packages/auth-provider-local-db-core.md +9 -0
- package/reference/autogen/packages/auth-web.md +6 -0
- package/skills/jskit/SKILL.md +5 -1
- package/skills/jskit/references/data-pass.md +155 -0
- package/skills/jskit/references/pattern-index.md +19 -19
- package/skills/jskit/references/patterns/app/minimal-foundation/example/package.json +2 -2
- package/skills/jskit/references/patterns/app/shell-foundation/example/package.json +3 -3
- package/skills/jskit/references/patterns/auth/accounts-hub/example/package.json +1 -1
- package/skills/jskit/references/patterns/auth/oidc-sign-in/example/package.json +2 -2
- package/skills/jskit/references/patterns/auth/supabase-auth/example/package.json +1 -1
- package/skills/jskit/references/patterns/realtime/realtime-application/example/package.json +2 -2
- package/skills/jskit/references/patterns/users/user-administration-server/example/packages/users/package.json +1 -1
- package/skills/jskit/references/patterns/users/user-administration-server/example/packages/users-workspace/package.json +2 -2
- package/skills/jskit/references/quality-pass.md +94 -0
- package/skills/jskit/references/visual-identity.md +147 -0
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@local/main": "0.1.0",
|
|
36
36
|
"@fastify/static": "^10.1.3",
|
|
37
37
|
"@jskit-ai/kernel": "0.2.26",
|
|
38
|
-
"@jskit-ai/material-web": "0.1.
|
|
38
|
+
"@jskit-ai/material-web": "0.1.7",
|
|
39
39
|
"@tanstack/vue-query": "^5.101.0",
|
|
40
40
|
"fastify": "^5.12.7",
|
|
41
41
|
"pino": "^10.3.1",
|
|
@@ -45,13 +45,13 @@
|
|
|
45
45
|
"vue-router": "^5.3.1",
|
|
46
46
|
"vuetify": "^4.3.0",
|
|
47
47
|
"@jskit-ai/http-runtime": "0.2.26",
|
|
48
|
-
"@jskit-ai/shell-web": "0.2.
|
|
48
|
+
"@jskit-ai/shell-web": "0.2.36",
|
|
49
49
|
"@fastify/fast-json-stringify-compiler": "^5.1.0",
|
|
50
50
|
"@vue/devtools-api": "^8.2.1"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@jskit-ai/config-eslint": "0.1.252",
|
|
54
|
-
"@jskit-ai/jskit-catalog": "0.2.
|
|
54
|
+
"@jskit-ai/jskit-catalog": "0.2.78",
|
|
55
55
|
"@playwright/test": "1.61.1",
|
|
56
56
|
"@vitejs/plugin-vue": "^6.0.7",
|
|
57
57
|
"eslint": "^10.8.0",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@jskit-ai/crud-core": "0.2.37",
|
|
14
14
|
"@jskit-ai/resource-crud-core": "0.1.219",
|
|
15
|
-
"@jskit-ai/users-core": "0.2.
|
|
16
|
-
"@jskit-ai/workspaces-core": "0.2.
|
|
15
|
+
"@jskit-ai/users-core": "0.2.43",
|
|
16
|
+
"@jskit-ai/workspaces-core": "0.2.43"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"@jskit-ai/kernel": "0.2.26",
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<!-- Generated from `packages/agent-docs/site/guide/framework/quality-pass.md`. -->
|
|
2
|
+
|
|
3
|
+
# Quality pass
|
|
4
|
+
|
|
5
|
+
A quality pass makes an app hold up in use. Genesis's quality pass skill
|
|
6
|
+
(`genesis-quality-pass`) holds the method: list each screen's states, make each
|
|
7
|
+
one right, try the edge cases, explain every refusal, check accessibility
|
|
8
|
+
basics, and prove it by using the app. This page says where each of those lives
|
|
9
|
+
in a JSKIT app. The rules it applies are already in [Material 3](material-3.md),
|
|
10
|
+
[UI operations](ui-operations.md) and the [sanity checks](sanity-checks.md).
|
|
11
|
+
|
|
12
|
+
## States on every screen
|
|
13
|
+
|
|
14
|
+
- **Loading:** Material skeletons with the geometry of the content they stand
|
|
15
|
+
for, never a spinner; an action keeps a stable label while it runs and
|
|
16
|
+
cannot be sent twice ([Components, state, and feedback](material-3.md#components-state-and-feedback)).
|
|
17
|
+
Ordinary reads stop after 30 seconds, so a slow read ends in its error state.
|
|
18
|
+
- **Empty:** a list's empty state carries an icon, a line saying what would be
|
|
19
|
+
there and one action, such as New; with filters or a search applied it
|
|
20
|
+
offers clearing them instead. An app with an identity uses its
|
|
21
|
+
`EmptyArt.vue` ([Visual identity](visual-identity.md)).
|
|
22
|
+
- **Errors** stay with their owner: a resource that cannot load shows a stable
|
|
23
|
+
in-page error with Retry; a field's error sits beside the field, from the
|
|
24
|
+
server's `details.fieldErrors`; a command's failure goes through the shell's
|
|
25
|
+
action feedback and snackbar path (`ShellErrorHost`), never as an alert that
|
|
26
|
+
pushes the page down. The person's input stays in the form.
|
|
27
|
+
- **Refused by permission:** a screen the person may not use says so and
|
|
28
|
+
offers a way out; an action the person may not take is not offered, or is
|
|
29
|
+
explained where it shows.
|
|
30
|
+
|
|
31
|
+
## Every refusal explained
|
|
32
|
+
|
|
33
|
+
- On the server, each refusal is `new AppError(status, message, { code, params
|
|
34
|
+
})` with a code of its own, one per sentence
|
|
35
|
+
([Refusals carry their own code](typed-features.md#refusals-carry-their-own-code)).
|
|
36
|
+
Its English says what was refused, why, and what the person can do:
|
|
37
|
+
"That slug is taken. Choose another name.", not "Conflict.".
|
|
38
|
+
- On the client, `serverMessage(error)` and `fieldErrorMessages(error)` from
|
|
39
|
+
`useJskitText()` show it, translated by its code
|
|
40
|
+
([How errors are shown](translation.md#how-errors-are-shown)).
|
|
41
|
+
A generic "Something went wrong" in place of a coded refusal is a defect.
|
|
42
|
+
- To find them, list every `AppError` (and subclass) the scope's actions,
|
|
43
|
+
services and routes throw, trigger each one from the screen, and read what
|
|
44
|
+
the person sees. A caller without permission gets a 403 with no field errors
|
|
45
|
+
([Inputs and access](sanity-checks.md#inputs-and-access)).
|
|
46
|
+
- A CRUD list that sends a query key its feature does not declare is refused
|
|
47
|
+
with `crud.query.undeclaredKeys`, and the person sees only that nothing
|
|
48
|
+
loaded. Declare the filter
|
|
49
|
+
([Narrow in the query](data-access.md#narrow-in-the-query)).
|
|
50
|
+
|
|
51
|
+
## Edge cases in a JSKIT app
|
|
52
|
+
|
|
53
|
+
- **Long text:** button labels end in an ellipsis with the full text as
|
|
54
|
+
`title`; table cells end in an ellipsis; a list never scrolls sideways at any
|
|
55
|
+
width.
|
|
56
|
+
- **Double submit:** click Save twice quickly; the command's pending state
|
|
57
|
+
must send one request.
|
|
58
|
+
- **Session and tabs:** sign out in another tab and come back; let the session
|
|
59
|
+
expire mid-form. The auth guard sends the person to sign-in and back.
|
|
60
|
+
- **Time:** dates follow [strict temporal values](crud-operations.md#strict-temporal-values);
|
|
61
|
+
try a value near midnight and in another time zone.
|
|
62
|
+
- **Roles:** sign in as the least-privileged role and walk each flow; Up stays
|
|
63
|
+
inside the app on a page opened from a link.
|
|
64
|
+
|
|
65
|
+
## Accessibility in a JSKIT app
|
|
66
|
+
|
|
67
|
+
`@jskit-ai/material-web` ships 48dp touch targets, visible focus and reduced
|
|
68
|
+
motion. The app supplies the rest the [Material 3 rules](material-3.md)
|
|
69
|
+
list: an accessible name for each icon control (a `ShellPageAction`'s `label`
|
|
70
|
+
is its name), labels on fields, `aria-pressed` filter chips,
|
|
71
|
+
`role="radiogroup"` choices, menu roles, badge labels, and status never shown
|
|
72
|
+
by colour alone. In Playwright, `getByRole(role, { name })` finds a control
|
|
73
|
+
only when it has a name, so a locator that needs a CSS selector points at an
|
|
74
|
+
unnamed control.
|
|
75
|
+
|
|
76
|
+
## Use the app
|
|
77
|
+
|
|
78
|
+
- Drive the app in the host's managed Preview, or with Playwright as
|
|
79
|
+
[UI operations](ui-operations.md#browser-verification) describes;
|
|
80
|
+
the host's preview identity signs you in.
|
|
81
|
+
- Force each state from the browser test:
|
|
82
|
+
`page.route("**/api/orders**", (route) => route.fulfill({ status: 500, json: { error: "…", code: "…" } }))`
|
|
83
|
+
for a failure, `route.abort()` or `context.setOffline(true)` for a dropped
|
|
84
|
+
connection, a delayed `route.continue()` for a slow one, and a fresh
|
|
85
|
+
`BROWSER_TEST_DB_NAME` fixture with no rows for first use.
|
|
86
|
+
- Seed realistic data in the browser fixture database: hundreds of rows and
|
|
87
|
+
long names.
|
|
88
|
+
- Walk each flow once with the keyboard only (`page.keyboard.press("Tab")`).
|
|
89
|
+
- Take screenshots at 390, 768 and 1280 wide, in light and dark, as the
|
|
90
|
+
[UI pass](ui-pass.md) shows, and look at each one.
|
|
91
|
+
- Lock each fix in at the cheapest level ([Tests](sanity-checks.md#tests)):
|
|
92
|
+
a state or a message in a Vitest component test, a refusal's status and code
|
|
93
|
+
in a server test, a flow in the Playwright spec that already reaches that
|
|
94
|
+
screen. Then run `npm run verify`.
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
<!-- Generated from `packages/agent-docs/site/guide/framework/visual-identity.md`. -->
|
|
2
|
+
|
|
3
|
+
# Visual identity
|
|
4
|
+
|
|
5
|
+
An identity pass gives an app a look of its own. Genesis's identity pass skill
|
|
6
|
+
(`genesis-identity-pass`) holds the method: study the app's kinds of content,
|
|
7
|
+
choose a style option, then build the theme, the artwork, the logo, the loading
|
|
8
|
+
screen and sign-in, and prove them. This page says where each piece lives in a
|
|
9
|
+
JSKIT app and which checks prove it. Read the [Material 3 rules](material-3.md)
|
|
10
|
+
first: the identity works inside them, never against them, and navigation stays
|
|
11
|
+
must-fix.
|
|
12
|
+
|
|
13
|
+
## Theme: one seed
|
|
14
|
+
|
|
15
|
+
- `src/theme/index.js` is the app's only theme file: `{ seed, colors, icons,
|
|
16
|
+
typography }`, passed to `createMaterialVuetifyOptions()` from
|
|
17
|
+
`@jskit-ai/material-web/client` ([Foundation](material-3.md#foundation)).
|
|
18
|
+
The seed generates the light and dark schemes; change it and both follow.
|
|
19
|
+
- A colour role per kind of content goes in `colors` by camelCase name.
|
|
20
|
+
`colors: { soups: "#B5562B", breads: "#8A6A2F" }` gives `soups`, `on-soups`,
|
|
21
|
+
`soups-container` and `on-soups-container` (and the same for `breads`),
|
|
22
|
+
harmonized toward the seed in both schemes; `{ value: "#F5C518", blend:
|
|
23
|
+
false }` keeps a colour's own hue. Use them by name:
|
|
24
|
+
`<v-chip color="soups-container">`.
|
|
25
|
+
- Interface code uses roles only. `jskit check m3` fails a hex colour outside
|
|
26
|
+
`src/theme/` (`m3/raw-hex`).
|
|
27
|
+
|
|
28
|
+
## Content colours: `src/theme/palettes.js`
|
|
29
|
+
|
|
30
|
+
Every colour that is content rather than interface lives here: named exports
|
|
31
|
+
of frozen plain hex values, each with a comment saying where it is used, as the
|
|
32
|
+
Material 3 page's [exceptions](material-3.md#exceptions) describe.
|
|
33
|
+
|
|
34
|
+
```js
|
|
35
|
+
// src/theme/palettes.js
|
|
36
|
+
|
|
37
|
+
// Cover art, per kind of content: the gradient's two stops, the motif's accent and its light colour
|
|
38
|
+
// (src/components/art/CoverArt.vue). `brand` draws items without a kind.
|
|
39
|
+
export const coverPalettes = Object.freeze({
|
|
40
|
+
brand: Object.freeze({ from: "#1F3A5F", to: "#3E7C8C", accent: "#F2B544", light: "#F6EFE3" }),
|
|
41
|
+
soups: Object.freeze({ from: "#7A2E1C", to: "#C8642F", accent: "#F4C95D", light: "#FBEFE1" }),
|
|
42
|
+
breads: Object.freeze({ from: "#5B4320", to: "#A7803E", accent: "#E8D3A2", light: "#FFF8EA" })
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
// The logo tile, favicon.svg and the app icons (src/components/BrandLogo.vue).
|
|
46
|
+
export const logoColours = Object.freeze({ from: "#1F3A5F", to: "#3E7C8C", mark: "#F2B544", markShade: "#E07A3F" });
|
|
47
|
+
|
|
48
|
+
// The sign-in brand pane's glow and ink (src/components/AppBrand.vue).
|
|
49
|
+
export const signInPane = Object.freeze({ glow: "#3E7C8C", ink: "#0E1A26" });
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Components read them through bindings (`:fill`, `:stop-color`, or `v-bind()`
|
|
53
|
+
in a scoped `<style>`), never as literals.
|
|
54
|
+
|
|
55
|
+
## Cover art: `src/components/art/CoverArt.vue`
|
|
56
|
+
|
|
57
|
+
- Props `kind` and `seed` (strings) and `height` (a number), declared typed as
|
|
58
|
+
the [client features](client-features.md) guide asks.
|
|
59
|
+
- The root is `<svg viewBox="0 0 400 200" preserveAspectRatio="xMidYMid slice"
|
|
60
|
+
aria-hidden="true" width="100%" :height="height">`: one 2:1 drawing serves a
|
|
61
|
+
card, a strip and a thumbnail.
|
|
62
|
+
- The motifs are data in `src/components/art/motifs.js`, one list of
|
|
63
|
+
`{ tag, ...attributes }` shapes per kind, drawn with `<component
|
|
64
|
+
:is="shape.tag" v-bind="shape.attributes" />`. A native SVG tag (`circle`,
|
|
65
|
+
`path`, `rect`) named as a string is fine; `ui/vuetify-by-name` concerns
|
|
66
|
+
Vuetify components only.
|
|
67
|
+
- The seeded generator from the Genesis skill lives once, in the component's
|
|
68
|
+
module, seeded with `` `${kind}:${seed}` ``; the item's id or slug is the seed.
|
|
69
|
+
- A gradient's `id` carries the kind and the seed (`cover-soups-42`), so two
|
|
70
|
+
covers on one page never share one.
|
|
71
|
+
- A Vitest component test renders one kind and seed twice and gets the same
|
|
72
|
+
markup, and two seeds of one kind and gets different markup.
|
|
73
|
+
|
|
74
|
+
## Where it appears
|
|
75
|
+
|
|
76
|
+
- **Cards:** a flat `v-card` whose first child is `<CoverArt :height="130">`;
|
|
77
|
+
the card's 12dp corners clip it, so the art has no radius of its own. Then
|
|
78
|
+
the title in `text-title-large` (a stretched link that opens the record),
|
|
79
|
+
"By …" in `text-body-medium text-on-surface-variant`, a short description,
|
|
80
|
+
`variant="tonal"` chips (the kind with its icon, the level), and one
|
|
81
|
+
`text-body-small` meta line with small icons
|
|
82
|
+
([Lists, records and forms](material-3.md#lists-records-and-forms)).
|
|
83
|
+
- **Hero card and profile header:** a `CoverArt` strip, with the `v-avatar`
|
|
84
|
+
overlapping its lower edge.
|
|
85
|
+
- **Empty states:** `src/components/art/EmptyArt.vue`: a 224×112 `CoverArt`
|
|
86
|
+
in a wrapper with 28dp corners, the state's icon in a 64dp `v-avatar
|
|
87
|
+
color="surface"` with `<v-icon color="primary">` in its middle and an
|
|
88
|
+
`elevation` class for the soft shadow (a hand-made `box-shadow` fails
|
|
89
|
+
`m3/raw-hex`), then a `text-title-large` line, a `text-body-medium` hint and
|
|
90
|
+
one `variant="tonal"` button.
|
|
91
|
+
- **Logo:** `src/components/BrandLogo.vue` draws the 512×512 tile (`rx="112"`)
|
|
92
|
+
inline from `logoColours`. The app's `favicon.svg` (beside `index.html` in
|
|
93
|
+
the foundation) is the same drawing with its colours written in; its
|
|
94
|
+
comment names `palettes.js` as their source. An app with
|
|
95
|
+
`manifest.webmanifest` lists its icons from the same drawing, and an app with
|
|
96
|
+
a mobile target renders its 1024×1024 PNG `Icon` from it on an opaque
|
|
97
|
+
background.
|
|
98
|
+
- **Loading screen:** `index.html`'s `#startup-shell`, which shows before any
|
|
99
|
+
JavaScript runs. Put the logo inline, the name as `<title>` spells it, and
|
|
100
|
+
the tagline in it; keep its `role="status"` line, its `<noscript>` and its
|
|
101
|
+
Reload link. Its colours are literal because it runs before the theme: take
|
|
102
|
+
them from `palettes.js` and the seed's schemes, and say so in a comment. Its
|
|
103
|
+
rotation runs only inside `@media (prefers-reduced-motion: no-preference)`.
|
|
104
|
+
- **Sign-in:** `src/components/AppBrand.vue`, from the `auth/auth-surface`
|
|
105
|
+
pattern, fills the auth views' `brand` slot. Wide (`compact` false), it is the brand
|
|
106
|
+
pane: a radial glow from `signInPane.glow` into `signInPane.ink`, the logo,
|
|
107
|
+
the name, the tagline and three short lines on what the app does, a large
|
|
108
|
+
faint accent ring and a few soft light bubbles. On phones (`compact`), the
|
|
109
|
+
logo and the name over a `CoverArt` strip of kind `brand`. It holds no
|
|
110
|
+
heading: each auth screen's `h1` is its own.
|
|
111
|
+
|
|
112
|
+
## The Material 3 pieces it uses
|
|
113
|
+
|
|
114
|
+
- **Pages open onto content.** The shell's top app bar carries the page's
|
|
115
|
+
title and actions ([The top app bar carries the page](material-3.md#the-top-app-bar-carries-the-page)):
|
|
116
|
+
no welcome heading or title block.
|
|
117
|
+
- **"New"** is `ShellPrimaryAction`: an extended FAB on compact and medium
|
|
118
|
+
widths, a filled bar button on expanded ones.
|
|
119
|
+
- **Bottom navigation** on phones is the shell's navigation bar, drawn from the
|
|
120
|
+
surface's destinations: keep five or fewer. A surface with fewer than two
|
|
121
|
+
destinations draws no navigation at all, so there is never an empty drawer.
|
|
122
|
+
- **Loading** uses Material skeletons with the content's geometry, never a
|
|
123
|
+
spinner ([Components, state, and feedback](material-3.md#components-state-and-feedback)).
|
|
124
|
+
- **Changing numbers** use `font-variant-numeric: tabular-nums`.
|
|
125
|
+
- **New list items** pop in through a Vue `<TransitionGroup>` with a scoped
|
|
126
|
+
keyframe (from `scale(0.6)` and `opacity: 0` over 600 ms, easing
|
|
127
|
+
`var(--md-sys-motion-easing-emphasized-decelerate)`). `material.css` finishes
|
|
128
|
+
every animation at once under `prefers-reduced-motion: reduce`, so the app
|
|
129
|
+
adds no media query of its own.
|
|
130
|
+
- **Button and chip overlays** take their shape's corners from `material.css`
|
|
131
|
+
(`border-radius: inherit` on the overlay, underlay and ripple). If one still
|
|
132
|
+
spills past its shape, report it at `@jskit-ai/material-web`; never add app
|
|
133
|
+
CSS for it.
|
|
134
|
+
|
|
135
|
+
## Prove it
|
|
136
|
+
|
|
137
|
+
- `npx jskit check m3` reports nothing and `npx jskit check` passes.
|
|
138
|
+
- Take the screenshots with a temporary Playwright spec as the
|
|
139
|
+
[UI pass](ui-pass.md) shows: the main list, a record, an empty
|
|
140
|
+
state, `/auth/login` at 390 and 1280, and the profile, at 390 and 1280 wide,
|
|
141
|
+
in light and dark. Look at every one.
|
|
142
|
+
- Contrast: compute the ratio of each writing colour over each identity colour,
|
|
143
|
+
from the `palettes.js` values and the generated roles
|
|
144
|
+
(`useTheme().current.value.colors`) in both schemes.
|
|
145
|
+
- Layout shift: in the same spec, collect `layout-shift` entries with a
|
|
146
|
+
`PerformanceObserver` while a list loads; their sum stays near zero.
|
|
147
|
+
- Run the Vitest test of `CoverArt.vue` and the affected screens' tests.
|