@jskit-ai/agent-docs 0.1.324 → 0.1.325
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/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 +15 -15
- package/skills/jskit/SKILL.md +5 -1
- package/skills/jskit/references/data-pass.md +155 -0
- package/skills/jskit/references/pattern-index.md +15 -15
- 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/oidc-sign-in/example/package.json +2 -2
- package/skills/jskit/references/patterns/realtime/realtime-application/example/package.json +2 -2
- package/skills/jskit/references/quality-pass.md +94 -0
- package/skills/jskit/references/visual-identity.md +147 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
<!-- Generated by `npm run agent-docs:build` from `packages/agent-docs/site/guide/framework/data-pass.md`. Do not edit manually. -->
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
title: Data pass
|
|
5
|
+
description: The owner layer, query counters, constraint tests, migration mechanics and PostgreSQL and MySQL differences a data pass uses in a JSKIT app.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Data pass
|
|
9
|
+
|
|
10
|
+
A data pass makes an app's data hold up at real sizes. Genesis's data pass
|
|
11
|
+
skill (`genesis-data-pass`) holds the method: map the data, measure each path
|
|
12
|
+
at a few rows and at a realistic size, then make counts follow the rows read,
|
|
13
|
+
narrow reads in the query, enforce and try every constraint, migrate safely,
|
|
14
|
+
index the real filters, and leave tests at realistic sizes. This page says
|
|
15
|
+
which JSKIT pieces each step uses. The rules themselves are in
|
|
16
|
+
[Data access](/guide/framework/data-access) and the [sanity checks](/guide/framework/sanity-checks);
|
|
17
|
+
read the sections each step names.
|
|
18
|
+
|
|
19
|
+
## Map the data
|
|
20
|
+
|
|
21
|
+
- Each table has one owner: the feature whose table resource (`own()`)
|
|
22
|
+
declares it ([The resource is the only door](/guide/framework/data-access#the-resource-is-the-only-door)).
|
|
23
|
+
Other features read it through that owner
|
|
24
|
+
([Tables you don't own](/guide/framework/data-access#tables-you-don-t-own)).
|
|
25
|
+
`expectEveryTableOwned()` fails on a table nobody owns.
|
|
26
|
+
- A table's constraints and indexes are in the migrations of the package that
|
|
27
|
+
owns it, and the foreign keys between packages in a `constraints/`
|
|
28
|
+
subdirectory ([Directory order comes before filenames](/guide/app-setup/database-layer#directory-order-comes-before-filenames)).
|
|
29
|
+
- The paths to measure are the CRUD lists and records, the feature's actions
|
|
30
|
+
and services, the [many-row writes](/guide/framework/data-access#layer-3-many-rows-at-once),
|
|
31
|
+
the [reports](/guide/framework/data-access#layer-5-reports-the-resource-cannot-express)
|
|
32
|
+
and the [background work](/guide/framework/data-access#background-work).
|
|
33
|
+
|
|
34
|
+
## Measure
|
|
35
|
+
|
|
36
|
+
Count each path's statements on `TEST_DB_NAME`, never `DB_NAME`, with
|
|
37
|
+
`expectFlatQueries()` from `@jskit-ai/resource-runtime/test`, or
|
|
38
|
+
`countQueries(knex, work)` from
|
|
39
|
+
`@jskit-ai/database-runtime/server/testDatabases` when you want the counts and
|
|
40
|
+
statements themselves ([Tests](/guide/framework/data-access#tests),
|
|
41
|
+
[Query counts and batches](/guide/framework/sanity-checks#query-counts-and-batches)).
|
|
42
|
+
Record each count at a few rows and at the realistic size before changing
|
|
43
|
+
anything; the report compares them.
|
|
44
|
+
|
|
45
|
+
## Fix the paths
|
|
46
|
+
|
|
47
|
+
- **Counts follow the rows read.** A handle's `get()` or `query()`, or a
|
|
48
|
+
service call, inside a loop becomes one id-list read through `queryAll()` or
|
|
49
|
+
`include`, grouped with `Map.groupBy()`
|
|
50
|
+
([Reads shaped for the screen](/guide/framework/data-access#reads-shaped-for-the-screen)).
|
|
51
|
+
A write that does not use its result passes `returning: "id"` or `"none"`; a
|
|
52
|
+
batch uses `createMany()` and `patchMany()`.
|
|
53
|
+
- **The query narrows.** Filters, sorts, limits, existence checks and counts go
|
|
54
|
+
in the read: the searchSchema's filters, `q` for typed text, `take: 1` for
|
|
55
|
+
one row, `aggregate()` for a count
|
|
56
|
+
([Narrow in the query](/guide/framework/data-access#narrow-in-the-query)).
|
|
57
|
+
The lint rules `jskit/narrow-in-query` and `jskit/search-on-server`, and
|
|
58
|
+
`jskit check`'s `data/search-q`, report what they can see.
|
|
59
|
+
- A fix that needs an API the owner does not have is asked of that owner, or
|
|
60
|
+
of JSKIT for its packages, never written around it
|
|
61
|
+
([Exceptions](/guide/framework/data-access#exceptions)).
|
|
62
|
+
|
|
63
|
+
## Constraints
|
|
64
|
+
|
|
65
|
+
- Required fields, enumerations and ranges are in the resource's schema, and
|
|
66
|
+
required, unique and foreign keys in the table's migration. A rule the
|
|
67
|
+
schema cannot express, such as a uniqueness within an owner or a check that
|
|
68
|
+
reads another row, belongs to the owner's service, inside its
|
|
69
|
+
[transaction](/guide/framework/data-access#transactions).
|
|
70
|
+
- Try each one: a server test sends one value that breaks it and asserts the
|
|
71
|
+
refusal's status and code, and that the message tells the person what to do
|
|
72
|
+
([Every refusal explained](/guide/framework/quality-pass#every-refusal-explained)).
|
|
73
|
+
A unique or foreign key the database enforces needs that test too, so its
|
|
74
|
+
error reaches the person as a sentence, not a 500.
|
|
75
|
+
- `addMissingForeignKey(knex, key)` from
|
|
76
|
+
`@jskit-ai/database-runtime/server/foreignKeyMigrations` adds a key on fresh
|
|
77
|
+
and already-migrated databases alike; it fails, naming the rows with no
|
|
78
|
+
parent, and deletes nothing. Before adding any constraint, count the rows
|
|
79
|
+
that break it; ask the person what they should say rather than rewrite them.
|
|
80
|
+
|
|
81
|
+
## Migrations
|
|
82
|
+
|
|
83
|
+
- Each change is a new `.cjs` Knex migration in the package that owns the
|
|
84
|
+
table; one that has run anywhere is never edited
|
|
85
|
+
([Authoring schema changes](/guide/app-setup/database-layer#authoring-schema-changes),
|
|
86
|
+
[Migration ownership](/guide/framework/crud-operations#migration-ownership)).
|
|
87
|
+
- Backfill large tables in bounded chunks with the many-row writes, from a job
|
|
88
|
+
or a script, not inside one migration statement that holds a lock for its
|
|
89
|
+
whole run. Seed data is not a migration
|
|
90
|
+
([Seed data is not a migration](/guide/app-setup/database-layer#seed-data-is-not-a-migration)).
|
|
91
|
+
- Prove a migration on the selected engine as the database layer's
|
|
92
|
+
[Verification](/guide/app-setup/database-layer#verification) describes: fresh
|
|
93
|
+
preparation, an upgrade that keeps rows, and a second preparation with
|
|
94
|
+
nothing pending. Changing a migration or seed source changes the test
|
|
95
|
+
databases' snapshot digest, so the next test run rebuilds them
|
|
96
|
+
([Integration test databases](/guide/app-setup/database-layer#integration-test-databases)).
|
|
97
|
+
|
|
98
|
+
## Indexes
|
|
99
|
+
|
|
100
|
+
- Take the filters, sorts and joins from the statements `countQueries()`
|
|
101
|
+
captured, and give each an index in a new migration, its columns in the order
|
|
102
|
+
the query uses them; the owner columns of a scoped table usually come first.
|
|
103
|
+
- A filter on another table's field needs that field declared `indexed: true`
|
|
104
|
+
on its own table resource, with a database index on its column; `own()`
|
|
105
|
+
refuses it at startup otherwise ([Layer 1: the table resource](/guide/framework/data-access#layer-1-the-table-resource)).
|
|
106
|
+
- `lockWhere` needs an index that starts with the ownership columns, and with
|
|
107
|
+
`sort` or `limit` one that reads rows in the lock's order; without it the
|
|
108
|
+
lock refuses and names the index ([Layer 4: locks](/guide/framework/data-access#layer-4-locks)).
|
|
109
|
+
- Read the plan on the test database at the realistic size (below, per engine)
|
|
110
|
+
and see each index used.
|
|
111
|
+
|
|
112
|
+
## Tests at realistic sizes
|
|
113
|
+
|
|
114
|
+
- Each list, batch and write path keeps a one-line `expectFlatQueries()` test
|
|
115
|
+
whose `seed` builds the realistic size; each scoped path keeps an
|
|
116
|
+
`expectScoped()` test proving another owner's rows stay unseen and unchanged
|
|
117
|
+
([Tests](/guide/framework/data-access#tests)).
|
|
118
|
+
- A capped read keeps a test that seeds past its cap and finds the row it
|
|
119
|
+
needs.
|
|
120
|
+
- Run `npm run lint`, `npx jskit check` and `npm run verify`.
|
|
121
|
+
|
|
122
|
+
## PostgreSQL
|
|
123
|
+
|
|
124
|
+
- `CREATE INDEX CONCURRENTLY` builds an index without blocking writes, but
|
|
125
|
+
cannot run in a transaction: give that migration `exports.config = {
|
|
126
|
+
transaction: false }` and nothing else, and use `DROP INDEX CONCURRENTLY` in
|
|
127
|
+
its `down()`. A failed concurrent build leaves an invalid index behind; drop
|
|
128
|
+
it before retrying.
|
|
129
|
+
- On a large table, add a foreign key or check `NOT VALID`, which takes only a
|
|
130
|
+
brief lock and enforces it for new rows, then `VALIDATE CONSTRAINT` in a
|
|
131
|
+
later migration, which reads the old rows without blocking writes.
|
|
132
|
+
- Adding a column with a constant default is instant; changing a column's type
|
|
133
|
+
rewrites the table and locks it for the whole rewrite.
|
|
134
|
+
- PostgreSQL does not index a foreign key's column for you: index it when the
|
|
135
|
+
app filters or joins by it, or deletes parent rows.
|
|
136
|
+
- A partial index (`WHERE archived_at IS NULL`) serves a filter the app always
|
|
137
|
+
applies, at a fraction of the size.
|
|
138
|
+
- Read plans with `EXPLAIN (ANALYZE, BUFFERS)`, after `ANALYZE` on freshly
|
|
139
|
+
seeded tables, so the planner sees the realistic size.
|
|
140
|
+
- Counts and sums come back as strings; compare them with `Number()` in tests.
|
|
141
|
+
|
|
142
|
+
## MySQL
|
|
143
|
+
|
|
144
|
+
- DDL commits as it goes, so a migration with several schema statements can
|
|
145
|
+
stop half-applied: one schema change per migration, written for its partial
|
|
146
|
+
states ([MySQL and MariaDB failures can leave partial schema](/guide/app-setup/database-layer#mysql-and-mariadb-failures-can-leave-partial-schema)).
|
|
147
|
+
- Ask for an online change explicitly, `ALGORITHM=INPLACE, LOCK=NONE` (or
|
|
148
|
+
`ALGORITHM=INSTANT` to add a column), so a change that would lock the table
|
|
149
|
+
fails instead of locking it.
|
|
150
|
+
- InnoDB indexes each foreign key's column itself; an index whose leading
|
|
151
|
+
columns match makes it a duplicate.
|
|
152
|
+
- MySQL has no partial indexes; an index on the filtered column plus the owner
|
|
153
|
+
columns serves the same filter.
|
|
154
|
+
- With the `utf8mb4_0900_ai_ci` collation a unique key ignores case and accents
|
|
155
|
+
(`Soup` and `soup` collide); try a value that differs only in case when such a
|
|
156
|
+
key is a constraint.
|
|
157
|
+
- Read plans with `EXPLAIN ANALYZE` (MySQL 8.0.18 and later; `EXPLAIN` on
|
|
158
|
+
MariaDB).
|
|
159
|
+
- `information_schema` reads are slow and lock metadata: keep them in
|
|
160
|
+
migrations and checks, never on a request path.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<!-- Generated by `npm run agent-docs:build` from `packages/agent-docs/site/guide/framework/quality-pass.md`. Do not edit manually. -->
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
title: Quality pass
|
|
5
|
+
description: Where loading, empty, error and refused states live in a JSKIT app, how a refusal reaches the person, and how to force each state while using the app.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Quality pass
|
|
9
|
+
|
|
10
|
+
A quality pass makes an app hold up in use. Genesis's quality pass skill
|
|
11
|
+
(`genesis-quality-pass`) holds the method: list each screen's states, make each
|
|
12
|
+
one right, try the edge cases, explain every refusal, check accessibility
|
|
13
|
+
basics, and prove it by using the app. This page says where each of those lives
|
|
14
|
+
in a JSKIT app. The rules it applies are already in [Material 3](/guide/framework/material-3),
|
|
15
|
+
[UI operations](/guide/framework/ui-operations) and the [sanity checks](/guide/framework/sanity-checks).
|
|
16
|
+
|
|
17
|
+
## States on every screen
|
|
18
|
+
|
|
19
|
+
- **Loading:** Material skeletons with the geometry of the content they stand
|
|
20
|
+
for, never a spinner; an action keeps a stable label while it runs and
|
|
21
|
+
cannot be sent twice ([Components, state, and feedback](/guide/framework/material-3#components-state-and-feedback)).
|
|
22
|
+
Ordinary reads stop after 30 seconds, so a slow read ends in its error state.
|
|
23
|
+
- **Empty:** a list's empty state carries an icon, a line saying what would be
|
|
24
|
+
there and one action, such as New; with filters or a search applied it
|
|
25
|
+
offers clearing them instead. An app with an identity uses its
|
|
26
|
+
`EmptyArt.vue` ([Visual identity](/guide/framework/visual-identity)).
|
|
27
|
+
- **Errors** stay with their owner: a resource that cannot load shows a stable
|
|
28
|
+
in-page error with Retry; a field's error sits beside the field, from the
|
|
29
|
+
server's `details.fieldErrors`; a command's failure goes through the shell's
|
|
30
|
+
action feedback and snackbar path (`ShellErrorHost`), never as an alert that
|
|
31
|
+
pushes the page down. The person's input stays in the form.
|
|
32
|
+
- **Refused by permission:** a screen the person may not use says so and
|
|
33
|
+
offers a way out; an action the person may not take is not offered, or is
|
|
34
|
+
explained where it shows.
|
|
35
|
+
|
|
36
|
+
## Every refusal explained
|
|
37
|
+
|
|
38
|
+
- On the server, each refusal is `new AppError(status, message, { code, params
|
|
39
|
+
})` with a code of its own, one per sentence
|
|
40
|
+
([Refusals carry their own code](/guide/framework/typed-features#refusals-carry-their-own-code)).
|
|
41
|
+
Its English says what was refused, why, and what the person can do:
|
|
42
|
+
"That slug is taken. Choose another name.", not "Conflict.".
|
|
43
|
+
- On the client, `serverMessage(error)` and `fieldErrorMessages(error)` from
|
|
44
|
+
`useJskitText()` show it, translated by its code
|
|
45
|
+
([How errors are shown](/guide/framework/translation#how-errors-are-shown)).
|
|
46
|
+
A generic "Something went wrong" in place of a coded refusal is a defect.
|
|
47
|
+
- To find them, list every `AppError` (and subclass) the scope's actions,
|
|
48
|
+
services and routes throw, trigger each one from the screen, and read what
|
|
49
|
+
the person sees. A caller without permission gets a 403 with no field errors
|
|
50
|
+
([Inputs and access](/guide/framework/sanity-checks#inputs-and-access)).
|
|
51
|
+
- A CRUD list that sends a query key its feature does not declare is refused
|
|
52
|
+
with `crud.query.undeclaredKeys`, and the person sees only that nothing
|
|
53
|
+
loaded. Declare the filter
|
|
54
|
+
([Narrow in the query](/guide/framework/data-access#narrow-in-the-query)).
|
|
55
|
+
|
|
56
|
+
## Edge cases in a JSKIT app
|
|
57
|
+
|
|
58
|
+
- **Long text:** button labels end in an ellipsis with the full text as
|
|
59
|
+
`title`; table cells end in an ellipsis; a list never scrolls sideways at any
|
|
60
|
+
width.
|
|
61
|
+
- **Double submit:** click Save twice quickly; the command's pending state
|
|
62
|
+
must send one request.
|
|
63
|
+
- **Session and tabs:** sign out in another tab and come back; let the session
|
|
64
|
+
expire mid-form. The auth guard sends the person to sign-in and back.
|
|
65
|
+
- **Time:** dates follow [strict temporal values](/guide/framework/crud-operations#strict-temporal-values);
|
|
66
|
+
try a value near midnight and in another time zone.
|
|
67
|
+
- **Roles:** sign in as the least-privileged role and walk each flow; Up stays
|
|
68
|
+
inside the app on a page opened from a link.
|
|
69
|
+
|
|
70
|
+
## Accessibility in a JSKIT app
|
|
71
|
+
|
|
72
|
+
`@jskit-ai/material-web` ships 48dp touch targets, visible focus and reduced
|
|
73
|
+
motion. The app supplies the rest the [Material 3 rules](/guide/framework/material-3)
|
|
74
|
+
list: an accessible name for each icon control (a `ShellPageAction`'s `label`
|
|
75
|
+
is its name), labels on fields, `aria-pressed` filter chips,
|
|
76
|
+
`role="radiogroup"` choices, menu roles, badge labels, and status never shown
|
|
77
|
+
by colour alone. In Playwright, `getByRole(role, { name })` finds a control
|
|
78
|
+
only when it has a name, so a locator that needs a CSS selector points at an
|
|
79
|
+
unnamed control.
|
|
80
|
+
|
|
81
|
+
## Use the app
|
|
82
|
+
|
|
83
|
+
- Drive the app in the host's managed Preview, or with Playwright as
|
|
84
|
+
[UI operations](/guide/framework/ui-operations#browser-verification) describes;
|
|
85
|
+
the host's preview identity signs you in.
|
|
86
|
+
- Force each state from the browser test:
|
|
87
|
+
`page.route("**/api/orders**", (route) => route.fulfill({ status: 500, json: { error: "…", code: "…" } }))`
|
|
88
|
+
for a failure, `route.abort()` or `context.setOffline(true)` for a dropped
|
|
89
|
+
connection, a delayed `route.continue()` for a slow one, and a fresh
|
|
90
|
+
`BROWSER_TEST_DB_NAME` fixture with no rows for first use.
|
|
91
|
+
- Seed realistic data in the browser fixture database: hundreds of rows and
|
|
92
|
+
long names.
|
|
93
|
+
- Walk each flow once with the keyboard only (`page.keyboard.press("Tab")`).
|
|
94
|
+
- Take screenshots at 390, 768 and 1280 wide, in light and dark, as the
|
|
95
|
+
[UI pass](/guide/framework/ui-pass) shows, and look at each one.
|
|
96
|
+
- Lock each fix in at the cheapest level ([Tests](/guide/framework/sanity-checks#tests)):
|
|
97
|
+
a state or a message in a Vitest component test, a refusal's status and code
|
|
98
|
+
in a server test, a flow in the Playwright spec that already reaches that
|
|
99
|
+
screen. Then run `npm run verify`.
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
<!-- Generated by `npm run agent-docs:build` from `packages/agent-docs/site/guide/framework/visual-identity.md`. Do not edit manually. -->
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
title: Visual identity
|
|
5
|
+
description: Where each piece of an identity pass lives in a JSKIT app, the Material 3 pieces it uses, and the checks that prove it.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Visual identity
|
|
9
|
+
|
|
10
|
+
An identity pass gives an app a look of its own. Genesis's identity pass skill
|
|
11
|
+
(`genesis-identity-pass`) holds the method: study the app's kinds of content,
|
|
12
|
+
choose a style option, then build the theme, the artwork, the logo, the loading
|
|
13
|
+
screen and sign-in, and prove them. This page says where each piece lives in a
|
|
14
|
+
JSKIT app and which checks prove it. Read the [Material 3 rules](/guide/framework/material-3)
|
|
15
|
+
first: the identity works inside them, never against them, and navigation stays
|
|
16
|
+
must-fix.
|
|
17
|
+
|
|
18
|
+
## Theme: one seed
|
|
19
|
+
|
|
20
|
+
- `src/theme/index.js` is the app's only theme file: `{ seed, colors, icons,
|
|
21
|
+
typography }`, passed to `createMaterialVuetifyOptions()` from
|
|
22
|
+
`@jskit-ai/material-web/client` ([Foundation](/guide/framework/material-3#foundation)).
|
|
23
|
+
The seed generates the light and dark schemes; change it and both follow.
|
|
24
|
+
- A colour role per kind of content goes in `colors` by camelCase name.
|
|
25
|
+
`colors: { soups: "#B5562B", breads: "#8A6A2F" }` gives `soups`, `on-soups`,
|
|
26
|
+
`soups-container` and `on-soups-container` (and the same for `breads`),
|
|
27
|
+
harmonized toward the seed in both schemes; `{ value: "#F5C518", blend:
|
|
28
|
+
false }` keeps a colour's own hue. Use them by name:
|
|
29
|
+
`<v-chip color="soups-container">`.
|
|
30
|
+
- Interface code uses roles only. `jskit check m3` fails a hex colour outside
|
|
31
|
+
`src/theme/` (`m3/raw-hex`).
|
|
32
|
+
|
|
33
|
+
## Content colours: `src/theme/palettes.js`
|
|
34
|
+
|
|
35
|
+
Every colour that is content rather than interface lives here: named exports
|
|
36
|
+
of frozen plain hex values, each with a comment saying where it is used, as the
|
|
37
|
+
Material 3 page's [exceptions](/guide/framework/material-3#exceptions) describe.
|
|
38
|
+
|
|
39
|
+
```js
|
|
40
|
+
// src/theme/palettes.js
|
|
41
|
+
|
|
42
|
+
// Cover art, per kind of content: the gradient's two stops, the motif's accent and its light colour
|
|
43
|
+
// (src/components/art/CoverArt.vue). `brand` draws items without a kind.
|
|
44
|
+
export const coverPalettes = Object.freeze({
|
|
45
|
+
brand: Object.freeze({ from: "#1F3A5F", to: "#3E7C8C", accent: "#F2B544", light: "#F6EFE3" }),
|
|
46
|
+
soups: Object.freeze({ from: "#7A2E1C", to: "#C8642F", accent: "#F4C95D", light: "#FBEFE1" }),
|
|
47
|
+
breads: Object.freeze({ from: "#5B4320", to: "#A7803E", accent: "#E8D3A2", light: "#FFF8EA" })
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// The logo tile, favicon.svg and the app icons (src/components/BrandLogo.vue).
|
|
51
|
+
export const logoColours = Object.freeze({ from: "#1F3A5F", to: "#3E7C8C", mark: "#F2B544", markShade: "#E07A3F" });
|
|
52
|
+
|
|
53
|
+
// The sign-in brand pane's glow and ink (src/components/AppBrand.vue).
|
|
54
|
+
export const signInPane = Object.freeze({ glow: "#3E7C8C", ink: "#0E1A26" });
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Components read them through bindings (`:fill`, `:stop-color`, or `v-bind()`
|
|
58
|
+
in a scoped `<style>`), never as literals.
|
|
59
|
+
|
|
60
|
+
## Cover art: `src/components/art/CoverArt.vue`
|
|
61
|
+
|
|
62
|
+
- Props `kind` and `seed` (strings) and `height` (a number), declared typed as
|
|
63
|
+
the [client features](/guide/framework/client-features) guide asks.
|
|
64
|
+
- The root is `<svg viewBox="0 0 400 200" preserveAspectRatio="xMidYMid slice"
|
|
65
|
+
aria-hidden="true" width="100%" :height="height">`: one 2:1 drawing serves a
|
|
66
|
+
card, a strip and a thumbnail.
|
|
67
|
+
- The motifs are data in `src/components/art/motifs.js`, one list of
|
|
68
|
+
`{ tag, ...attributes }` shapes per kind, drawn with `<component
|
|
69
|
+
:is="shape.tag" v-bind="shape.attributes" />`. A native SVG tag (`circle`,
|
|
70
|
+
`path`, `rect`) named as a string is fine; `ui/vuetify-by-name` concerns
|
|
71
|
+
Vuetify components only.
|
|
72
|
+
- The seeded generator from the Genesis skill lives once, in the component's
|
|
73
|
+
module, seeded with `` `${kind}:${seed}` ``; the item's id or slug is the seed.
|
|
74
|
+
- A gradient's `id` carries the kind and the seed (`cover-soups-42`), so two
|
|
75
|
+
covers on one page never share one.
|
|
76
|
+
- A Vitest component test renders one kind and seed twice and gets the same
|
|
77
|
+
markup, and two seeds of one kind and gets different markup.
|
|
78
|
+
|
|
79
|
+
## Where it appears
|
|
80
|
+
|
|
81
|
+
- **Cards:** a flat `v-card` whose first child is `<CoverArt :height="130">`;
|
|
82
|
+
the card's 12dp corners clip it, so the art has no radius of its own. Then
|
|
83
|
+
the title in `text-title-large` (a stretched link that opens the record),
|
|
84
|
+
"By …" in `text-body-medium text-on-surface-variant`, a short description,
|
|
85
|
+
`variant="tonal"` chips (the kind with its icon, the level), and one
|
|
86
|
+
`text-body-small` meta line with small icons
|
|
87
|
+
([Lists, records and forms](/guide/framework/material-3#lists-records-and-forms)).
|
|
88
|
+
- **Hero card and profile header:** a `CoverArt` strip, with the `v-avatar`
|
|
89
|
+
overlapping its lower edge.
|
|
90
|
+
- **Empty states:** `src/components/art/EmptyArt.vue`: a 224×112 `CoverArt`
|
|
91
|
+
in a wrapper with 28dp corners, the state's icon in a 64dp `v-avatar
|
|
92
|
+
color="surface"` with `<v-icon color="primary">` in its middle and an
|
|
93
|
+
`elevation` class for the soft shadow (a hand-made `box-shadow` fails
|
|
94
|
+
`m3/raw-hex`), then a `text-title-large` line, a `text-body-medium` hint and
|
|
95
|
+
one `variant="tonal"` button.
|
|
96
|
+
- **Logo:** `src/components/BrandLogo.vue` draws the 512×512 tile (`rx="112"`)
|
|
97
|
+
inline from `logoColours`. The app's `favicon.svg` (beside `index.html` in
|
|
98
|
+
the foundation) is the same drawing with its colours written in; its
|
|
99
|
+
comment names `palettes.js` as their source. An app with
|
|
100
|
+
`manifest.webmanifest` lists its icons from the same drawing, and an app with
|
|
101
|
+
a mobile target renders its 1024×1024 PNG `Icon` from it on an opaque
|
|
102
|
+
background.
|
|
103
|
+
- **Loading screen:** `index.html`'s `#startup-shell`, which shows before any
|
|
104
|
+
JavaScript runs. Put the logo inline, the name as `<title>` spells it, and
|
|
105
|
+
the tagline in it; keep its `role="status"` line, its `<noscript>` and its
|
|
106
|
+
Reload link. Its colours are literal because it runs before the theme: take
|
|
107
|
+
them from `palettes.js` and the seed's schemes, and say so in a comment. Its
|
|
108
|
+
rotation runs only inside `@media (prefers-reduced-motion: no-preference)`.
|
|
109
|
+
- **Sign-in:** `src/components/AppBrand.vue`, from the `auth/auth-surface`
|
|
110
|
+
pattern, fills the auth views' `brand` slot. Wide (`compact` false), it is the brand
|
|
111
|
+
pane: a radial glow from `signInPane.glow` into `signInPane.ink`, the logo,
|
|
112
|
+
the name, the tagline and three short lines on what the app does, a large
|
|
113
|
+
faint accent ring and a few soft light bubbles. On phones (`compact`), the
|
|
114
|
+
logo and the name over a `CoverArt` strip of kind `brand`. It holds no
|
|
115
|
+
heading: each auth screen's `h1` is its own.
|
|
116
|
+
|
|
117
|
+
## The Material 3 pieces it uses
|
|
118
|
+
|
|
119
|
+
- **Pages open onto content.** The shell's top app bar carries the page's
|
|
120
|
+
title and actions ([The top app bar carries the page](/guide/framework/material-3#the-top-app-bar-carries-the-page)):
|
|
121
|
+
no welcome heading or title block.
|
|
122
|
+
- **"New"** is `ShellPrimaryAction`: an extended FAB on compact and medium
|
|
123
|
+
widths, a filled bar button on expanded ones.
|
|
124
|
+
- **Bottom navigation** on phones is the shell's navigation bar, drawn from the
|
|
125
|
+
surface's destinations: keep five or fewer. A surface with fewer than two
|
|
126
|
+
destinations draws no navigation at all, so there is never an empty drawer.
|
|
127
|
+
- **Loading** uses Material skeletons with the content's geometry, never a
|
|
128
|
+
spinner ([Components, state, and feedback](/guide/framework/material-3#components-state-and-feedback)).
|
|
129
|
+
- **Changing numbers** use `font-variant-numeric: tabular-nums`.
|
|
130
|
+
- **New list items** pop in through a Vue `<TransitionGroup>` with a scoped
|
|
131
|
+
keyframe (from `scale(0.6)` and `opacity: 0` over 600 ms, easing
|
|
132
|
+
`var(--md-sys-motion-easing-emphasized-decelerate)`). `material.css` finishes
|
|
133
|
+
every animation at once under `prefers-reduced-motion: reduce`, so the app
|
|
134
|
+
adds no media query of its own.
|
|
135
|
+
- **Button and chip overlays** take their shape's corners from `material.css`
|
|
136
|
+
(`border-radius: inherit` on the overlay, underlay and ripple). If one still
|
|
137
|
+
spills past its shape, report it at `@jskit-ai/material-web`; never add app
|
|
138
|
+
CSS for it.
|
|
139
|
+
|
|
140
|
+
## Prove it
|
|
141
|
+
|
|
142
|
+
- `npx jskit check m3` reports nothing and `npx jskit check` passes.
|
|
143
|
+
- Take the screenshots with a temporary Playwright spec as the
|
|
144
|
+
[UI pass](/guide/framework/ui-pass) shows: the main list, a record, an empty
|
|
145
|
+
state, `/auth/login` at 390 and 1280, and the profile, at 390 and 1280 wide,
|
|
146
|
+
in light and dark. Look at every one.
|
|
147
|
+
- Contrast: compute the ratio of each writing colour over each identity colour,
|
|
148
|
+
from the `palettes.js` values and the generated roles
|
|
149
|
+
(`useTheme().current.value.colors`) in both schemes.
|
|
150
|
+
- Layout shift: in the same spec, collect `layout-shift` entries with a
|
|
151
|
+
`PerformanceObserver` while a list loads; their sum stays near zero.
|
|
152
|
+
- Run the Vitest test of `CoverArt.vue` and the affected screens' tests.
|
package/guide/agent/index.md
CHANGED
|
@@ -37,6 +37,12 @@ apply or adapt. It does not prescribe an agent host or project orchestrator.
|
|
|
37
37
|
- [Material 3](/guide/framework/material-3)
|
|
38
38
|
- [UI pass](/guide/framework/ui-pass): make a task's changes, a section or the
|
|
39
39
|
whole app exact Material 3
|
|
40
|
+
- [Visual identity](/guide/framework/visual-identity): where an identity pass's
|
|
41
|
+
theme, content colours, artwork, logo, loading screen and sign-in live
|
|
42
|
+
- [Quality pass](/guide/framework/quality-pass): loading, empty, error and
|
|
43
|
+
refused states, edge cases and accessibility, checked by using the app
|
|
44
|
+
- [Data pass](/guide/framework/data-pass): query counts, constraints,
|
|
45
|
+
migrations and indexes at realistic sizes, on PostgreSQL and MySQL
|
|
40
46
|
- [Sanity checks](/guide/framework/sanity-checks): JSKIT's own pitfalls, and
|
|
41
47
|
the JSKIT calls that check data access, tests, a refactor, a screen or a
|
|
42
48
|
deployment before calling it done
|
package/package.json
CHANGED
|
@@ -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",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@jskit-ai/config-eslint": "0.1.252",
|
|
53
|
-
"@jskit-ai/jskit-catalog": "0.2.
|
|
53
|
+
"@jskit-ai/jskit-catalog": "0.2.77",
|
|
54
54
|
"@playwright/test": "1.61.1",
|
|
55
55
|
"@vitejs/plugin-vue": "^6.0.7",
|
|
56
56
|
"eslint": "^10.8.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.77",
|
|
55
55
|
"@playwright/test": "1.61.1",
|
|
56
56
|
"@vitejs/plugin-vue": "^6.0.7",
|
|
57
57
|
"eslint": "^10.8.0",
|
|
@@ -15,7 +15,7 @@ A concrete Fastify, Vue, and JSKIT application foundation for products that do n
|
|
|
15
15
|
|
|
16
16
|
- Id: `app/minimal-foundation`
|
|
17
17
|
- Keywords: `app`, `fastify`, `foundation`, `minimal`, `server`, `vite`, `vue`
|
|
18
|
-
- Owner: `@jskit-ai/agent-docs@0.1.
|
|
18
|
+
- Owner: `@jskit-ai/agent-docs@0.1.325`
|
|
19
19
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/app/minimal-foundation/PATTERN.md)
|
|
20
20
|
- Examples: [example/](../../skills/jskit/references/patterns/app/minimal-foundation/example/)
|
|
21
21
|
- Requires: `@jskit-ai/http-runtime`, `@jskit-ai/kernel`
|
|
@@ -26,7 +26,7 @@ A concrete JSKIT web application foundation with responsive shell navigation, se
|
|
|
26
26
|
|
|
27
27
|
- Id: `app/shell-foundation`
|
|
28
28
|
- Keywords: `app`, `foundation`, `material`, `navigation`, `placements`, `shell`, `vite`, `vue`
|
|
29
|
-
- Owner: `@jskit-ai/agent-docs@0.1.
|
|
29
|
+
- Owner: `@jskit-ai/agent-docs@0.1.325`
|
|
30
30
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/app/shell-foundation/PATTERN.md)
|
|
31
31
|
- Examples: [example/](../../skills/jskit/references/patterns/app/shell-foundation/example/)
|
|
32
32
|
- Requires: `@jskit-ai/http-runtime`, `@jskit-ai/kernel`, `@jskit-ai/shell-web`
|
|
@@ -37,7 +37,7 @@ Configure an assistant runtime for one application surface and expose its chat a
|
|
|
37
37
|
|
|
38
38
|
- Id: `assistant/assistant-surface`
|
|
39
39
|
- Keywords: `ai`, `assistant`, `chat`, `config`, `environment`, `page`, `placement`, `settings`, `surface`
|
|
40
|
-
- Owner: `@jskit-ai/assistant-runtime@0.2.
|
|
40
|
+
- Owner: `@jskit-ai/assistant-runtime@0.2.65`
|
|
41
41
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/assistant/assistant-surface/PATTERN.md)
|
|
42
42
|
- Examples: [example/](../../skills/jskit/references/patterns/assistant/assistant-surface/example/)
|
|
43
43
|
- Requires: `@jskit-ai/assistant-runtime`, `@jskit-ai/connectors-catalog`, `@jskit-ai/connectors-core`, `@jskit-ai/shell-web`
|
|
@@ -59,7 +59,7 @@ Compose JSKIT authentication routes, views, profile controls, and public surface
|
|
|
59
59
|
|
|
60
60
|
- Id: `auth/auth-surface`
|
|
61
61
|
- Keywords: `account`, `auth`, `login`, `logout`, `password`, `placement`, `profile`, `reset`, `surface`
|
|
62
|
-
- Owner: `@jskit-ai/auth-web@0.2.
|
|
62
|
+
- Owner: `@jskit-ai/auth-web@0.2.40`
|
|
63
63
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/auth/auth-surface/PATTERN.md)
|
|
64
64
|
- Examples: [example/](../../skills/jskit/references/patterns/auth/auth-surface/example/)
|
|
65
65
|
- Requires: `@jskit-ai/auth-core`, `@jskit-ai/auth-web`, `@jskit-ai/shell-web`
|
|
@@ -70,7 +70,7 @@ Let people sign in with the accounts they already have in an accounts hub or ano
|
|
|
70
70
|
|
|
71
71
|
- Id: `auth/oidc-sign-in`
|
|
72
72
|
- Keywords: `accounts hub`, `auth`, `authentication`, `back-channel logout`, `dynamic client registration`, `issuer`, `master login`, `oidc`, `openid connect`, `single sign-on`, `sso`
|
|
73
|
-
- Owner: `@jskit-ai/auth-provider-oidc-core@0.2.
|
|
73
|
+
- Owner: `@jskit-ai/auth-provider-oidc-core@0.2.44`
|
|
74
74
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/auth/oidc-sign-in/PATTERN.md)
|
|
75
75
|
- Examples: [example/](../../skills/jskit/references/patterns/auth/oidc-sign-in/example/)
|
|
76
76
|
- Requires: `@jskit-ai/auth-provider-oidc-core`, `@jskit-ai/auth-web`
|
|
@@ -246,7 +246,7 @@ Add a protected administration surface, settings shell, and semantic navigation
|
|
|
246
246
|
|
|
247
247
|
- Id: `console/console-surface`
|
|
248
248
|
- Keywords: `admin`, `console`, `navigation`, `owner`, `placement`, `settings`, `surface`
|
|
249
|
-
- Owner: `@jskit-ai/console-web@0.1.
|
|
249
|
+
- Owner: `@jskit-ai/console-web@0.1.272`
|
|
250
250
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/console/console-surface/PATTERN.md)
|
|
251
251
|
- Examples: [example/](../../skills/jskit/references/patterns/console/console-surface/example/)
|
|
252
252
|
- Requires: `@jskit-ai/console-core`, `@jskit-ai/console-web`, `@jskit-ai/shell-web`
|
|
@@ -279,7 +279,7 @@ Build a routed CRUD user interface as thin application pages over JSKIT's shared
|
|
|
279
279
|
|
|
280
280
|
- Id: `crud/crud-screen-set`
|
|
281
281
|
- Keywords: `actions`, `add`, `crud`, `delete`, `edit`, `filters`, `list`, `material`, `routes`, `view`, `vue`
|
|
282
|
-
- Owner: `@jskit-ai/http-web@0.2.
|
|
282
|
+
- Owner: `@jskit-ai/http-web@0.2.43`
|
|
283
283
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/crud/crud-screen-set/PATTERN.md)
|
|
284
284
|
- Examples: [example/](../../skills/jskit/references/patterns/crud/crud-screen-set/example/)
|
|
285
285
|
- Requires: `@jskit-ai/http-web`, `@jskit-ai/resource-core`, `@jskit-ai/resource-crud-core`
|
|
@@ -323,7 +323,7 @@ Wrap a JSKIT web application in a Capacitor Android shell using native Capacitor
|
|
|
323
323
|
|
|
324
324
|
- Id: `mobile/android-application`
|
|
325
325
|
- Keywords: `android`, `capacitor`, `device`, `mobile`, `native`, `shell`, `webview`
|
|
326
|
-
- Owner: `@jskit-ai/mobile-capacitor@0.2.
|
|
326
|
+
- Owner: `@jskit-ai/mobile-capacitor@0.2.36`
|
|
327
327
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/mobile/android-application/PATTERN.md)
|
|
328
328
|
- Examples: [example/](../../skills/jskit/references/patterns/mobile/android-application/example/)
|
|
329
329
|
- Requires: `@capacitor/android`, `@capacitor/app`, `@capacitor/cli`, `@jskit-ai/mobile-capacitor`
|
|
@@ -334,7 +334,7 @@ Add JSKIT realtime events with an optional Redis backplane and an explicit shell
|
|
|
334
334
|
|
|
335
335
|
- Id: `realtime/realtime-application`
|
|
336
336
|
- Keywords: `realtime`, `redis`, `socket.io`, `sockets`, `status`, `websocket`
|
|
337
|
-
- Owner: `@jskit-ai/realtime@0.2.
|
|
337
|
+
- Owner: `@jskit-ai/realtime@0.2.39`
|
|
338
338
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/realtime/realtime-application/PATTERN.md)
|
|
339
339
|
- Examples: [example/](../../skills/jskit/references/patterns/realtime/realtime-application/example/)
|
|
340
340
|
- Requires: `@jskit-ai/realtime`, `@jskit-ai/shell-web`
|
|
@@ -345,7 +345,7 @@ Compose application-owned Google Publisher Tag delivery with the generic rewarde
|
|
|
345
345
|
|
|
346
346
|
- Id: `rewards/google-rewarded`
|
|
347
347
|
- Keywords: `ads`, `google`, `publisher tag`, `rewarded`, `unlock`
|
|
348
|
-
- Owner: `@jskit-ai/rewarded-web@0.2.
|
|
348
|
+
- Owner: `@jskit-ai/rewarded-web@0.2.49`
|
|
349
349
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/rewards/google-rewarded/PATTERN.md)
|
|
350
350
|
- Examples: [example/](../../skills/jskit/references/patterns/rewards/google-rewarded/example/)
|
|
351
351
|
- Requires: `@jskit-ai/rewarded-web`
|
|
@@ -356,7 +356,7 @@ Define a server feature through explicit capabilities and first-class actions, a
|
|
|
356
356
|
|
|
357
357
|
- Id: `server/feature-package`
|
|
358
358
|
- Keywords: `actions`, `aggregate`, `feature`, `handle`, `orchestration`, `owns`, `package`, `provider`, `repository`, `routes`, `server`, `table resource`
|
|
359
|
-
- Owner: `@jskit-ai/agent-docs@0.1.
|
|
359
|
+
- Owner: `@jskit-ai/agent-docs@0.1.325`
|
|
360
360
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/server/feature-package/PATTERN.md)
|
|
361
361
|
- Examples: [example/](../../skills/jskit/references/patterns/server/feature-package/example/)
|
|
362
362
|
- Requires: `@jskit-ai/kernel`
|
|
@@ -367,7 +367,7 @@ Compose the JSKIT responsive shell, semantic placements, settings navigation, an
|
|
|
367
367
|
|
|
368
368
|
- Id: `shell/application-shell`
|
|
369
369
|
- Keywords: `adaptive`, `app`, `layout`, `navigation`, `placement`, `responsive`, `settings`, `shell`
|
|
370
|
-
- Owner: `@jskit-ai/shell-web@0.2.
|
|
370
|
+
- Owner: `@jskit-ai/shell-web@0.2.36`
|
|
371
371
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/shell/application-shell/PATTERN.md)
|
|
372
372
|
- Examples: [example/](../../skills/jskit/references/patterns/shell/application-shell/example/)
|
|
373
373
|
- Requires: `@jskit-ai/kernel`, `@jskit-ai/shell-web`
|
|
@@ -378,7 +378,7 @@ Add product routes and shell extensions through file routing, semantic placement
|
|
|
378
378
|
|
|
379
379
|
- Id: `ui/page-and-placement`
|
|
380
380
|
- Keywords: `component`, `navigation`, `outlet`, `page`, `placement`, `routes`, `section`, `shell`, `subpages`, `vue`
|
|
381
|
-
- Owner: `@jskit-ai/shell-web@0.2.
|
|
381
|
+
- Owner: `@jskit-ai/shell-web@0.2.36`
|
|
382
382
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/ui/page-and-placement/PATTERN.md)
|
|
383
383
|
- Examples: [example/](../../skills/jskit/references/patterns/ui/page-and-placement/example/)
|
|
384
384
|
- Requires: `@jskit-ai/kernel`, `@jskit-ai/shell-web`
|
|
@@ -389,7 +389,7 @@ Compose an account settings route and profile, preference, notification, and sig
|
|
|
389
389
|
|
|
390
390
|
- Id: `users/account-settings`
|
|
391
391
|
- Keywords: `account`, `link provider`, `notifications`, `oauth`, `preferences`, `profile`, `settings`, `sign-in methods`, `user`, `vue`
|
|
392
|
-
- Owner: `@jskit-ai/users-web@0.2.
|
|
392
|
+
- Owner: `@jskit-ai/users-web@0.2.55`
|
|
393
393
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/users/account-settings/PATTERN.md)
|
|
394
394
|
- Examples: [example/](../../skills/jskit/references/patterns/users/account-settings/example/)
|
|
395
395
|
- Requires: `@jskit-ai/shell-web`, `@jskit-ai/users-core`, `@jskit-ai/users-web`
|
|
@@ -422,7 +422,7 @@ Compose workspace selection, invitation, member administration, settings, and re
|
|
|
422
422
|
|
|
423
423
|
- Id: `workspaces/workspace-surfaces`
|
|
424
424
|
- Keywords: `admin`, `invite`, `member`, `navigation`, `settings`, `surface`, `switcher`, `workspace`
|
|
425
|
-
- Owner: `@jskit-ai/workspaces-web@0.2.
|
|
425
|
+
- Owner: `@jskit-ai/workspaces-web@0.2.55`
|
|
426
426
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/workspaces/workspace-surfaces/PATTERN.md)
|
|
427
427
|
- Examples: [example/](../../skills/jskit/references/patterns/workspaces/workspace-surfaces/example/)
|
|
428
428
|
- Requires: `@jskit-ai/shell-web`, `@jskit-ai/workspaces-core`, `@jskit-ai/workspaces-web`
|
package/skills/jskit/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: jskit
|
|
3
|
-
description: Build, extend, troubleshoot, review, deslop, and verify JSKIT apps using its public framework APIs, package-owned source patterns, runtime capabilities, surfaces, placements, CRUDs, verification conventions, and Vue/Vuetify Material 3 UI contract, including UI passes over a task's changes, a section, or the whole app. Use for every JSKIT UI creation, modification, review, cleanup, or
|
|
3
|
+
description: Build, extend, troubleshoot, review, deslop, and verify JSKIT apps using its public framework APIs, package-owned source patterns, runtime capabilities, surfaces, placements, CRUDs, verification conventions, and Vue/Vuetify Material 3 UI contract, including UI passes over a task's changes, a section, or the whole app, and the JSKIT half of identity, quality and data passes. Use for every JSKIT UI creation, modification, review, cleanup, or pass task.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# JSKIT
|
|
@@ -62,6 +62,10 @@ manifests, migrations, tests, and runtime behaviour are the evidence.
|
|
|
62
62
|
also read [Material 3](references/material-3.md) completely before acting.
|
|
63
63
|
- For a UI pass (the changes, a section, or the whole app), also read
|
|
64
64
|
[UI pass](references/ui-pass.md) completely.
|
|
65
|
+
- For an identity pass, a quality pass or a data pass, also read
|
|
66
|
+
[visual identity](references/visual-identity.md),
|
|
67
|
+
[quality pass](references/quality-pass.md) or
|
|
68
|
+
[data pass](references/data-pass.md) completely.
|
|
65
69
|
- Before writing a list, save, batch or test, a refactor, or calling work
|
|
66
70
|
done, read [sanity checks](references/sanity-checks.md).
|
|
67
71
|
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
<!-- Generated from `packages/agent-docs/site/guide/framework/data-pass.md`. -->
|
|
2
|
+
|
|
3
|
+
# Data pass
|
|
4
|
+
|
|
5
|
+
A data pass makes an app's data hold up at real sizes. Genesis's data pass
|
|
6
|
+
skill (`genesis-data-pass`) holds the method: map the data, measure each path
|
|
7
|
+
at a few rows and at a realistic size, then make counts follow the rows read,
|
|
8
|
+
narrow reads in the query, enforce and try every constraint, migrate safely,
|
|
9
|
+
index the real filters, and leave tests at realistic sizes. This page says
|
|
10
|
+
which JSKIT pieces each step uses. The rules themselves are in
|
|
11
|
+
[Data access](data-access.md) and the [sanity checks](sanity-checks.md);
|
|
12
|
+
read the sections each step names.
|
|
13
|
+
|
|
14
|
+
## Map the data
|
|
15
|
+
|
|
16
|
+
- Each table has one owner: the feature whose table resource (`own()`)
|
|
17
|
+
declares it ([The resource is the only door](data-access.md#the-resource-is-the-only-door)).
|
|
18
|
+
Other features read it through that owner
|
|
19
|
+
([Tables you don't own](data-access.md#tables-you-don-t-own)).
|
|
20
|
+
`expectEveryTableOwned()` fails on a table nobody owns.
|
|
21
|
+
- A table's constraints and indexes are in the migrations of the package that
|
|
22
|
+
owns it, and the foreign keys between packages in a `constraints/`
|
|
23
|
+
subdirectory ([Directory order comes before filenames](database-layer.md#directory-order-comes-before-filenames)).
|
|
24
|
+
- The paths to measure are the CRUD lists and records, the feature's actions
|
|
25
|
+
and services, the [many-row writes](data-access.md#layer-3-many-rows-at-once),
|
|
26
|
+
the [reports](data-access.md#layer-5-reports-the-resource-cannot-express)
|
|
27
|
+
and the [background work](data-access.md#background-work).
|
|
28
|
+
|
|
29
|
+
## Measure
|
|
30
|
+
|
|
31
|
+
Count each path's statements on `TEST_DB_NAME`, never `DB_NAME`, with
|
|
32
|
+
`expectFlatQueries()` from `@jskit-ai/resource-runtime/test`, or
|
|
33
|
+
`countQueries(knex, work)` from
|
|
34
|
+
`@jskit-ai/database-runtime/server/testDatabases` when you want the counts and
|
|
35
|
+
statements themselves ([Tests](data-access.md#tests),
|
|
36
|
+
[Query counts and batches](sanity-checks.md#query-counts-and-batches)).
|
|
37
|
+
Record each count at a few rows and at the realistic size before changing
|
|
38
|
+
anything; the report compares them.
|
|
39
|
+
|
|
40
|
+
## Fix the paths
|
|
41
|
+
|
|
42
|
+
- **Counts follow the rows read.** A handle's `get()` or `query()`, or a
|
|
43
|
+
service call, inside a loop becomes one id-list read through `queryAll()` or
|
|
44
|
+
`include`, grouped with `Map.groupBy()`
|
|
45
|
+
([Reads shaped for the screen](data-access.md#reads-shaped-for-the-screen)).
|
|
46
|
+
A write that does not use its result passes `returning: "id"` or `"none"`; a
|
|
47
|
+
batch uses `createMany()` and `patchMany()`.
|
|
48
|
+
- **The query narrows.** Filters, sorts, limits, existence checks and counts go
|
|
49
|
+
in the read: the searchSchema's filters, `q` for typed text, `take: 1` for
|
|
50
|
+
one row, `aggregate()` for a count
|
|
51
|
+
([Narrow in the query](data-access.md#narrow-in-the-query)).
|
|
52
|
+
The lint rules `jskit/narrow-in-query` and `jskit/search-on-server`, and
|
|
53
|
+
`jskit check`'s `data/search-q`, report what they can see.
|
|
54
|
+
- A fix that needs an API the owner does not have is asked of that owner, or
|
|
55
|
+
of JSKIT for its packages, never written around it
|
|
56
|
+
([Exceptions](data-access.md#exceptions)).
|
|
57
|
+
|
|
58
|
+
## Constraints
|
|
59
|
+
|
|
60
|
+
- Required fields, enumerations and ranges are in the resource's schema, and
|
|
61
|
+
required, unique and foreign keys in the table's migration. A rule the
|
|
62
|
+
schema cannot express, such as a uniqueness within an owner or a check that
|
|
63
|
+
reads another row, belongs to the owner's service, inside its
|
|
64
|
+
[transaction](data-access.md#transactions).
|
|
65
|
+
- Try each one: a server test sends one value that breaks it and asserts the
|
|
66
|
+
refusal's status and code, and that the message tells the person what to do
|
|
67
|
+
([Every refusal explained](quality-pass.md#every-refusal-explained)).
|
|
68
|
+
A unique or foreign key the database enforces needs that test too, so its
|
|
69
|
+
error reaches the person as a sentence, not a 500.
|
|
70
|
+
- `addMissingForeignKey(knex, key)` from
|
|
71
|
+
`@jskit-ai/database-runtime/server/foreignKeyMigrations` adds a key on fresh
|
|
72
|
+
and already-migrated databases alike; it fails, naming the rows with no
|
|
73
|
+
parent, and deletes nothing. Before adding any constraint, count the rows
|
|
74
|
+
that break it; ask the person what they should say rather than rewrite them.
|
|
75
|
+
|
|
76
|
+
## Migrations
|
|
77
|
+
|
|
78
|
+
- Each change is a new `.cjs` Knex migration in the package that owns the
|
|
79
|
+
table; one that has run anywhere is never edited
|
|
80
|
+
([Authoring schema changes](database-layer.md#authoring-schema-changes),
|
|
81
|
+
[Migration ownership](crud-operations.md#migration-ownership)).
|
|
82
|
+
- Backfill large tables in bounded chunks with the many-row writes, from a job
|
|
83
|
+
or a script, not inside one migration statement that holds a lock for its
|
|
84
|
+
whole run. Seed data is not a migration
|
|
85
|
+
([Seed data is not a migration](database-layer.md#seed-data-is-not-a-migration)).
|
|
86
|
+
- Prove a migration on the selected engine as the database layer's
|
|
87
|
+
[Verification](database-layer.md#verification) describes: fresh
|
|
88
|
+
preparation, an upgrade that keeps rows, and a second preparation with
|
|
89
|
+
nothing pending. Changing a migration or seed source changes the test
|
|
90
|
+
databases' snapshot digest, so the next test run rebuilds them
|
|
91
|
+
([Integration test databases](database-layer.md#integration-test-databases)).
|
|
92
|
+
|
|
93
|
+
## Indexes
|
|
94
|
+
|
|
95
|
+
- Take the filters, sorts and joins from the statements `countQueries()`
|
|
96
|
+
captured, and give each an index in a new migration, its columns in the order
|
|
97
|
+
the query uses them; the owner columns of a scoped table usually come first.
|
|
98
|
+
- A filter on another table's field needs that field declared `indexed: true`
|
|
99
|
+
on its own table resource, with a database index on its column; `own()`
|
|
100
|
+
refuses it at startup otherwise ([Layer 1: the table resource](data-access.md#layer-1-the-table-resource)).
|
|
101
|
+
- `lockWhere` needs an index that starts with the ownership columns, and with
|
|
102
|
+
`sort` or `limit` one that reads rows in the lock's order; without it the
|
|
103
|
+
lock refuses and names the index ([Layer 4: locks](data-access.md#layer-4-locks)).
|
|
104
|
+
- Read the plan on the test database at the realistic size (below, per engine)
|
|
105
|
+
and see each index used.
|
|
106
|
+
|
|
107
|
+
## Tests at realistic sizes
|
|
108
|
+
|
|
109
|
+
- Each list, batch and write path keeps a one-line `expectFlatQueries()` test
|
|
110
|
+
whose `seed` builds the realistic size; each scoped path keeps an
|
|
111
|
+
`expectScoped()` test proving another owner's rows stay unseen and unchanged
|
|
112
|
+
([Tests](data-access.md#tests)).
|
|
113
|
+
- A capped read keeps a test that seeds past its cap and finds the row it
|
|
114
|
+
needs.
|
|
115
|
+
- Run `npm run lint`, `npx jskit check` and `npm run verify`.
|
|
116
|
+
|
|
117
|
+
## PostgreSQL
|
|
118
|
+
|
|
119
|
+
- `CREATE INDEX CONCURRENTLY` builds an index without blocking writes, but
|
|
120
|
+
cannot run in a transaction: give that migration `exports.config = {
|
|
121
|
+
transaction: false }` and nothing else, and use `DROP INDEX CONCURRENTLY` in
|
|
122
|
+
its `down()`. A failed concurrent build leaves an invalid index behind; drop
|
|
123
|
+
it before retrying.
|
|
124
|
+
- On a large table, add a foreign key or check `NOT VALID`, which takes only a
|
|
125
|
+
brief lock and enforces it for new rows, then `VALIDATE CONSTRAINT` in a
|
|
126
|
+
later migration, which reads the old rows without blocking writes.
|
|
127
|
+
- Adding a column with a constant default is instant; changing a column's type
|
|
128
|
+
rewrites the table and locks it for the whole rewrite.
|
|
129
|
+
- PostgreSQL does not index a foreign key's column for you: index it when the
|
|
130
|
+
app filters or joins by it, or deletes parent rows.
|
|
131
|
+
- A partial index (`WHERE archived_at IS NULL`) serves a filter the app always
|
|
132
|
+
applies, at a fraction of the size.
|
|
133
|
+
- Read plans with `EXPLAIN (ANALYZE, BUFFERS)`, after `ANALYZE` on freshly
|
|
134
|
+
seeded tables, so the planner sees the realistic size.
|
|
135
|
+
- Counts and sums come back as strings; compare them with `Number()` in tests.
|
|
136
|
+
|
|
137
|
+
## MySQL
|
|
138
|
+
|
|
139
|
+
- DDL commits as it goes, so a migration with several schema statements can
|
|
140
|
+
stop half-applied: one schema change per migration, written for its partial
|
|
141
|
+
states ([MySQL and MariaDB failures can leave partial schema](database-layer.md#mysql-and-mariadb-failures-can-leave-partial-schema)).
|
|
142
|
+
- Ask for an online change explicitly, `ALGORITHM=INPLACE, LOCK=NONE` (or
|
|
143
|
+
`ALGORITHM=INSTANT` to add a column), so a change that would lock the table
|
|
144
|
+
fails instead of locking it.
|
|
145
|
+
- InnoDB indexes each foreign key's column itself; an index whose leading
|
|
146
|
+
columns match makes it a duplicate.
|
|
147
|
+
- MySQL has no partial indexes; an index on the filtered column plus the owner
|
|
148
|
+
columns serves the same filter.
|
|
149
|
+
- With the `utf8mb4_0900_ai_ci` collation a unique key ignores case and accents
|
|
150
|
+
(`Soup` and `soup` collide); try a value that differs only in case when such a
|
|
151
|
+
key is a constraint.
|
|
152
|
+
- Read plans with `EXPLAIN ANALYZE` (MySQL 8.0.18 and later; `EXPLAIN` on
|
|
153
|
+
MariaDB).
|
|
154
|
+
- `information_schema` reads are slow and lock metadata: keep them in
|
|
155
|
+
migrations and checks, never on a request path.
|
|
@@ -15,7 +15,7 @@ A concrete Fastify, Vue, and JSKIT application foundation for products that do n
|
|
|
15
15
|
|
|
16
16
|
- Id: `app/minimal-foundation`
|
|
17
17
|
- Keywords: `app`, `fastify`, `foundation`, `minimal`, `server`, `vite`, `vue`
|
|
18
|
-
- Owner: `@jskit-ai/agent-docs@0.1.
|
|
18
|
+
- Owner: `@jskit-ai/agent-docs@0.1.325`
|
|
19
19
|
- Read: [PATTERN.md](patterns/app/minimal-foundation/PATTERN.md)
|
|
20
20
|
- Examples: [example/](patterns/app/minimal-foundation/example/)
|
|
21
21
|
- Requires: `@jskit-ai/http-runtime`, `@jskit-ai/kernel`
|
|
@@ -26,7 +26,7 @@ A concrete JSKIT web application foundation with responsive shell navigation, se
|
|
|
26
26
|
|
|
27
27
|
- Id: `app/shell-foundation`
|
|
28
28
|
- Keywords: `app`, `foundation`, `material`, `navigation`, `placements`, `shell`, `vite`, `vue`
|
|
29
|
-
- Owner: `@jskit-ai/agent-docs@0.1.
|
|
29
|
+
- Owner: `@jskit-ai/agent-docs@0.1.325`
|
|
30
30
|
- Read: [PATTERN.md](patterns/app/shell-foundation/PATTERN.md)
|
|
31
31
|
- Examples: [example/](patterns/app/shell-foundation/example/)
|
|
32
32
|
- Requires: `@jskit-ai/http-runtime`, `@jskit-ai/kernel`, `@jskit-ai/shell-web`
|
|
@@ -37,7 +37,7 @@ Configure an assistant runtime for one application surface and expose its chat a
|
|
|
37
37
|
|
|
38
38
|
- Id: `assistant/assistant-surface`
|
|
39
39
|
- Keywords: `ai`, `assistant`, `chat`, `config`, `environment`, `page`, `placement`, `settings`, `surface`
|
|
40
|
-
- Owner: `@jskit-ai/assistant-runtime@0.2.
|
|
40
|
+
- Owner: `@jskit-ai/assistant-runtime@0.2.65`
|
|
41
41
|
- Read: [PATTERN.md](patterns/assistant/assistant-surface/PATTERN.md)
|
|
42
42
|
- Examples: [example/](patterns/assistant/assistant-surface/example/)
|
|
43
43
|
- Requires: `@jskit-ai/assistant-runtime`, `@jskit-ai/connectors-catalog`, `@jskit-ai/connectors-core`, `@jskit-ai/shell-web`
|
|
@@ -59,7 +59,7 @@ Compose JSKIT authentication routes, views, profile controls, and public surface
|
|
|
59
59
|
|
|
60
60
|
- Id: `auth/auth-surface`
|
|
61
61
|
- Keywords: `account`, `auth`, `login`, `logout`, `password`, `placement`, `profile`, `reset`, `surface`
|
|
62
|
-
- Owner: `@jskit-ai/auth-web@0.2.
|
|
62
|
+
- Owner: `@jskit-ai/auth-web@0.2.40`
|
|
63
63
|
- Read: [PATTERN.md](patterns/auth/auth-surface/PATTERN.md)
|
|
64
64
|
- Examples: [example/](patterns/auth/auth-surface/example/)
|
|
65
65
|
- Requires: `@jskit-ai/auth-core`, `@jskit-ai/auth-web`, `@jskit-ai/shell-web`
|
|
@@ -70,7 +70,7 @@ Let people sign in with the accounts they already have in an accounts hub or ano
|
|
|
70
70
|
|
|
71
71
|
- Id: `auth/oidc-sign-in`
|
|
72
72
|
- Keywords: `accounts hub`, `auth`, `authentication`, `back-channel logout`, `dynamic client registration`, `issuer`, `master login`, `oidc`, `openid connect`, `single sign-on`, `sso`
|
|
73
|
-
- Owner: `@jskit-ai/auth-provider-oidc-core@0.2.
|
|
73
|
+
- Owner: `@jskit-ai/auth-provider-oidc-core@0.2.44`
|
|
74
74
|
- Read: [PATTERN.md](patterns/auth/oidc-sign-in/PATTERN.md)
|
|
75
75
|
- Examples: [example/](patterns/auth/oidc-sign-in/example/)
|
|
76
76
|
- Requires: `@jskit-ai/auth-provider-oidc-core`, `@jskit-ai/auth-web`
|
|
@@ -246,7 +246,7 @@ Add a protected administration surface, settings shell, and semantic navigation
|
|
|
246
246
|
|
|
247
247
|
- Id: `console/console-surface`
|
|
248
248
|
- Keywords: `admin`, `console`, `navigation`, `owner`, `placement`, `settings`, `surface`
|
|
249
|
-
- Owner: `@jskit-ai/console-web@0.1.
|
|
249
|
+
- Owner: `@jskit-ai/console-web@0.1.272`
|
|
250
250
|
- Read: [PATTERN.md](patterns/console/console-surface/PATTERN.md)
|
|
251
251
|
- Examples: [example/](patterns/console/console-surface/example/)
|
|
252
252
|
- Requires: `@jskit-ai/console-core`, `@jskit-ai/console-web`, `@jskit-ai/shell-web`
|
|
@@ -279,7 +279,7 @@ Build a routed CRUD user interface as thin application pages over JSKIT's shared
|
|
|
279
279
|
|
|
280
280
|
- Id: `crud/crud-screen-set`
|
|
281
281
|
- Keywords: `actions`, `add`, `crud`, `delete`, `edit`, `filters`, `list`, `material`, `routes`, `view`, `vue`
|
|
282
|
-
- Owner: `@jskit-ai/http-web@0.2.
|
|
282
|
+
- Owner: `@jskit-ai/http-web@0.2.43`
|
|
283
283
|
- Read: [PATTERN.md](patterns/crud/crud-screen-set/PATTERN.md)
|
|
284
284
|
- Examples: [example/](patterns/crud/crud-screen-set/example/)
|
|
285
285
|
- Requires: `@jskit-ai/http-web`, `@jskit-ai/resource-core`, `@jskit-ai/resource-crud-core`
|
|
@@ -323,7 +323,7 @@ Wrap a JSKIT web application in a Capacitor Android shell using native Capacitor
|
|
|
323
323
|
|
|
324
324
|
- Id: `mobile/android-application`
|
|
325
325
|
- Keywords: `android`, `capacitor`, `device`, `mobile`, `native`, `shell`, `webview`
|
|
326
|
-
- Owner: `@jskit-ai/mobile-capacitor@0.2.
|
|
326
|
+
- Owner: `@jskit-ai/mobile-capacitor@0.2.36`
|
|
327
327
|
- Read: [PATTERN.md](patterns/mobile/android-application/PATTERN.md)
|
|
328
328
|
- Examples: [example/](patterns/mobile/android-application/example/)
|
|
329
329
|
- Requires: `@capacitor/android`, `@capacitor/app`, `@capacitor/cli`, `@jskit-ai/mobile-capacitor`
|
|
@@ -334,7 +334,7 @@ Add JSKIT realtime events with an optional Redis backplane and an explicit shell
|
|
|
334
334
|
|
|
335
335
|
- Id: `realtime/realtime-application`
|
|
336
336
|
- Keywords: `realtime`, `redis`, `socket.io`, `sockets`, `status`, `websocket`
|
|
337
|
-
- Owner: `@jskit-ai/realtime@0.2.
|
|
337
|
+
- Owner: `@jskit-ai/realtime@0.2.39`
|
|
338
338
|
- Read: [PATTERN.md](patterns/realtime/realtime-application/PATTERN.md)
|
|
339
339
|
- Examples: [example/](patterns/realtime/realtime-application/example/)
|
|
340
340
|
- Requires: `@jskit-ai/realtime`, `@jskit-ai/shell-web`
|
|
@@ -345,7 +345,7 @@ Compose application-owned Google Publisher Tag delivery with the generic rewarde
|
|
|
345
345
|
|
|
346
346
|
- Id: `rewards/google-rewarded`
|
|
347
347
|
- Keywords: `ads`, `google`, `publisher tag`, `rewarded`, `unlock`
|
|
348
|
-
- Owner: `@jskit-ai/rewarded-web@0.2.
|
|
348
|
+
- Owner: `@jskit-ai/rewarded-web@0.2.49`
|
|
349
349
|
- Read: [PATTERN.md](patterns/rewards/google-rewarded/PATTERN.md)
|
|
350
350
|
- Examples: [example/](patterns/rewards/google-rewarded/example/)
|
|
351
351
|
- Requires: `@jskit-ai/rewarded-web`
|
|
@@ -356,7 +356,7 @@ Define a server feature through explicit capabilities and first-class actions, a
|
|
|
356
356
|
|
|
357
357
|
- Id: `server/feature-package`
|
|
358
358
|
- Keywords: `actions`, `aggregate`, `feature`, `handle`, `orchestration`, `owns`, `package`, `provider`, `repository`, `routes`, `server`, `table resource`
|
|
359
|
-
- Owner: `@jskit-ai/agent-docs@0.1.
|
|
359
|
+
- Owner: `@jskit-ai/agent-docs@0.1.325`
|
|
360
360
|
- Read: [PATTERN.md](patterns/server/feature-package/PATTERN.md)
|
|
361
361
|
- Examples: [example/](patterns/server/feature-package/example/)
|
|
362
362
|
- Requires: `@jskit-ai/kernel`
|
|
@@ -367,7 +367,7 @@ Compose the JSKIT responsive shell, semantic placements, settings navigation, an
|
|
|
367
367
|
|
|
368
368
|
- Id: `shell/application-shell`
|
|
369
369
|
- Keywords: `adaptive`, `app`, `layout`, `navigation`, `placement`, `responsive`, `settings`, `shell`
|
|
370
|
-
- Owner: `@jskit-ai/shell-web@0.2.
|
|
370
|
+
- Owner: `@jskit-ai/shell-web@0.2.36`
|
|
371
371
|
- Read: [PATTERN.md](patterns/shell/application-shell/PATTERN.md)
|
|
372
372
|
- Examples: [example/](patterns/shell/application-shell/example/)
|
|
373
373
|
- Requires: `@jskit-ai/kernel`, `@jskit-ai/shell-web`
|
|
@@ -378,7 +378,7 @@ Add product routes and shell extensions through file routing, semantic placement
|
|
|
378
378
|
|
|
379
379
|
- Id: `ui/page-and-placement`
|
|
380
380
|
- Keywords: `component`, `navigation`, `outlet`, `page`, `placement`, `routes`, `section`, `shell`, `subpages`, `vue`
|
|
381
|
-
- Owner: `@jskit-ai/shell-web@0.2.
|
|
381
|
+
- Owner: `@jskit-ai/shell-web@0.2.36`
|
|
382
382
|
- Read: [PATTERN.md](patterns/ui/page-and-placement/PATTERN.md)
|
|
383
383
|
- Examples: [example/](patterns/ui/page-and-placement/example/)
|
|
384
384
|
- Requires: `@jskit-ai/kernel`, `@jskit-ai/shell-web`
|
|
@@ -389,7 +389,7 @@ Compose an account settings route and profile, preference, notification, and sig
|
|
|
389
389
|
|
|
390
390
|
- Id: `users/account-settings`
|
|
391
391
|
- Keywords: `account`, `link provider`, `notifications`, `oauth`, `preferences`, `profile`, `settings`, `sign-in methods`, `user`, `vue`
|
|
392
|
-
- Owner: `@jskit-ai/users-web@0.2.
|
|
392
|
+
- Owner: `@jskit-ai/users-web@0.2.55`
|
|
393
393
|
- Read: [PATTERN.md](patterns/users/account-settings/PATTERN.md)
|
|
394
394
|
- Examples: [example/](patterns/users/account-settings/example/)
|
|
395
395
|
- Requires: `@jskit-ai/shell-web`, `@jskit-ai/users-core`, `@jskit-ai/users-web`
|
|
@@ -422,7 +422,7 @@ Compose workspace selection, invitation, member administration, settings, and re
|
|
|
422
422
|
|
|
423
423
|
- Id: `workspaces/workspace-surfaces`
|
|
424
424
|
- Keywords: `admin`, `invite`, `member`, `navigation`, `settings`, `surface`, `switcher`, `workspace`
|
|
425
|
-
- Owner: `@jskit-ai/workspaces-web@0.2.
|
|
425
|
+
- Owner: `@jskit-ai/workspaces-web@0.2.55`
|
|
426
426
|
- Read: [PATTERN.md](patterns/workspaces/workspace-surfaces/PATTERN.md)
|
|
427
427
|
- Examples: [example/](patterns/workspaces/workspace-surfaces/example/)
|
|
428
428
|
- Requires: `@jskit-ai/shell-web`, `@jskit-ai/workspaces-core`, `@jskit-ai/workspaces-web`
|
|
@@ -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",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@jskit-ai/config-eslint": "0.1.252",
|
|
53
|
-
"@jskit-ai/jskit-catalog": "0.2.
|
|
53
|
+
"@jskit-ai/jskit-catalog": "0.2.77",
|
|
54
54
|
"@playwright/test": "1.61.1",
|
|
55
55
|
"@vitejs/plugin-vue": "^6.0.7",
|
|
56
56
|
"eslint": "^10.8.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.77",
|
|
55
55
|
"@playwright/test": "1.61.1",
|
|
56
56
|
"@vitejs/plugin-vue": "^6.0.7",
|
|
57
57
|
"eslint": "^10.8.0",
|
|
@@ -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.
|