@pikku/skills 0.12.21 → 0.12.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/CHANGELOG.md +125 -0
  2. package/dist/skills.gen.js +1 -1
  3. package/package.json +1 -1
  4. package/skills/pikku-addon/SKILL.md +10 -9
  5. package/skills/pikku-agent/SKILL.md +67 -316
  6. package/skills/pikku-agent/references/agents.md +299 -0
  7. package/skills/{pikku-ai-vercel/SKILL.md → pikku-agent/references/runner-vercel.md} +2 -24
  8. package/skills/{pikku-ai-voice/SKILL.md → pikku-agent/references/voice.md} +1 -22
  9. package/skills/pikku-architect/SKILL.md +264 -0
  10. package/skills/pikku-auth/SKILL.md +89 -0
  11. package/skills/{pikku-better-auth/SKILL.md → pikku-auth/references/better-auth.md} +42 -47
  12. package/skills/{pikku-jose/SKILL.md → pikku-auth/references/jose.md} +1 -23
  13. package/skills/{pikku-machine-auth/SKILL.md → pikku-auth/references/machine-auth.md} +0 -23
  14. package/skills/{pikku-permissions/SKILL.md → pikku-auth/references/permissions.md} +5 -24
  15. package/skills/{pikku-security/SKILL.md → pikku-auth/references/sessions.md} +3 -23
  16. package/skills/pikku-build/SKILL.md +87 -0
  17. package/skills/{pikku-build-app/SKILL.md → pikku-build/references/app.md} +77 -25
  18. package/skills/{pikku-feature/SKILL.md → pikku-build/references/feature.md} +1 -8
  19. package/skills/{pikku-build-app → pikku-build}/references/multi-app.md +1 -1
  20. package/skills/{pikku-build-platform/SKILL.md → pikku-build/references/platform.md} +22 -37
  21. package/skills/{pikku-template-clone/SKILL.md → pikku-build/references/post-clone.md} +0 -6
  22. package/skills/{pikku-build-quick/SKILL.md → pikku-build/references/quick.md} +6 -22
  23. package/skills/{pikku-build-app → pikku-build}/references/ship.md +7 -1
  24. package/skills/pikku-concepts/SKILL.md +75 -8
  25. package/skills/pikku-concepts/references/concept-mapping.md +8 -8
  26. package/skills/pikku-deploy/SKILL.md +158 -0
  27. package/skills/{pikku-deploy-azure/SKILL.md → pikku-deploy/references/azure.md} +18 -50
  28. package/skills/pikku-deploy/references/cloudflare.md +104 -0
  29. package/skills/pikku-deploy/references/express.md +92 -0
  30. package/skills/{pikku-deploy-fastify/SKILL.md → pikku-deploy/references/fastify.md} +8 -32
  31. package/skills/{pikku-deploy-lambda/SKILL.md → pikku-deploy/references/lambda.md} +6 -27
  32. package/skills/{pikku-deploy-nextjs/SKILL.md → pikku-deploy/references/nextjs.md} +9 -33
  33. package/skills/pikku-deploy/references/uws.md +72 -0
  34. package/skills/pikku-deploy/references/ws.md +75 -0
  35. package/skills/pikku-emails/SKILL.md +3 -2
  36. package/skills/pikku-fabric/SKILL.md +20 -10
  37. package/skills/{pikku-fabric-debug/SKILL.md → pikku-fabric/references/debugging.md} +0 -6
  38. package/skills/pikku-i18n/SKILL.md +60 -207
  39. package/skills/{pikku-paraglide/SKILL.md → pikku-i18n/references/enum-labels.md} +0 -6
  40. package/skills/pikku-i18n/references/messages.md +218 -0
  41. package/skills/{pikku-rtl/SKILL.md → pikku-i18n/references/rtl.md} +3 -9
  42. package/skills/pikku-knowledge/SKILL.md +14 -0
  43. package/skills/pikku-kysely/SKILL.md +13 -13
  44. package/skills/pikku-meta/SKILL.md +58 -130
  45. package/skills/{pikku-deps/SKILL.md → pikku-meta/references/audit.md} +1 -17
  46. package/skills/pikku-meta/references/meta.md +114 -0
  47. package/skills/{pikku-versioning/SKILL.md → pikku-meta/references/versioning.md} +0 -26
  48. package/skills/pikku-middleware/SKILL.md +8 -8
  49. package/skills/pikku-n8n-import/SKILL.md +0 -1
  50. package/skills/pikku-react/SKILL.md +50 -298
  51. package/skills/pikku-react/references/client.md +293 -0
  52. package/skills/{pikku-react-query/SKILL.md → pikku-react/references/react-query.md} +2 -22
  53. package/skills/{pikku-workflows-client/SKILL.md → pikku-react/references/workflows.md} +1 -22
  54. package/skills/pikku-scenario/SKILL.md +64 -49
  55. package/skills/pikku-scenario/references/persona-run.md +148 -0
  56. package/skills/pikku-service-backends/SKILL.md +154 -0
  57. package/skills/pikku-service-backends/references/aws.md +106 -0
  58. package/skills/pikku-service-backends/references/backblaze.md +57 -0
  59. package/skills/pikku-service-backends/references/mongodb.md +90 -0
  60. package/skills/pikku-service-backends/references/redis.md +75 -0
  61. package/skills/pikku-service-backends/references/schema.md +63 -0
  62. package/skills/pikku-services/SKILL.md +68 -291
  63. package/skills/{pikku-audit/SKILL.md → pikku-services/references/audit.md} +0 -22
  64. package/skills/{pikku-config/SKILL.md → pikku-services/references/config.md} +1 -25
  65. package/skills/{pikku-pino/SKILL.md → pikku-services/references/pino.md} +0 -20
  66. package/skills/pikku-services/references/services.md +272 -0
  67. package/skills/pikku-software-archaeology/README.md +5 -1
  68. package/skills/pikku-software-archaeology/SKILL.md +15 -2
  69. package/skills/{pikku-product-second-opinion/example/sample-report.md → pikku-software-archaeology/example/second-opinion-sample-report.md} +1 -1
  70. package/skills/pikku-software-archaeology/references/blueprint.schema.json +1 -1
  71. package/skills/pikku-software-archaeology/references/pikku-mapping.md +3 -3
  72. package/skills/{pikku-product-second-opinion/SKILL.md → pikku-software-archaeology/references/second-opinion.md} +4 -9
  73. package/skills/pikku-webhook/SKILL.md +199 -0
  74. package/skills/pikku-wiring/SKILL.md +180 -0
  75. package/skills/{pikku-websocket/SKILL.md → pikku-wiring/references/channel.md} +2 -35
  76. package/skills/{pikku-cli/SKILL.md → pikku-wiring/references/cli.md} +1 -33
  77. package/skills/{pikku-gateway-slack/SKILL.md → pikku-wiring/references/gateway-slack.md} +0 -23
  78. package/skills/{pikku-http/SKILL.md → pikku-wiring/references/http.md} +4 -40
  79. package/skills/{pikku-mcp/SKILL.md → pikku-wiring/references/mcp.md} +0 -33
  80. package/skills/{pikku-queue/SKILL.md → pikku-wiring/references/queue.md} +1 -33
  81. package/skills/{pikku-realtime/SKILL.md → pikku-wiring/references/realtime.md} +2 -25
  82. package/skills/{pikku-rpc/SKILL.md → pikku-wiring/references/rpc.md} +0 -32
  83. package/skills/{pikku-schedule/SKILL.md → pikku-wiring/references/scheduler.md} +1 -35
  84. package/skills/{pikku-trigger/SKILL.md → pikku-wiring/references/trigger.md} +0 -43
  85. package/skills/pikku-workflow/SKILL.md +3 -3
  86. package/skills/pikku-aws/SKILL.md +0 -161
  87. package/skills/pikku-backblaze/SKILL.md +0 -104
  88. package/skills/pikku-deploy-cloudflare/SKILL.md +0 -123
  89. package/skills/pikku-deploy-express/SKILL.md +0 -122
  90. package/skills/pikku-deploy-uws/SKILL.md +0 -144
  91. package/skills/pikku-mongodb/SKILL.md +0 -113
  92. package/skills/pikku-product-second-opinion/README.md +0 -43
  93. package/skills/pikku-redis/SKILL.md +0 -99
  94. package/skills/pikku-schema-ajv/SKILL.md +0 -83
  95. package/skills/pikku-schema-cfworker/SKILL.md +0 -82
  96. package/skills/pikku-ws/SKILL.md +0 -87
  97. /package/skills/{pikku-build-app → pikku-build}/references/theming.md +0 -0
  98. /package/skills/{pikku-product-second-opinion/references/report-template.md → pikku-software-archaeology/references/second-opinion-report-template.md} +0 -0
  99. /package/skills/{pikku-cli/references/complete-example.md → pikku-wiring/references/cli-complete-example.md} +0 -0
  100. /package/skills/{pikku-http → pikku-wiring}/references/http-options.md +0 -0
  101. /package/skills/{pikku-realtime/references/other-routes.md → pikku-wiring/references/realtime-other-routes.md} +0 -0
@@ -1,17 +1,3 @@
1
- ---
2
- name: pikku-build-app
3
- description: >-
4
- Build a real product on open-source Pikku using the full Fabric workflow, run locally — knowledge
5
- base first, personas and roles, milestones planned then built one at a time, each proven by a
6
- scenario, with a design pass. The default build mode, and the one that stays importable into
7
- Fabric later. TRIGGER when: the user asked for an app to be built on Pikku and picked "App" (or
8
- did not pick), a freshly scaffolded pikku project needs turning into a product, or the user says
9
- "build this properly / so someone can pick it up". DO NOT TRIGGER when: the user asked for
10
- something quick or throwaway (use pikku-build-quick), wants every platform surface demonstrated
11
- (use pikku-build-platform), or is adding one feature to an app that already has its knowledge
12
- base and milestones (use pikku-feature).
13
- ---
14
-
15
1
  # Build a product on open-source Pikku
16
2
 
17
3
  You have a scaffolded project with skills installed. This skill owns everything
@@ -210,7 +196,7 @@ people the user named, and the roles they imply.
210
196
 
211
197
  ```typescript
212
198
  import { definePersonas } from '#pikku/scopes/pikku-personas.gen.js'
213
- import { defineSystemRole } from '#pikku'
199
+ import { defineSystemRole } from '#pikku/scopes'
214
200
 
215
201
  defineSystemRole({
216
202
  owner: {
@@ -272,7 +258,7 @@ definePersonas({
272
258
  live with them.
273
259
  - **Roles are what a permission check reads, not where it lives.** The check goes
274
260
  in the function's `permissions` field (§6), never in the body. Read the
275
- `pikku-permissions` skill.
261
+ `pikku-auth` skill.
276
262
 
277
263
  `pikku persona list` shows who is declared and `pikku roles audit` reports roles
278
264
  the database still holds that code no longer declares — both need §0's bootstrap
@@ -365,17 +351,45 @@ Number the files (`01-…`, `02-…`) so the order is visible in the tree. Then
365
351
  **Show the user the list before building.** This is the last cheap moment to
366
352
  reorder — after §6 the migrations are numbered and the order is concrete.
367
353
 
354
+ ## 5a. The technical plan — one milestone at a time, before you build it
355
+
356
+ The milestone note says what the app must DO. The **plan** says what has to
357
+ exist for it: the tables, functions, wires, roles, scopes, screens and
358
+ scenarios, split into passes. It is JSON, it lives beside the note, and
359
+ `pikku knowledge plan progress` measures the finished build against it.
360
+
361
+ **Read `pikku-architect` and follow it.** The plan is the denominator the
362
+ completion check divides by, so a builder who writes their own plan can build a
363
+ fraction, plan only that fraction, and certify itself complete. Fabric answers
364
+ that by giving the plan its own seat; here the defence is the ORDER, and it only
365
+ holds if you keep it: the plan is written against the note in its own turn,
366
+ before any of the code it measures exists, and is never edited afterwards to
367
+ match what you ended up building. An item that will not land is deferred with
368
+ its reason — `plan defer` — not quietly rewritten. Write it before you open a
369
+ migration:
370
+
371
+ ```sh
372
+ pikku knowledge plan schema # the only spec there is
373
+ pikku knowledge plan set <milestone> /tmp/plan.json
374
+ pikku knowledge plan show <milestone> --for-build # what you then build
375
+ ```
376
+
377
+ **Plan one milestone at a time, at the moment you are about to build it** — not
378
+ all of them here. A plan written against a note that later moves is worse than
379
+ no plan, and everything after the current milestone is still allowed to move.
380
+
368
381
  ---
369
382
 
370
383
  ## PHASE 4 — Build
371
384
 
372
385
  ## 6. Implement milestones, one at a time
373
386
 
374
- **Per milestone** — set its note to `status: dispatched`, do the six steps,
375
- set it to `built`. Do not start the next one until §7 is green for this one *and
376
- §7a shows its functions covered*. A stack of half-milestones cannot be reviewed
377
- and cannot be handed over, and an uncovered function is a half-milestone whether
378
- or not the note says `built`.
387
+ **Per milestone** — plan it (§5a), set its note to `status: dispatched`, do the
388
+ six steps, close it out (§6a), set it to `built`. Do not start the next one
389
+ until §6a passes, §7 is green for this one *and §7a shows its functions
390
+ covered*. A stack of half-milestones cannot be reviewed and cannot be handed
391
+ over, and an uncovered function is a half-milestone whether or not the note says
392
+ `built`.
379
393
 
380
394
  1. **Migration.** SQL in `db/sqlite/` at the project root, numbered on from the
381
395
  ones already there. Apply with `bunx --bun pikku db migrate`, which also
@@ -475,6 +489,44 @@ it is worth writing as a browser step on §7's scenario and running
475
489
  `pikku scenario run local --spawn --run browser`: same clicks, same assertions,
476
490
  in the repo, green or red on every future run.
477
491
 
492
+ ## 6a. Close the milestone against its plan, not against your memory
493
+
494
+ ```sh
495
+ pikku knowledge plan progress <milestone>
496
+ ```
497
+
498
+ It reads §5a's plan and reconciles it against the generated meta under
499
+ `.pikku/` — the function exists or it does not, the route is wired or it is not,
500
+ the `pikkuScenario` export is there or it is not. Nothing it reports comes from
501
+ what anyone claimed, which is the whole reason it replaced a todo list. It exits
502
+ non-zero while anything in the first pass is missing.
503
+
504
+ Three things it says, and what each one asks of you:
505
+
506
+ - **MISSING** — the first pass owes it and the meta cannot see it. Either build
507
+ it, or, if it genuinely belongs to later work, move it out with a reason on
508
+ the record:
509
+
510
+ ```sh
511
+ pikku knowledge plan defer <milestone> function:sendReminder \
512
+ -r "The email service it needs is the next milestone."
513
+ ```
514
+
515
+ **A deferral is capped at two per plan.** Past that, the plan was wrong and the
516
+ milestone is two milestones — say so to the user rather than deferring again.
517
+ What you may never do is drop the item silently: the plan is what the next
518
+ person reads to know what this milestone was for.
519
+ - **PROBLEMS** — something exists but does not do what was planned. A function
520
+ planned as restricted whose meta says `auth: false`; a `cascade` no migration
521
+ declares; a browser scenario that opens a page and asserts it is still on it.
522
+ These are never deferred. Fix the app.
523
+ - **DEFERRED to a later pass** — already accounted for. Reported so it is
524
+ visible, never blocking.
525
+
526
+ **Do not set the note to `built` while this exits non-zero**, and do not edit the
527
+ plan to match what you built — `plan set` is the architect's seat, and a builder
528
+ rewriting its own denominator is exactly what the split exists to stop.
529
+
478
530
  ## 7. Prove it — scenarios
479
531
 
480
532
  A scenario is a user journey run as one of your personas, over the real
@@ -484,7 +536,7 @@ experiences it. Three ship in `packages/functions/test/scenarios/` — keep them
484
536
  green — and every milestone's gherkin block from §5 becomes one more.
485
537
 
486
538
  ```typescript
487
- import { pikkuScenario } from '#pikku/workflow/pikku-workflow-types.gen.js'
539
+ import { pikkuScenario } from '#pikku/scenarios'
488
540
 
489
541
  export const tenantReportsAFaultScenario = pikkuScenario<void, { id: string }>({
490
542
  title: 'A tenant reports a fault and the owner sees it',
@@ -685,7 +737,7 @@ cheaper to honour than to retrofit:
685
737
  that needs it
686
738
  - `references/theming.md` — authoring the theme (§8a)
687
739
  - `references/ship.md` — deploying, and the Fabric-readiness contract (§9)
688
- - Sibling skills: `pikku-knowledge` (§2), `pikku-permissions` (§3),
689
- `pikku-scenario` (§7, §7a), `pikku-deploy-cloudflare` and `pikku-fabric` (§9)
740
+ - Sibling skills: `pikku-knowledge` (§2), `pikku-auth` (§3),
741
+ `pikku-scenario` (§7, §7a), `pikku-deploy` and `pikku-fabric` (§9)
690
742
  - Project conventions written by the template: `AGENTS.md`
691
- - Doing less than this: `pikku-build-quick`. Doing more: `pikku-build-platform`.
743
+ - Doing less than this: `references/quick.md``. Doing more: `references/platform.md``.
@@ -1,10 +1,3 @@
1
- ---
2
- name: pikku-feature
3
- description: 'Drive create-a-feature work inside a Pikku project that already exists: discover project context, work on a feature branch, implement + verify + commit, and ask the user to review via the diff. TRIGGER when: the user asks to "create a feature", "add X to my Pikku project", "wire up a new endpoint", or anything that implies turning a natural-language request into Pikku functions/wirings/migrations within a working app. DO NOT TRIGGER when: the user asks for a one-off code edit in an existing function, asks about Pikku concepts (use pikku-concepts), or is building a whole app from a fresh scaffold rather than extending one (use pikku-build-app, or pikku-build-quick / pikku-build-platform).'
4
- allowed-tools: Bash(yarn pikku meta *), Bash(yarn pikku all *), Bash(yarn tsc), Bash(git status *), Bash(git diff *), Bash(git switch *), Bash(git checkout *), Bash(git checkout -b *), Bash(git add *), Bash(git commit *), Bash(git log *), Bash(git branch *), Bash(yarn pikku fabric report *), Bash(npx --no pikku fabric report *)
5
- argument-hint: '<feature description>'
6
- ---
7
-
8
1
  # Pikku Create-a-Feature
9
2
 
10
3
  ## Agent Operating Procedure
@@ -137,7 +130,7 @@ in-app features don't.
137
130
  zod schema for type-safe access. Read variables with
138
131
  `services.variables.get('NAME')`. Secrets are **not available in functions** —
139
132
  read them in `services.ts` with `secrets.getSecret('NAME')` and pass the value
140
- into the service the function uses. See the **pikku-config** skill for the full
133
+ into the service the function uses. See the **pikku-services** skill for the full
141
134
  pattern (including OAuth2 credentials). This applies even in `config.ts`.
142
135
 
143
136
  ### Conventions to copy from neighbours
@@ -102,7 +102,7 @@ rewritten to the pikku dev server).
102
102
  the permission check exists. The refusal scenario is the evidence.
103
103
  - **In production on two subdomains**, the session cookie needs a parent domain
104
104
  (`.example.com`) or each app gets its own login. Decide which, set it per the
105
- `pikku-better-auth` skill, and record it in `knowledge/decisions/security/`.
105
+ `pikku-auth` skill, and record it in `knowledge/decisions/security/`.
106
106
  - **Never hardcode a host or port.** The API base resolves to same-origin `/api`.
107
107
 
108
108
  ## Building the second app's screens
@@ -1,25 +1,12 @@
1
- ---
2
- name: pikku-build-platform
3
- description: >-
4
- Build an app that exercises every Pikku surface — workflows, schedules, queues, an AI agent,
5
- realtime, MCP, multiple locales, contract versioning and scenario coverage — on top of the full
6
- pikku-build-app workflow. For proving what the platform does, not for shipping the smallest
7
- thing that works. TRIGGER when: the user picked "Platform", asked for a showcase or reference
8
- app, or asked to demonstrate what Pikku can do. DO NOT TRIGGER when: the user wants a product
9
- built (use pikku-build-app), something quick (use pikku-build-quick), or one specific surface
10
- wired into an existing app — a single workflow, cron job or agent (use that surface's own skill,
11
- e.g. pikku-workflow, pikku-schedule, pikku-agent).
12
- ---
13
-
14
1
  # Build a platform showcase on Pikku
15
2
 
16
- **This skill is a delta. `pikku-build-app` is the base — read it and follow it in
3
+ **This skill is a delta. `references/app.md` is the base — read it and follow it in
17
4
  full.** Everything there applies: knowledge base first, personas and roles,
18
5
  milestones planned then built one at a time, scenarios, design pass, deploy
19
6
  gates, Fabric-readiness. This file adds the surfaces that turn an app into a
20
7
  demonstration of the platform, and says where each one slots into that workflow.
21
8
 
22
- Read `pikku-build-app` now, then come back. Do not blend the two into one plan —
9
+ Read `references/app.md` now, then come back. Do not blend the two into one plan —
23
10
  the phases below hang off its phases by number.
24
11
 
25
12
  ## What "platform" means here
@@ -32,7 +19,7 @@ proves it.** A cron job that logs "tick" is not a schedule — it is a comment.
32
19
  Budget the extra surfaces at one milestone each. They are not free, and a
33
20
  half-wired workflow engine is worse than no workflow engine.
34
21
 
35
- ## Choosing surfaces — during `pikku-build-app` §5 (planning)
22
+ ## Choosing surfaces — during `references/app.md` §5 (planning)
36
23
 
37
24
  When you plan milestones, each surface below becomes its own milestone note in
38
25
  `knowledge/milestones/`, ordered after the spine it depends on.
@@ -85,11 +72,11 @@ on a human or a timer and must survive a restart.
85
72
  gap in the middle? If every operation completes in one request, you do not need
86
73
  workflows and forcing one is noise.
87
74
  - **Prove it:** a scenario that starts the workflow, advances it as a second
88
- persona, and asserts the end state. `pikku-workflows-client` covers driving it
75
+ persona, and asserts the end state. `pikku-react` covers driving it
89
76
  from the UI.
90
77
  - Three workflows ship with the template. Read them before writing yours.
91
78
 
92
- ### Schedules — `pikku-schedule`
79
+ ### Schedules — `pikku-wiring`
93
80
 
94
81
  Recurring work: a nightly rollup, a reminder sweep, an expiry pass.
95
82
 
@@ -99,7 +86,7 @@ Recurring work: a nightly rollup, a reminder sweep, an expiry pass.
99
86
  - **Prove it:** invoke the scheduled function directly in a scenario and assert
100
87
  its effect. Do not test by waiting.
101
88
 
102
- ### Queues — `pikku-queue`
89
+ ### Queues — `pikku-wiring`
103
90
 
104
91
  Work that must happen but not now, and may retry: email fan-out, image
105
92
  processing, third-party calls that fail.
@@ -108,7 +95,7 @@ processing, third-party calls that fail.
108
95
  fails in ways worth retrying.
109
96
  - **Prove it:** enqueue in one scenario step, assert the effect in a `then`.
110
97
 
111
- ### An AI agent — `pikku-agent`, `pikku-ai-vercel`
98
+ ### An AI agent — `pikku-agent`
112
99
 
113
100
  The template ships agent wiring and `@ai-sdk/openai`. An agent that answers
114
101
  questions over the app's own data is the showcase; a general chatbot is not.
@@ -124,7 +111,7 @@ questions over the app's own data is the showcase; a general chatbot is not.
124
111
  matching `defineSecret`, never `process.env`, or deploy has nothing to
125
112
  provision (PKU951).
126
113
 
127
- ### Realtime and events — `pikku-realtime`, `pikku-websocket`
114
+ ### Realtime and events — `pikku-wiring`
128
115
 
129
116
  `pikku enable events` gives a realtime channel plus an SSE stream, and the
130
117
  generated typed client.
@@ -134,20 +121,20 @@ generated typed client.
134
121
  - **Prove it:** a browser scenario is the only honest proof — assert the second
135
122
  persona's screen changed without a reload.
136
123
 
137
- ### MCP — `pikku-mcp`
124
+ ### MCP — `pikku-wiring`
138
125
 
139
126
  Exposes functions as Model Context Protocol tools, so an outside agent can drive
140
127
  the app. Cheap once functions exist, and a genuine differentiator to show.
141
128
 
142
- ### Triggers and webhooks — `pikku-trigger`, `pikku enable webhook`
129
+ ### Triggers and webhooks — `pikku-wiring`, `pikku enable webhook`
143
130
 
144
131
  Inbound triggers and outgoing webhook delivery. This is where `wireHTTP` is
145
132
  correct rather than a smell: a third-party caller needs a real REST shape.
146
133
 
147
- ### Locales — `pikku-i18n`, `pikku-paraglide`
134
+ ### Locales — `pikku-i18n`
148
135
 
149
- `pikku-build-app` already requires every string to be a key. **Here, ship three
150
- locales, and make one of them RTL** (`pikku-rtl`). Two LTR locales prove the
136
+ `references/app.md` already requires every string to be a key. **Here, ship three
137
+ locales, and make one of them RTL** (`pikku-i18n`). Two LTR locales prove the
151
138
  plumbing; an RTL one proves the layout, and it will find real bugs — mirrored
152
139
  icons, hardcoded `marginLeft`, a nav that opens on the wrong side.
153
140
 
@@ -159,7 +146,7 @@ every added locale is cloned from, so three locales is `locales: ["en", …]` an
159
146
  never a repointed base. Shipping locales is also not a reason for anything in
160
147
  the code to stop being English: identifiers are English in every project, and
161
148
  the language of `description`/`title`/`template` is `metaLocale` in
162
- `pikku.config.json`. See `pikku-build-app` §1a.
149
+ `pikku.config.json`. See `references/app.md` §1a.
163
150
 
164
151
  ### Emails — `pikku-emails`
165
152
 
@@ -168,7 +155,7 @@ localised like every other string. The base workflow asks for one; **a showcase
168
155
  sends three** — a welcome, a transactional confirmation, and one sent from a
169
156
  schedule or queue rather than a request, because that is the interesting path.
170
157
 
171
- ### Contract versioning — `pikku-versioning`
158
+ ### Contract versioning — `pikku-meta`
172
159
 
173
160
  ```sh
174
161
  bunx --bun pikku versions init
@@ -186,7 +173,7 @@ the domain has a piece that genuinely belongs to no single app.
186
173
 
187
174
  ## Coverage — where the bar is higher than the base workflow
188
175
 
189
- `pikku-build-app` §7a already has the mechanics and the per-milestone habit:
176
+ `references/app.md` §7a already has the mechanics and the per-milestone habit:
190
177
  run the server instrumented, run the scenarios against it, read
191
178
  `coverage/scenario-coverage.json`, and triage every gap as a missing scenario, a
192
179
  function that should not exist, or a documented deferral. Do all of that here.
@@ -205,7 +192,7 @@ Two things change in a showcase:
205
192
 
206
193
  ## The full gate
207
194
 
208
- Everything in `pikku-build-app` §9, plus the checks a showcase should be able to
195
+ Everything in `references/app.md` §9, plus the checks a showcase should be able to
209
196
  survive:
210
197
 
211
198
  ```sh
@@ -227,7 +214,7 @@ bunx --bun pikku scenario run local --spawn --run browser
227
214
 
228
215
  ## Deploy
229
216
 
230
- `pikku-build-app` §9 covers the open-source paths (`--provider standalone`,
217
+ `references/app.md` §9 covers the open-source paths (`--provider standalone`,
231
218
  `cloudflare`, `aws`). One thing specific to this mode: **the extra surfaces are
232
219
  extra deploy units.** Workflow workers, queue workers, schedules and the events
233
220
  channel each appear in `pikku deploy plan` as their own entries. Read the plan
@@ -236,10 +223,8 @@ built.
236
223
 
237
224
  ## Reference
238
225
 
239
- - Base workflow: `pikku-build-app` — read it first, follow it in full
240
- - Per-surface skills: `pikku-workflow`, `pikku-schedule`,
241
- `pikku-queue`, `pikku-agent`, `pikku-ai-vercel`, `pikku-realtime`,
242
- `pikku-websocket`, `pikku-mcp`, `pikku-trigger`, `pikku-i18n`, `pikku-rtl`,
243
- `pikku-emails`, `pikku-versioning`, `pikku-addon`, `pikku-security`,
244
- `pikku-audit`
226
+ - Base workflow: `references/app.md` — read it first, follow it in full
227
+ - Per-surface skills: `pikku-workflow`, `pikku-wiring`, `pikku-agent`,
228
+ `pikku-i18n`, `pikku-emails`,
229
+ `pikku-meta`, `pikku-addon`, `pikku-auth`, `pikku-services`
245
230
  - Every feature, end to end: https://pikkufabric.com/llm-all-features.txt
@@ -1,9 +1,3 @@
1
- ---
2
- name: pikku-template-clone
3
- description: 'Standard cleanup to run right after a Pikku template is cloned or scaffolded into a new project. TRIGGER when: a Pikku template was just cloned/scaffolded (via `npm create pikku`, `git clone <template>`, or the user says "I cloned the kanban template / starter / template"), or the working tree still looks like an untouched template (template README, placeholder `@project/*` name in package.json). DO NOT TRIGGER when: working in an established project mid-feature, or editing the template repo itself.'
4
- allowed-tools: Bash(git status *), Bash(git add *), Bash(git commit *), Bash(git rm *), Bash(git mv *), Bash(git log *)
5
- ---
6
-
7
1
  # Pikku Template Post-Clone Cleanup
8
2
 
9
3
  ## Agent Operating Procedure
@@ -1,19 +1,3 @@
1
- ---
2
- name: pikku-build-quick
3
- description: >-
4
- Build a working app on open-source Pikku fast — scaffold to running screens, skipping the
5
- knowledge base and the milestone ladder. For spikes, throwaway demos, and ideas nobody has
6
- committed to yet. TRIGGER when: the user asked for something quick, a prototype, a spike, a
7
- demo of an idea, or "just get it running", or picked "Quick" from the build-mode question. DO
8
- NOT TRIGGER when: the request is an unqualified "build me an X on Pikku" with no signal of
9
- speed or throwaway-ness — App is the default and small or toy-sounding apps do not change that
10
- (use pikku-build-app); the user wants a real product someone else will pick up (use
11
- pikku-build-app); the user wants a demo of Pikku itself — one that shows off surfaces like
12
- workflows, queues, realtime or i18n (use pikku-build-platform); or the user is adding a feature
13
- to an app that already exists rather than building one from a fresh scaffold (use
14
- pikku-feature).
15
- ---
16
-
17
1
  # Build an app on Pikku, fast
18
2
 
19
3
  You have a scaffolded project with skills installed. Get it to working, seeded,
@@ -58,7 +42,7 @@ Identifiers are English in every project, whatever the product's market;
58
42
  `template`, which the Console renders) stays `en` unless the user already told
59
43
  you otherwise. If the request says the app's UI is not English, that is the
60
44
  message catalogue only: add the locale and set `defaultLocale`, and leave
61
- `baseLocale` at `en`. `pikku-build-app` §1a has the three axes in full; getting
45
+ `baseLocale` at `en`. `references/app.md` §1a has the three axes in full; getting
62
46
  them confused is how a project ends up unable to add a second language.
63
47
 
64
48
  ## 2. Personas — 60 seconds, not optional
@@ -85,7 +69,7 @@ named:
85
69
 
86
70
  ```typescript
87
71
  import { definePersonas } from '#pikku/scopes/pikku-personas.gen.js'
88
- import { defineSystemRole } from '#pikku'
72
+ import { defineSystemRole } from '#pikku/scopes'
89
73
 
90
74
  defineSystemRole({
91
75
  owner: { displayName: 'Owner', description: 'Sees only their own rows', scopes: [] },
@@ -191,7 +175,7 @@ taller than the viewport. It is the most likely width your demo gets opened at.
191
175
  If you have five spare minutes, `npx impeccable install` (Node 22.18+) scores
192
176
  each screen against interaction heuristics and names what is wrong. Feed it
193
177
  screenshots, not source. It will polish the default look; it will not give the
194
- app a look — that is `pikku-build-app` §8a.
178
+ app a look — that is `references/app.md` §8a.
195
179
 
196
180
  ## 5. One smoke scenario
197
181
 
@@ -199,7 +183,7 @@ Not the full ladder — one journey, end to end, as a real persona, so the app h
199
183
  at least one thing that stays true.
200
184
 
201
185
  ```typescript
202
- import { pikkuScenario } from '#pikku/workflow/pikku-workflow-types.gen.js'
186
+ import { pikkuScenario } from '#pikku/scenarios'
203
187
 
204
188
  export const ownerCreatesAndSeesItScenario = pikkuScenario<void, { id: string }>({
205
189
  title: 'An owner creates a thing and sees it',
@@ -235,7 +219,7 @@ that this is a quick build — no knowledge base, no milestones, no design pass,
235
219
  access control clicked-through rather than proven.
236
220
 
237
221
  **Upgrading to a real build is additive, not a rewrite.** If they want it, switch
238
- to `pikku-build-app` and do this, in order:
222
+ to `references/app.md` and do this, in order:
239
223
 
240
224
  1. Write `knowledge/` for what already exists — `entities/` for what you built,
241
225
  `decisions/` for what you chose silently, `questions/` for what you guessed
@@ -244,7 +228,7 @@ to `pikku-build-app` and do this, in order:
244
228
  its gherkin block.
245
229
  3. Write the refusal scenarios — the ones proving one persona cannot reach
246
230
  another's rows. This is the gap that matters most.
247
- 4. Then pick up `pikku-build-app` at its §4 (apps) or §5 (milestones) for
231
+ 4. Then pick up `references/app.md` at its §4 (apps) or §5 (milestones) for
248
232
  anything new.
249
233
 
250
234
  Nothing built here has to be thrown away to do that — which is the whole reason
@@ -16,7 +16,7 @@ bunx --bun pikku deploy apply --provider standalone --runtime bun
16
16
  bundles the project into a single unit and emits either a `bundle.js` you run
17
17
  with Node, or a self-contained executable compiled with `bun build --compile`.
18
18
  `cloudflare` (the default) and `aws` are the other providers — read the
19
- `pikku-deploy-cloudflare` skill before using it, as it ships the handler
19
+ `pikku-deploy` skill before using it, as it ships the handler
20
20
  factories the deploy codegen expects, and hand-rolling an `ExportedHandler` is
21
21
  how a worker deploy fails at runtime instead of at build.
22
22
 
@@ -81,6 +81,12 @@ Everything above is open source. This is the contract that keeps
81
81
  serves imports as a person with no way in.
82
82
  - **`knowledge/` passes `validate`, with every milestone at `built`.** This is
83
83
  the part Fabric itself reads and continues from.
84
+ - **Every `built` milestone passes `pikku knowledge plan progress`.** A note that
85
+ says `built` is a claim; the plan reconciled against the generated meta is the
86
+ check. Anything the first pass still owes is either built now or deferred with
87
+ its reason on the record; anything the check calls a problem — something that
88
+ exists and does not do what was planned — is fixed, whatever pass it came from,
89
+ because deferring it defers a hole rather than the work.
84
90
  - **Every milestone has a passing scenario**, including its refusals.
85
91
  - **Permissions live in the `permissions` field**, not in function bodies and not
86
92
  in the frontends. A check hidden in a component does not survive a new client.
@@ -74,6 +74,71 @@ which is what decides whether a thrown error becomes a 409 or a 500.
74
74
  `pikku doc` needs `@pikku/cli` 0.12.115 or newer. On an older pin, fall back to the door's
75
75
  skill and `pikku meta --json`, and do not guess at names the doc would have given you.
76
76
 
77
+ ## The CLI commands
78
+
79
+ `pikku doc` is the API surface — the `#pikku/*` exports. It does **not** list
80
+ commands, so this table is where they exist. `pikku <command> --help` has the
81
+ flags; the "Read" column is the skill that teaches the thing, where one does.
82
+
83
+ **Generating**
84
+
85
+ | Command | What it does | Read |
86
+ | ------------------------------------------ | ---------------------------------------------------- | ----------------------------- |
87
+ | `all` | Everything: types, schemas, wirings, clients | this skill |
88
+ | `bootstrap` | Type files only (the setup phase) | this skill |
89
+ | `schemas` | JSON Schemas for function input/output types | this skill |
90
+ | `fetch` / `websocket` / `rpc` / `realtime` | One client each, when you do not want `all` | `pikku-wiring`, `pikku-react` |
91
+ | `react-query` / `tanstack-start` | React Query hooks; the TanStack Start `makeApi` shim | `pikku-react` |
92
+ | `queue-service` | The queue service wrapper | `pikku-wiring` |
93
+ | `openapi` | An OpenAPI spec from the HTTP routes | — |
94
+ | `nextjs` | Next.js backend and HTTP wrappers | `pikku-deploy` |
95
+ | `new` | Scaffold a function or wiring | `pikku-wiring` |
96
+ | `enable` | Turn a Pikku feature on | `pikku-build` |
97
+ | `import` | Import workflows from another system | `pikku-n8n-import` |
98
+
99
+ **Running**
100
+
101
+ | Command | What it does | Read |
102
+ | ---------------------------- | ------------------------------------------------------------------------------ | --------------------------------------- |
103
+ | `dev` | Local dev server, all services wired, watch + HMR | `pikku-build` |
104
+ | `serve` | Bundled bun/node runner — no watch, no codegen | `pikku-deploy` |
105
+ | `watch` | Regenerate on file change, without a server | — |
106
+ | `scenario list\|run` | Scenarios as e2e tests and health checks | `pikku-scenario` |
107
+ | `persona run` | A declared persona as a model-driven virtual user against a stage | `pikku-scenario`, persona-run reference |
108
+ | `persona list\|sync\|secret` | Who is declared; what an environment will provision; minting their credentials | `pikku-scenario`, persona-run reference |
109
+ | `db` | Local development database | `pikku-kysely` |
110
+
111
+ **Inspecting and evolving**
112
+
113
+ | Command | What it does | Read |
114
+ | --------------------- | ----------------------------------------------------------------------- | ---------------------------- |
115
+ | `doc` | The installed API surface | this skill |
116
+ | `meta` / `info` | What the project declares, machine- and human-readable | `pikku-meta` |
117
+ | `validate` | Every check that applies — app structure, an addon's published file set | `pikku-build`, `pikku-addon` |
118
+ | `versions` / `semver` | Contract hashes, breaking-change detection, the release semver | `pikku-meta` |
119
+ | `audit` / `update` | Advisories; which `@pikku/*` can move and what peers that needs | `pikku-meta` |
120
+ | `scopes` / `roles` | Declared authorization scopes; roles from `defineSystemRole` | `pikku-auth` |
121
+ | `knowledge` | The knowledge base — what this app is, in its users' language | `pikku-knowledge` |
122
+ | `emails` | Email template generation | `pikku-emails` |
123
+
124
+ **Shipping, and the CLI itself**
125
+
126
+ | Command | What it does | Read |
127
+ | ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
128
+ | `deploy` | Deploy to cloud infrastructure | `pikku-deploy` |
129
+ | `fabric` | PikkuFabric: login, link, deploy, domains, secrets, logs | `pikku-fabric` |
130
+ | `binary` | Compile an entrypoint to a native binary (`bun build --compile`) | — |
131
+ | `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 | — |
132
+ | `login` / `logout` / `whoami` | The CLI's session against a pikku server | — |
133
+ | `skills` | Install these skills into an agent (Claude Code, opencode, pi) | — |
134
+
135
+ `-c/--config`, `--log-level`, `--json` and the filter flags are **global
136
+ options**, not commands — they attach to the generating commands above.
137
+
138
+ A dash means no skill covers it beyond this line. `--help` is then the whole of
139
+ it — which is a reason to read `--help` rather than to assume the command does
140
+ what its name suggests.
141
+
77
142
  ## Core Mental Model
78
143
 
79
144
  ```text
@@ -101,7 +166,7 @@ The function never imports Express, never reads `req.body`, never touches `ws.se
101
166
 
102
167
  ## Concept Mapping: Generic Backend → Pikku
103
168
 
104
- Controllers/routes → `pikkuFunc`; auth/sessions → `pikku-security`, a separate install; authorization checks → `pikku-permissions`; request interception → `pikku-middleware`; DI → `pikku-services`; transports (HTTP/WS/queue/cron) → their `wire*` + skill. For the full Generic Backend → Pikku mapping table (with side-by-side code examples), read `references/concept-mapping.md`.
169
+ Controllers/routes → `pikkuFunc`; auth/sessions and authorization checks → `pikku-auth`, a separate install; request interception → `pikku-middleware`; DI → `pikku-services`; transports (HTTP/WS/queue/cron) → their `wire*` + skill. For the full Generic Backend → Pikku mapping table (with side-by-side code examples), read `references/concept-mapping.md`.
105
170
 
106
171
  ## Functions
107
172
 
@@ -143,7 +208,7 @@ pikkuFunc({
143
208
  // "What Language You Write In".
144
209
  title?: string, // Human-readable name
145
210
  description?: string, // What the function does
146
- version?: number, // Contract version (see pikku-versioning)
211
+ version?: number, // Contract version (see pikku-meta)
147
212
  override?: string, // Logical name override, so several exports share a versioned base
148
213
  tags?: string[], // For grouping and middleware targeting
149
214
 
@@ -153,13 +218,13 @@ pikkuFunc({
153
218
  errors?: Array<typeof PikkuError>, // Errors this function may throw
154
219
 
155
220
  // Reachability
156
- expose?: boolean, // Allow external RPC calls (see pikku-rpc)
221
+ expose?: boolean, // Allow external RPC calls (see pikku-wiring)
157
222
  remote?: boolean, // Allow remote RPC calls
158
- mcp?: boolean, // Expose as MCP tool (see pikku-mcp)
223
+ mcp?: boolean, // Expose as MCP tool (see pikku-wiring)
159
224
  readonly?: boolean, // Declares the function performs no writes
160
225
  deploy?: 'serverless' | 'server' | 'auto',
161
226
 
162
- // Authorization — see pikku-permissions
227
+ // Authorization — see pikku-auth
163
228
  auth?: boolean, // Override default auth requirement
164
229
  scopes?: ScopeId[], // AND-ed, checked before permissions; session required
165
230
  permissions?: PermissionGroup, // OR-ed pool
@@ -247,6 +312,8 @@ export const lifecycle = pikkuServerLifecycle<SingletonServices>({
247
312
 
248
313
  Export exactly one `pikkuServerLifecycle` from anywhere in `srcDirectories` — the inspector finds it by the wrapper call. Every hook is optional and receives the already-created singleton services. See pikku-services for the ordering and the `afterStop` caveat.
249
314
 
315
+ **Only `pikku dev` and `pikku serve` invoke these hooks.** No deploy runtime does, so anything a Workers or serverless stage needs done cannot live here — put it on the request path that needs it, guarded by a cheap check.
316
+
250
317
  **2. Bootstrap it yourself (required for a specific runtime)**
251
318
 
252
319
  Express, Fastify, uWS, Lambda, Cloudflare and Next.js need their own entrypoint, because Pikku is embedded in a server you own:
@@ -315,7 +382,7 @@ src/
315
382
  ├── services.ts # Service factories (see pikku-services)
316
383
  ├── lifecycle.ts # Server lifecycle hooks (pikku dev/serve only)
317
384
  ├── middleware.ts # Middleware definitions (see pikku-middleware)
318
- ├── permissions.ts # Permission definitions (see pikku-permissions)
385
+ ├── permissions.ts # Permission definitions (see pikku-auth)
319
386
  └── .pikku/ # Generated (gitignored)
320
387
  ├── function/ # #pikku/function
321
388
  ├── http/ # #pikku/http
@@ -333,7 +400,7 @@ bottom.
333
400
  | Axis | What it covers | What decides it |
334
401
  | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
335
402
  | **Identifiers** | Function, component, type, variable and file names. Database tables and columns. Branch names and commit messages. | Nothing. **Always English.** There is no setting. |
336
- | **Meta** | The prose authored _inside_ the code: `description` on functions and steps, `name`/`title` on features and scenarios, step `template`, role/persona descriptions. | `metaLocale` in `pikku.config.json`. Defaults to `en`. |
403
+ | **Meta** | The prose authored _inside_ the code: `description` on functions and steps, `name`/`title` on features and scenarios, step `template`, role/persona descriptions. | `metaLocale` in `pikku.config.json`. Defaults to `en`. |
337
404
  | **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. |
338
405
 
339
406
  ### Identifiers are English, and nothing changes that
@@ -413,7 +480,7 @@ language, it is telling you about axis three and nothing else.
413
480
 
414
481
  ## Environment Variables
415
482
 
416
- Never use `process.env` inside Pikku functions. Use the `variables` service (see `pikku-config`):
483
+ Never use `process.env` inside Pikku functions. Use the `variables` service (see `pikku-services`):
417
484
 
418
485
  ```typescript
419
486
  const apiKey = services.variables.get('API_KEY')
@@ -7,19 +7,19 @@ Authoritative mapping table plus side-by-side code examples showing how common b
7
7
  | Generic Backend Concept | Pikku Equivalent | Skill |
8
8
  | --------------------------------------- | --------------------------------------------------------------- | ----------------- |
9
9
  | **Controller / Route Handler** | `pikkuFunc` / `pikkuSessionlessFunc` | `pikku-concepts` |
10
- | **Route definition** (`GET /users/:id`) | `wireHTTP({ route, method, func })` | `pikku-http` |
11
- | **Middleware** (Express/Koa-style) | `pikkuMiddleware` | `pikku-security` |
12
- | **Auth Guard / Auth Middleware** | `authBearer()` / `authCookie()` / `authApiKey()` | `pikku-security` |
13
- | **Authorization / Permissions** | `pikkuPermission` / `pikkuAuth` | `pikku-security` |
10
+ | **Route definition** (`GET /users/:id`) | `wireHTTP({ route, method, func })` | `pikku-wiring` |
11
+ | **Middleware** (Express/Koa-style) | `pikkuMiddleware` | `pikku-middleware` |
12
+ | **Auth Guard / Auth Middleware** | `authBearer()` / `authCookie()` / `authApiKey()` | `pikku-auth` |
13
+ | **Authorization / Permissions** | `pikkuPermission` / `pikkuAuth` | `pikku-auth` |
14
14
  | **DTO / Request Validation** | Standard Schema (Zod, Valibot, ArkType) | `pikku-concepts` |
15
15
  | **Dependency Injection** | `pikkuServices` (singleton) + `pikkuWireServices` (per-request) | `pikku-services` |
16
- | **WebSocket handlers** | `wireChannel` | `pikku-websocket` |
17
- | **Job Queue workers** | `wireQueueWorker` | `pikku-queue` |
18
- | **Cron / Scheduled tasks** | `wireScheduler` | `pikku-schedule` |
16
+ | **WebSocket handlers** | `wireChannel` | `pikku-wiring` |
17
+ | **Job Queue workers** | `wireQueueWorker` | `pikku-wiring` |
18
+ | **Cron / Scheduled tasks** | `wireScheduler` | `pikku-wiring` |
19
19
  | **Module / Feature grouping** | Tags + wiring files | `pikku-concepts` |
20
20
  | **Error handling** | Throw typed errors (`NotFoundError`, `ForbiddenError`) | `pikku-concepts` |
21
21
  | **Type-safe API client** | `npx pikku all` generates clients | `pikku-concepts` |
22
- | **Secrets / Config** | `defineSecret`, `defineVariable`, `services.variables` | `pikku-config` |
22
+ | **Secrets / Config** | `defineSecret`, `defineVariable`, `services.variables` | `pikku-services` |
23
23
 
24
24
  ## Route Handler / Controller → pikkuFunc
25
25