@pikku/skills 0.12.54 → 0.12.55
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/README.md +1 -1
- package/dist/skills.gen.js +2 -2
- package/dist/snippets.js +1 -1
- package/package.json +1 -1
- package/skills/pikku-architect/SKILL.md +1 -1
- package/skills/pikku-architect/references/plan-defects.md +7 -7
- package/skills/pikku-auth/references/better-auth.md +92 -96
- package/skills/pikku-build/SKILL.md +9 -9
- package/skills/pikku-build/references/app.md +56 -61
- package/skills/pikku-build/references/design.md +14 -14
- package/skills/pikku-build/references/feature.md +3 -3
- package/skills/pikku-build/references/mocks.md +6 -0
- package/skills/pikku-build/references/multi-app.md +16 -16
- package/skills/pikku-build/references/openapi.md +34 -34
- package/skills/pikku-build/references/platform.md +4 -5
- package/skills/pikku-build/references/post-clone.md +1 -1
- package/skills/pikku-build/references/quick.md +63 -36
- package/skills/pikku-build/references/scenarios.md +17 -16
- package/skills/pikku-build/references/ship.md +14 -16
- package/skills/pikku-build/references/theming.md +2 -2
- package/skills/pikku-changes/SKILL.md +2 -5
- package/skills/pikku-concepts/SKILL.md +26 -27
- package/skills/pikku-concepts/references/language.md +6 -6
- package/skills/pikku-deploy/references/nextjs.md +1 -1
- package/skills/pikku-guide/SKILL.md +18 -17
- package/skills/pikku-i18n/references/messages.md +5 -6
- package/skills/pikku-knowledge/SKILL.md +3 -3
- package/skills/pikku-meta/references/audit.md +1 -1
- package/skills/pikku-permissions/SKILL.md +1 -1
- package/skills/pikku-react/SKILL.md +18 -20
- package/skills/pikku-react/references/client.md +2 -37
- package/skills/pikku-report/SKILL.md +10 -10
- package/skills/pikku-scenario/SKILL.md +63 -66
- package/skills/pikku-scenario/references/browser.md +5 -5
- package/skills/pikku-scenario/references/coverage.md +4 -4
- package/skills/pikku-scenario/references/steps.md +31 -30
- package/skills/pikku-scenario/references/{persona-run.md → virtual-user-run.md} +38 -43
- package/skills/pikku-scenario/references/virtual-users.md +114 -0
- package/skills/pikku-seo/SKILL.md +1 -1
- package/skills/pikku-services/references/audit-wire-service.md +2 -2
- package/skills/pikku-services/references/audit.md +1 -2
- package/skills/pikku-services/references/services.md +1 -1
- package/skills/pikku-software-archaeology/SKILL.md +13 -13
- package/skills/pikku-software-archaeology/references/blueprint.schema.json +9 -9
- package/skills/pikku-theme/SKILL.md +1 -1
- package/skills/pikku-workflow/SKILL.md +1 -1
- package/skills/pikku-admin-to-fabric/SKILL.md +0 -198
- package/skills/pikku-blueprint-to-fabric/SKILL.md +0 -362
- package/skills/pikku-blueprint-to-fabric/scripts/inventory.mjs +0 -367
- package/skills/pikku-fabric/SKILL.md +0 -331
- package/skills/pikku-fabric/references/database.md +0 -128
- package/skills/pikku-fabric/references/debugging.md +0 -114
- package/skills/pikku-fabric/references/deploy.md +0 -179
- package/skills/pikku-scenario/references/personas.md +0 -123
|
@@ -65,7 +65,7 @@ which is what decides whether a thrown error becomes a 409 or a 500.
|
|
|
65
65
|
|
|
66
66
|
- **Worked examples are sparse.** Most exports show a signature and keys, not usage.
|
|
67
67
|
- **`pikkuFunc` lists keys that belong elsewhere.** `before`, `after`, `skip`, `surfaces` and
|
|
68
|
-
`
|
|
68
|
+
`requiresVirtualUser` apply only to scenarios; `workflowQueued`, `workflowRetries` and
|
|
69
69
|
`workflowTimeout` only to a workflow step. One shared config type offers all of them to
|
|
70
70
|
every function — each key says which it belongs to.
|
|
71
71
|
|
|
@@ -96,35 +96,34 @@ flags; the "Read" column is the skill that teaches the thing, where one does.
|
|
|
96
96
|
|
|
97
97
|
**Running**
|
|
98
98
|
|
|
99
|
-
| Command
|
|
100
|
-
|
|
|
101
|
-
| `dev`
|
|
102
|
-
| `serve`
|
|
103
|
-
| `watch`
|
|
104
|
-
| `scenario list\|run`
|
|
105
|
-
| `
|
|
106
|
-
| `
|
|
107
|
-
| `db`
|
|
99
|
+
| Command | What it does | Read |
|
|
100
|
+
| --------------------------------- | ------------------------------------------------------------------------------ | -------------------------------------------- |
|
|
101
|
+
| `dev` | Local dev server, all services wired, watch + HMR | `pikku-build` |
|
|
102
|
+
| `serve` | Bundled bun/node runner — no watch, no codegen | `pikku-deploy` |
|
|
103
|
+
| `watch` | Regenerate on file change, without a server | — |
|
|
104
|
+
| `scenario list\|run` | Scenarios as e2e tests and health checks | `pikku-scenario` |
|
|
105
|
+
| `virtual-user run` | A declared virtual user, model-driven, against a stage | `pikku-scenario`, virtual-user-run reference |
|
|
106
|
+
| `virtual-user list\|sync\|secret` | Who is declared; what an environment will provision; minting their credentials | `pikku-scenario`, virtual-user-run reference |
|
|
107
|
+
| `db` | Local development database | `pikku-kysely` |
|
|
108
108
|
|
|
109
109
|
**Inspecting and evolving**
|
|
110
110
|
|
|
111
|
-
| Command
|
|
112
|
-
|
|
|
113
|
-
| `doc`
|
|
114
|
-
| `meta` / `info`
|
|
115
|
-
| `validate`
|
|
116
|
-
| `versions` / `release` | Contract hashes, breaking-change detection, versioned releases
|
|
117
|
-
| `audit` / `update`
|
|
118
|
-
| `scopes` / `roles`
|
|
119
|
-
| `knowledge`
|
|
120
|
-
| `emails`
|
|
111
|
+
| Command | What it does | Read |
|
|
112
|
+
| ---------------------- | ----------------------------------------------------------------------- | ---------------------------- |
|
|
113
|
+
| `doc` | The installed API surface | this skill |
|
|
114
|
+
| `meta` / `info` | What the project declares, machine- and human-readable | `pikku-meta` |
|
|
115
|
+
| `validate` | Every check that applies — app structure, an addon's published file set | `pikku-build`, `pikku-addon` |
|
|
116
|
+
| `versions` / `release` | Contract hashes, breaking-change detection, versioned releases | `pikku-meta` |
|
|
117
|
+
| `audit` / `update` | Advisories; which `@pikku/*` can move and what peers that needs | `pikku-meta` |
|
|
118
|
+
| `scopes` / `roles` | Declared authorization scopes; roles from `defineSystemRole` | `pikku-auth` |
|
|
119
|
+
| `knowledge` | The knowledge base — what this app is, in its users' language | `pikku-knowledge` |
|
|
120
|
+
| `emails` | Email template generation | `pikku-emails` |
|
|
121
121
|
|
|
122
122
|
**Shipping, and the CLI itself**
|
|
123
123
|
|
|
124
124
|
| Command | What it does | Read |
|
|
125
125
|
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
|
|
126
126
|
| `deploy` | Deploy to cloud infrastructure | `pikku-deploy` |
|
|
127
|
-
| `fabric` | PikkuFabric: login, link, deploy, domains, secrets, logs | `pikku-fabric` |
|
|
128
127
|
| `binary` | Compile an entrypoint to a native binary (`bun build --compile`) | — |
|
|
129
128
|
| `dist` | Copy what `tsc` cannot emit — `.gen.json` meta, hand-authored `.d.ts` — into the build output. Run it after `tsc`, as a package's build script | — |
|
|
130
129
|
| `login` / `logout` / `whoami` | The CLI's session against a pikku server | — |
|
|
@@ -298,7 +297,7 @@ a Workers or serverless stage needs done belongs on the request path that needs
|
|
|
298
297
|
where Pikku is embedded in a server you own. Lifecycle hooks do not run on this path; do the
|
|
299
298
|
startup work in the entrypoint.
|
|
300
299
|
|
|
301
|
-
`pikku validate` warns when a project starts a server by hand
|
|
300
|
+
`pikku validate` warns when a project starts a server by hand _and_ depends on no runtime adapter,
|
|
302
301
|
because that means the first path was available and unused.
|
|
303
302
|
|
|
304
303
|
**`references/bootstrap.md`** has both entrypoints in full.
|
|
@@ -355,17 +354,17 @@ src/
|
|
|
355
354
|
Three different things in a Pikku project have a human language, and they are **not** the same
|
|
356
355
|
language. Collapsing them is the common mistake:
|
|
357
356
|
|
|
358
|
-
| Axis | Covers | Decided by
|
|
359
|
-
| --------------- | ----------------------------------------------------------------------------- |
|
|
360
|
-
| **Identifiers** | Function, component, type and file names; tables and columns; commit messages | Nothing. **Always English.** There is no setting
|
|
361
|
-
| **Meta** | Prose authored inside the code — `description`, `title`, step `template` | `metaLocale` in `pikku.config.json` (default `en`)
|
|
357
|
+
| Axis | Covers | Decided by |
|
|
358
|
+
| --------------- | ----------------------------------------------------------------------------- | ------------------------------------------------------------- |
|
|
359
|
+
| **Identifiers** | Function, component, type and file names; tables and columns; commit messages | Nothing. **Always English.** There is no setting |
|
|
360
|
+
| **Meta** | Prose authored inside the code — `description`, `title`, step `template` | `metaLocale` in `pikku.config.json` (default `en`) |
|
|
362
361
|
| **Product UI** | Every string the app shows a user | `messages/<locale>.json`, and `active.json`'s `defaultLocale` |
|
|
363
362
|
|
|
364
363
|
Identifiers are the surface every other tool binds to — the generated clients, the RPC map a
|
|
365
364
|
scenario is typed over, the SQL types — and unlike a string an identifier cannot be translated
|
|
366
365
|
later: renaming one is a migration. `metaLocale` exists so a team can read their own Console in
|
|
367
366
|
their own language; it is not licence to rename anything. And `baseLocale` in
|
|
368
|
-
`project.inlang/settings.json` stays `en`, because it names the message
|
|
367
|
+
`project.inlang/settings.json` stays `en`, because it names the message _source_ every other
|
|
369
368
|
language is cloned from.
|
|
370
369
|
|
|
371
370
|
**When a brief tells you the product speaks a language, it is telling you about the third axis and
|
|
@@ -5,11 +5,11 @@ Three different things in a Pikku project have a human language, and they are
|
|
|
5
5
|
prevent, and it has already shipped in a real product — the failure is at the
|
|
6
6
|
bottom.
|
|
7
7
|
|
|
8
|
-
| Axis | What it covers
|
|
9
|
-
| --------------- |
|
|
10
|
-
| **Identifiers** | Function, component, type, variable and file names. Database tables and columns. Branch names and commit messages.
|
|
11
|
-
| **Meta** | The prose authored _inside_ the code: `description` on functions and steps, `name`/`title` on features and scenarios, step `template`, role/
|
|
12
|
-
| **Product UI** | Every string the app shows a user.
|
|
8
|
+
| Axis | What it covers | What decides it |
|
|
9
|
+
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
|
10
|
+
| **Identifiers** | Function, component, type, variable and file names. Database tables and columns. Branch names and commit messages. | Nothing. **Always English.** There is no setting. |
|
|
11
|
+
| **Meta** | The prose authored _inside_ the code: `description` on functions and steps, `name`/`title` on features and scenarios, step `template`, role/virtual-user descriptions. | `metaLocale` in `pikku.config.json`. Defaults to `en`. |
|
|
12
|
+
| **Product UI** | Every string the app shows a user. | `messages/<locale>.json`, with `active.json`'s `defaultLocale` choosing what a first-time visitor opens in. |
|
|
13
13
|
|
|
14
14
|
## Identifiers are English, and nothing changes that
|
|
15
15
|
|
|
@@ -19,7 +19,7 @@ all get `getOverview`, `AttentionStripe`, `case`, `event`.
|
|
|
19
19
|
|
|
20
20
|
This is not linguistic preference, it is mechanics. Identifiers are the surface
|
|
21
21
|
every other tool binds to: the generated `#pikku/*` clients, `pikku info` and
|
|
22
|
-
`pikku meta`, the RPC map a scenario's `
|
|
22
|
+
`pikku meta`, the RPC map a scenario's `virtualUser.invoke` is typed over, the
|
|
23
23
|
generated SQL types, every skill and every agent that ever picks the project up.
|
|
24
24
|
A `vorgang` table types as `Vorgang` in Kysely and reads as noise to everyone who
|
|
25
25
|
did not name it, and unlike a string it cannot be translated later — renaming an
|
|
@@ -88,7 +88,7 @@ route definitions.
|
|
|
88
88
|
|
|
89
89
|
- **`PikkuNextJSWorkerRPC({ fetcher })`** — same surface as `PikkuNextJS`, but
|
|
90
90
|
every call is dispatched through a `Fetcher` (a Cloudflare service binding, a
|
|
91
|
-
local HTTP client, a
|
|
91
|
+
local HTTP client, a dispatcher worker) instead of loading function code
|
|
92
92
|
in-process. Use it to keep functions out of the SSR bundle. A non-2xx response
|
|
93
93
|
throws with the status and body text.
|
|
94
94
|
- **`toNextJsAuthHandler(auth)`** — wraps a better-auth instance or handler
|
|
@@ -20,11 +20,11 @@ A guide is the app explained to the people who use it, with the scenario suite
|
|
|
20
20
|
as its evidence. The suite proves what the product does and photographs it
|
|
21
21
|
doing it; the pages say what that means for the reader and how to do it.
|
|
22
22
|
|
|
23
|
-
| Input
|
|
24
|
-
|
|
25
|
-
| Structure | `pikkuFeature` meta — which features exist, and that every one is cited
|
|
26
|
-
| Evidence
|
|
27
|
-
| Prose
|
|
23
|
+
| Input | Comes from | Owned by |
|
|
24
|
+
| --------- | ---------------------------------------------------------------------------------- | --------- |
|
|
25
|
+
| Structure | `pikkuFeature` meta — which features exist, and that every one is cited | the suite |
|
|
26
|
+
| Evidence | the latest passing run under `.pikku/scenario-runs/` — recordings and screenshots | the run |
|
|
27
|
+
| Prose | markdown pages under `docs/` (or `--docs <dir>`) — **every word the reader reads** | you |
|
|
28
28
|
|
|
29
29
|
**The run contributes pictures, never words.** Step sentences, scenario
|
|
30
30
|
descriptions and feature names are written to prove a test; none of them
|
|
@@ -108,7 +108,7 @@ mechanical, and skipping it is how sections end up with no figure or with a
|
|
|
108
108
|
figure of something else.
|
|
109
109
|
|
|
110
110
|
1. **Inventory.** List every `pikkuFeature` and, under each, its scenarios with
|
|
111
|
-
their
|
|
111
|
+
their virtual user and the screen each one ends on. Read the scenario files, not
|
|
112
112
|
just the names.
|
|
113
113
|
2. **Outline.** Group the scenarios into reader jobs (pages) and tasks
|
|
114
114
|
(sections). A section is usually one scenario; two scenarios that show the
|
|
@@ -161,10 +161,10 @@ covers, or mark it `document: false`.
|
|
|
161
161
|
|
|
162
162
|
Two strings from the suite reach the page as captions:
|
|
163
163
|
|
|
164
|
-
| Figure
|
|
165
|
-
|
|
166
|
-
| Screenshot | the `name` it was taken under
|
|
167
|
-
| Recording
|
|
164
|
+
| Figure | Caption |
|
|
165
|
+
| ---------- | ------------------------------------------------------------------------------ |
|
|
166
|
+
| Screenshot | the `name` it was taken under |
|
|
167
|
+
| Recording | the scenario's `title` (plus `—` and the virtual user, when there are several) |
|
|
168
168
|
|
|
169
169
|
Write both as a reader-facing caption in the app's language: "Die Buchung mit
|
|
170
170
|
Status, Eckdaten und Reitern", "the course list, with places left on each
|
|
@@ -179,6 +179,7 @@ Every scenario a section cites should take one showcase screenshot of the state
|
|
|
179
179
|
the section describes. Add the capture step once:
|
|
180
180
|
|
|
181
181
|
```ts snippet:guideCaptureStep
|
|
182
|
+
|
|
182
183
|
```
|
|
183
184
|
|
|
184
185
|
- Without `path` it photographs the screen the flow is on. Call it **after the
|
|
@@ -194,11 +195,11 @@ the section describes. Add the capture step once:
|
|
|
194
195
|
|
|
195
196
|
### The camera sees your seed data
|
|
196
197
|
|
|
197
|
-
Every figure shows whatever the scenario's
|
|
198
|
+
Every figure shows whatever the scenario's virtual users and seed rows contain, so
|
|
198
199
|
they are part of the documentation:
|
|
199
200
|
|
|
200
|
-
- A
|
|
201
|
-
"test-user-3" is on every page of the guide; give
|
|
201
|
+
- A virtual user's display name is in the header of every shot. "Scenario Admin" or
|
|
202
|
+
"test-user-3" is on every page of the guide; give virtual users plausible names
|
|
202
203
|
and roles.
|
|
203
204
|
- Seed rows are the example data a reader sees: in the app's language, the
|
|
204
205
|
shape real data takes — no lorem ipsum, no English description inside a
|
|
@@ -208,14 +209,14 @@ they are part of the documentation:
|
|
|
208
209
|
### Traps that make a figure missing or wrong
|
|
209
210
|
|
|
210
211
|
- **RPC-only scenarios file no screenshot.** The command warns `whose run filed
|
|
211
|
-
|
|
212
|
+
no screenshot — the block renders empty`. Add a browser capture, or do not
|
|
212
213
|
cite that scenario.
|
|
213
214
|
- **A capture loop must iterate a named const.** `for (const s of [ … ])` with
|
|
214
215
|
an inline array literal cannot be extracted (PKU679) and the scenario is
|
|
215
216
|
silently empty. `const screens = [ … ] as const`, then `for (const s of screens)`.
|
|
216
217
|
- **A capture before an assertion moves the page from under it.** Capture last,
|
|
217
218
|
or re-navigate.
|
|
218
|
-
- **A redirect photographs the wrong screen.** A first-time
|
|
219
|
+
- **A redirect photographs the wrong screen.** A first-time virtual user bounced to
|
|
219
220
|
onboarding, a consent dialog, a login — the shot is named "the map" and shows
|
|
220
221
|
something else. Finish the redirecting flow in the scenario first, and look
|
|
221
222
|
at the image.
|
|
@@ -284,8 +285,8 @@ the second is clean. Commit the lock; never hand-edit or hand-merge it.
|
|
|
284
285
|
language: why and when, numbered steps naming controls as they read,
|
|
285
286
|
what you see, what goes wrong.
|
|
286
287
|
- [ ] Captions (screenshot names, scenario titles) are reader copy — no routes,
|
|
287
|
-
sizes, test ids or
|
|
288
|
-
- [ ]
|
|
288
|
+
sizes, test ids or virtual user names.
|
|
289
|
+
- [ ] Virtual users and seed data on camera look like real use, in the app's
|
|
289
290
|
language.
|
|
290
291
|
- [ ] Every feature is cited or `document: false`; no `--allow-undocumented`.
|
|
291
292
|
- [ ] Built from a full, passing `--run browser --screenshots` run; no "block
|
|
@@ -49,7 +49,7 @@ like it works, because the app does come up in that language, and then:
|
|
|
49
49
|
- a message missing from a locale falls back to a catalogue nobody wrote
|
|
50
50
|
|
|
51
51
|
The setting that actually decides what a first-time visitor sees is
|
|
52
|
-
`defaultLocale`, held in `apps/app/src/i18n/active.json` in the
|
|
52
|
+
`defaultLocale`, held in `apps/app/src/i18n/active.json` in the app
|
|
53
53
|
template and read by `src/i18n/config.ts`. It is deliberately a separate file
|
|
54
54
|
from `settings.json` for exactly this reason — the source language and the
|
|
55
55
|
served language are different questions.
|
|
@@ -67,12 +67,11 @@ So a German medical portal is **three** settings, not one:
|
|
|
67
67
|
{ "metaLocale": "de" }
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
them by hand:
|
|
70
|
+
Edit the first two by hand:
|
|
72
71
|
|
|
73
72
|
```sh
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
# add "de" to locales and seed messages/de.json from en.json
|
|
74
|
+
# set defaultLocale to "de" in active.json — the app now OPENS in German
|
|
76
75
|
```
|
|
77
76
|
|
|
78
77
|
### The failure this is written from
|
|
@@ -190,7 +189,7 @@ The gate catches _invalid_ messages but not _inlined_ strings. The starter templ
|
|
|
190
189
|
2. Add `"fr"` to `locales` in `project.inlang/settings.json`. **Leave `baseLocale` at `en`** — step 1 only works because there is an English catalogue to mirror.
|
|
191
190
|
3. Recompile (restart/`vite dev` or the CLI compile). A locale file missing keys falls back to the base locale per message.
|
|
192
191
|
4. Content is reachable via the `/<lang>` URL prefix (`detectLocale` already resolves it); the base locale needs no prefix. Expose the switcher via `useLocale().setLocale`.
|
|
193
|
-
5. Only if the app should **open** in the new language rather than merely offer it: set `defaultLocale` (`active.json`
|
|
192
|
+
5. Only if the app should **open** in the new language rather than merely offer it: set `defaultLocale` (`active.json`). Adding a locale and changing the default are different asks — do the second only when asked.
|
|
194
193
|
|
|
195
194
|
## i18n debug mode (find inlined strings)
|
|
196
195
|
|
|
@@ -205,7 +205,7 @@ It is a **summary, not the note** — the argument continues in prose underneath
|
|
|
205
205
|
| `table:` | a table name | the generated db schema |
|
|
206
206
|
| `addon:` | `@pikku/addon-x` or bare `x` | the manifests that declare the dependency |
|
|
207
207
|
| `scope:` | a scope name | the `scopes:` a function gates itself with, plus the scopes a `defineSystemRole()` confers |
|
|
208
|
-
| `
|
|
208
|
+
| `virtualUser:` | a virtual user name | `defineVirtualUsers()` |
|
|
209
209
|
|
|
210
210
|
Ids are case-sensitive: `createEntry` is not `createentry`.
|
|
211
211
|
|
|
@@ -219,7 +219,7 @@ These are all things that exist somewhere better, so a note is always the copy t
|
|
|
219
219
|
|
|
220
220
|
| Do not write | Because it lives in |
|
|
221
221
|
| ----------------------------------- | ---------------------------------------------------------- |
|
|
222
|
-
| a `
|
|
222
|
+
| a `virtual users/` section | `defineVirtualUsers()` in the project's own code |
|
|
223
223
|
| a `scenarios/` section | the `scenarios` of the plan for the changeset that builds it |
|
|
224
224
|
| a `permissions/` section | a decision note under `decisions/security/` |
|
|
225
225
|
| a list of tables, columns or routes | `pikku meta` — the generated schema _is_ the schema |
|
|
@@ -270,4 +270,4 @@ Notes are different: they say what the app is now, so they change whenever it do
|
|
|
270
270
|
|
|
271
271
|
OKF permits frontmatter fields a reader does not know, and the parser ignores them rather than failing. That is the extension point: a tool layered on Pikku can add its own sections and fields on top of everything above without forking the format.
|
|
272
272
|
|
|
273
|
-
|
|
273
|
+
One exists: it adds `decisions/design/` — rules about how the app looks and behaves — and a `screens/` section. Both are the extending tool's to validate; `pikku knowledge validate` passes them through untouched. Everything else in this skill is the same in both.
|
|
@@ -115,7 +115,7 @@ is admin-only), so the host must have Better Auth wired — see `pikku-auth`.
|
|
|
115
115
|
**remediation slot**.
|
|
116
116
|
- `renderRemediation({ pkg, version, issue })` — the extension seam. OSS default
|
|
117
117
|
is `UpdateDependencyButton` (the free bump + `bun install`). Downstream
|
|
118
|
-
consoles
|
|
118
|
+
consoles pass their own sandbox-verified action here — replace the
|
|
119
119
|
action, keep the view.
|
|
120
120
|
- Hooks: `useSecurityAudit` (read), `useRunSecurityAudit` (run),
|
|
121
121
|
`useUpdateDependency` (bump). All are `useMutation`/`useQuery` — surface
|
|
@@ -3,7 +3,7 @@ name: pikku-permissions
|
|
|
3
3
|
description: >-
|
|
4
4
|
Use when deciding WHO may call a function: resource ownership, role gates, admin-only actions, or any "only their own rows" rule. Covers the `permissions` field, `pikkuPermission`, `pikkuAuth`, scopes and `defineScope`, `addGlobalPermission`, the three gates, `permissionsInBody`, and where ownership belongs versus where it does not.
|
|
5
5
|
TRIGGER when: writing or reviewing any function that touches a row a user owns, gating an action on a role, building the permissions half of a contract in build PHASE 2, about to write an `if` in a function body that decides whether the caller is allowed, or hitting `MissingScopeError`.
|
|
6
|
-
DO NOT TRIGGER when: the question is how a caller proves who they are, such as sign-in, sessions, tokens, API keys or seeding a
|
|
6
|
+
DO NOT TRIGGER when: the question is how a caller proves who they are, such as sign-in, sessions, tokens, API keys or seeding a virtual user (use pikku-auth), or how to shape a paginated list (use pikku-list-query).
|
|
7
7
|
installGroups: [core]
|
|
8
8
|
---
|
|
9
9
|
|
|
@@ -3,10 +3,8 @@ name: pikku-react
|
|
|
3
3
|
description: >-
|
|
4
4
|
Use when a React frontend talks to a Pikku backend — PikkuProvider and createPikku at the app
|
|
5
5
|
root, the generated React Query hooks (usePikkuQuery, usePikkuMutation, usePikkuInfiniteQuery),
|
|
6
|
-
direct usePikkuRPC / usePikkuFetch calls, realtime subscriptions, agent and workflow hooks
|
|
7
|
-
|
|
8
|
-
data, wiring PikkuProvider, paginating, running or tracking a workflow from the client, or
|
|
9
|
-
asking about useDevActors / DevActorSwitcher / quick login. DO NOT TRIGGER when: working on the
|
|
6
|
+
direct usePikkuRPC / usePikkuFetch calls, realtime subscriptions, and agent and workflow hooks. TRIGGER when: writing a React component that fetches or mutates backend
|
|
7
|
+
data, wiring PikkuProvider, paginating, running or tracking a workflow from the client. DO NOT TRIGGER when: working on the
|
|
10
8
|
backend (use pikku-wiring), defining the workflow itself (use pikku-workflow), rendering fetched values such as
|
|
11
9
|
dates (use pikku-tailwind), or writing user-facing copy (use pikku-i18n).
|
|
12
10
|
installGroups: [client]
|
|
@@ -21,25 +19,25 @@ stops.
|
|
|
21
19
|
|
|
22
20
|
## Pick the reference
|
|
23
21
|
|
|
24
|
-
| You are…
|
|
25
|
-
|
|
|
26
|
-
| Wiring the app root, resolving the server URL, authenticating, or subscribing to realtime | `references/client.md`
|
|
27
|
-
| Fetching, mutating or paginating data
|
|
28
|
-
| Starting a workflow and showing its progress
|
|
22
|
+
| You are… | Read |
|
|
23
|
+
| ----------------------------------------------------------------------------------------- | --------------------------- |
|
|
24
|
+
| Wiring the app root, resolving the server URL, authenticating, or subscribing to realtime | `references/client.md` |
|
|
25
|
+
| Fetching, mutating or paginating data | `references/react-query.md` |
|
|
26
|
+
| Starting a workflow and showing its progress | `references/workflows.md` |
|
|
29
27
|
|
|
30
28
|
## Reach for what
|
|
31
29
|
|
|
32
|
-
| Need
|
|
33
|
-
|
|
|
34
|
-
| Render data, dedupe and cache
|
|
35
|
-
| Trigger a write and wait for the result
|
|
36
|
-
| Paginate
|
|
37
|
-
| One-off call from an event handler
|
|
38
|
-
| Hit a REST endpoint rather than an RPC
|
|
39
|
-
| Talk to one named AI agent
|
|
40
|
-
| Run one named workflow
|
|
41
|
-
| A workflow long enough to need progress UI | `references/workflows.md`
|
|
42
|
-
| Subscribe to events, SSE or a channel
|
|
30
|
+
| Need | Use |
|
|
31
|
+
| ------------------------------------------ | -------------------------------------------------------- |
|
|
32
|
+
| Render data, dedupe and cache | `usePikkuQuery` |
|
|
33
|
+
| Trigger a write and wait for the result | `usePikkuMutation` |
|
|
34
|
+
| Paginate | `usePikkuInfiniteQuery` |
|
|
35
|
+
| One-off call from an event handler | `usePikkuRPC()` |
|
|
36
|
+
| Hit a REST endpoint rather than an RPC | `usePikkuFetch()` |
|
|
37
|
+
| Talk to one named AI agent | `usePikkuAgent(name)` → `.run` / `.stream` / `.approve` |
|
|
38
|
+
| Run one named workflow | `usePikkuWorkflow(name)` → `.start` / `.run` / `.status` |
|
|
39
|
+
| A workflow long enough to need progress UI | `references/workflows.md` |
|
|
40
|
+
| Subscribe to events, SSE or a channel | `usePikkuRealtime()` |
|
|
43
41
|
|
|
44
42
|
A workflow that finishes in a moment can be awaited; one that does not needs
|
|
45
43
|
start-plus-observe, or the component holds a pending state with nothing to show.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
# Pikku React
|
|
2
2
|
|
|
3
|
-
|
|
4
3
|
What is here:
|
|
5
4
|
|
|
6
5
|
- [What ships](#what-ships)
|
|
@@ -174,8 +173,8 @@ helpers live in **pikku-wiring**.
|
|
|
174
173
|
| Hit a REST endpoint (not RPC) | `usePikkuFetch()` |
|
|
175
174
|
| Run one named workflow | `usePikkuWorkflow('name')` → `.start/.run/.status` |
|
|
176
175
|
| Talk to one named AI agent | `usePikkuAgent('name')` → `.run/.stream/.approve` |
|
|
177
|
-
| Longer-running workflow UX | `references/workflows.md`
|
|
178
|
-
| Subscribe to events / SSE / channel | `usePikkuRealtime()` (see **pikku-wiring**)
|
|
176
|
+
| Longer-running workflow UX | `references/workflows.md` |
|
|
177
|
+
| Subscribe to events / SSE / channel | `usePikkuRealtime()` (see **pikku-wiring**) |
|
|
179
178
|
|
|
180
179
|
The first three live in your generated `api.gen.ts` (see the
|
|
181
180
|
`references/react-query.md`). This reference covers the rest.
|
|
@@ -240,40 +239,6 @@ pikku.fetch.setHeader('x-tenant', tenantId)
|
|
|
240
239
|
`authHeaders.jwt` becomes `Authorization: Bearer …` and `authHeaders.apiKey`
|
|
241
240
|
becomes `X-API-KEY`; setting a JWT takes precedence over an API key.
|
|
242
241
|
|
|
243
|
-
### Dev actor sign-in (`useDevActors`)
|
|
244
|
-
|
|
245
|
-
The dev-only "Sign in as …" control: one click signs in as a declared scenario
|
|
246
|
-
persona with no password, so the app can be reviewed as each kind of user.
|
|
247
|
-
`pikku fabric validate` **requires** any frontend with a login screen to ship one
|
|
248
|
-
(`app-missing-actor-quick-login-<app>`) — without it a reviewer is locked out of
|
|
249
|
-
their own sandbox.
|
|
250
|
-
|
|
251
|
-
```tsx
|
|
252
|
-
import { useDevActors } from '@pikku/react'
|
|
253
|
-
|
|
254
|
-
const { actors, signInAs, pendingId, isPending, error } = useDevActors({
|
|
255
|
-
apiUrl: apiUrl(),
|
|
256
|
-
app: appSlug,
|
|
257
|
-
onSignedIn: () => navigate({ to: '/' }),
|
|
258
|
-
})
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
- **It is UI-free**, so render it however you like. For the default rendering use
|
|
262
|
-
the starter template's `<DevActorSwitcher />` (`components/dev/DevActorSwitcher.tsx`).
|
|
263
|
-
- **No credential reaches the bundle.** It lists from `/auth/sign-in/personas`
|
|
264
|
-
and `signInAs(id)` posts only the persona id to `/auth/sign-in/persona`. The
|
|
265
|
-
server decides who is offered and who may sign in, and offers nobody in
|
|
266
|
-
production — see **pikku-scenario** for `personaSignIn`.
|
|
267
|
-
- **It takes `onSignedIn` rather than a router**, since every app lands
|
|
268
|
-
somewhere different.
|
|
269
|
-
- `listDevActors()` and `signInAsPersona()` are exported too, for a non-React
|
|
270
|
-
caller. The endpoint only
|
|
271
|
-
signs in rows flagged `actor: true`, so it can never impersonate a real user —
|
|
272
|
-
see **pikku-auth**.
|
|
273
|
-
|
|
274
|
-
Do not hand-write the list-and-sign-in pair per app; that copy-paste is exactly
|
|
275
|
-
what this replaced.
|
|
276
|
-
|
|
277
242
|
## What NOT to do
|
|
278
243
|
|
|
279
244
|
- Don't instantiate `PikkuFetch`/`PikkuRPC` inside a component — `createPikku`
|
|
@@ -3,17 +3,17 @@ name: pikku-report
|
|
|
3
3
|
description: >-
|
|
4
4
|
Use when pikku itself cost you time — wrong generated types, a check that passes when it should
|
|
5
5
|
not, output that is quietly wrong, a skill that misled you — or when the user asks you to report
|
|
6
|
-
a framework bug or file a finding. Owns `pikku
|
|
6
|
+
a framework bug or file a finding. Owns `pikku cloud report` (a finding is about pikku, not the
|
|
7
7
|
app), the product-vs-harness kinds, the workaround-first ladder, and asking the user at hand-over
|
|
8
8
|
whether to send what was filed. TRIGGER when: the framework fought you, codegen produced
|
|
9
9
|
something broken, a skill told you to run something that does not exist, the user says "report
|
|
10
10
|
this to pikku" / "file a finding", or you are handing over a build. DO NOT TRIGGER when: the bug
|
|
11
|
-
is in the app you are building (fix it there), you are debugging a deployed stage
|
|
12
|
-
|
|
11
|
+
is in the app you are building (fix it there), you are debugging a deployed stage,
|
|
12
|
+
or you are tempted to patch pikku's source (never do that from an app).
|
|
13
13
|
installGroups: [core]
|
|
14
14
|
---
|
|
15
15
|
|
|
16
|
-
# Report a finding to
|
|
16
|
+
# Report a finding to Pikku Studio Cloud
|
|
17
17
|
|
|
18
18
|
A finding is about **pikku**, not about the app you are building. It is how the
|
|
19
19
|
framework learns what cost its users time — the bug, the misleading skill, the
|
|
@@ -21,7 +21,7 @@ silence where a check should have complained.
|
|
|
21
21
|
|
|
22
22
|
File each one the moment it happens. Nothing leaves the machine until the user
|
|
23
23
|
says so at hand-over, and nothing is written to the repository. The command is
|
|
24
|
-
spelled `pikku
|
|
24
|
+
spelled `pikku cloud report` — there is no top-level report command.
|
|
25
25
|
|
|
26
26
|
## Report at the moment it happens
|
|
27
27
|
|
|
@@ -75,7 +75,7 @@ follows it. Quote the heredoc delimiter (`<<'EOF'`, never `<<EOF`) so the shell
|
|
|
75
75
|
leaves the body alone.
|
|
76
76
|
|
|
77
77
|
```bash
|
|
78
|
-
pikku
|
|
78
|
+
pikku cloud report --stdin <<'EOF'
|
|
79
79
|
{
|
|
80
80
|
"title": "<one-line title>",
|
|
81
81
|
"kind": "product",
|
|
@@ -88,7 +88,7 @@ pikku fabric report --stdin <<'EOF'
|
|
|
88
88
|
EOF
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
-
The same fields exist as flags for a finding short enough to type; `pikku
|
|
91
|
+
The same fields exist as flags for a finding short enough to type; `pikku cloud
|
|
92
92
|
report --help` lists them. Whichever path you use, the rules below are checked
|
|
93
93
|
before anything is sent:
|
|
94
94
|
|
|
@@ -116,7 +116,7 @@ The last thing in the hand-over — after the app runs, and is deployed if they
|
|
|
116
116
|
chose to — is:
|
|
117
117
|
|
|
118
118
|
```bash
|
|
119
|
-
pikku
|
|
119
|
+
pikku cloud report
|
|
120
120
|
```
|
|
121
121
|
|
|
122
122
|
With no finding, it lists what this build filed. What happens next depends on
|
|
@@ -130,12 +130,12 @@ what the user said before, which the CLI keeps on their machine:
|
|
|
130
130
|
**Never**. Then run it again with their answer:
|
|
131
131
|
|
|
132
132
|
```bash
|
|
133
|
-
pikku
|
|
133
|
+
pikku cloud report --consent yes|no|always|never
|
|
134
134
|
```
|
|
135
135
|
|
|
136
136
|
Yes sends and No discards what is held now; Always and Never are saved and the
|
|
137
137
|
question is not asked again. If nobody answers, leave them held and say that
|
|
138
|
-
`pikku
|
|
138
|
+
`pikku cloud report` sends them later.
|
|
139
139
|
|
|
140
140
|
Findings are anonymous: no account, no project. The receipt printed when you
|
|
141
141
|
filed each one is exactly what leaves the machine. A send that fails keeps what
|