@pikku/cli 0.12.81 → 0.12.83

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 (215) hide show
  1. package/cli.schema.json +1 -1
  2. package/console-app/assets/{index-NmNeixvK.js → index-CN_U0k_D.js} +154 -144
  3. package/console-app/assets/{index-DwyRdRuZ.css → index-CpHRlBt-.css} +1 -1
  4. package/console-app/index.html +2 -2
  5. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +3 -2
  6. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +1 -1
  7. package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
  8. package/dist/.pikku/cli/pikku-cli-channel.js +21 -1
  9. package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +1 -1
  10. package/dist/.pikku/cli/pikku-cli-client.gen.js +1 -1
  11. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.d.ts +1 -1
  12. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.js +1 -1
  13. package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
  14. package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
  15. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +1 -1
  16. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +60 -3
  17. package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
  18. package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
  19. package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
  20. package/dist/.pikku/cli/pikku-cli.gen.js +1 -1
  21. package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
  22. package/dist/.pikku/function/pikku-function-types.gen.d.ts +6 -12
  23. package/dist/.pikku/function/pikku-function-types.gen.js +3 -12
  24. package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
  25. package/dist/.pikku/function/pikku-functions-meta.gen.json +190 -12
  26. package/dist/.pikku/function/pikku-functions.gen.js +15 -1
  27. package/dist/.pikku/http/pikku-http-types.gen.d.ts +2 -24
  28. package/dist/.pikku/http/pikku-http-types.gen.js +2 -24
  29. package/dist/.pikku/http/pikku-http-wirings-meta.gen.js +1 -1
  30. package/dist/.pikku/http/pikku-http-wirings.gen.d.ts +1 -1
  31. package/dist/.pikku/http/pikku-http-wirings.gen.js +1 -1
  32. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
  33. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
  34. package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -1
  35. package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
  36. package/dist/.pikku/pikku-meta-service.gen.d.ts +1 -1
  37. package/dist/.pikku/pikku-meta-service.gen.js +1 -1
  38. package/dist/.pikku/pikku-services.gen.d.ts +4 -1
  39. package/dist/.pikku/pikku-services.gen.js +3 -0
  40. package/dist/.pikku/pikku-types.gen.d.ts +2 -1
  41. package/dist/.pikku/pikku-types.gen.js +3 -1
  42. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
  43. package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
  44. package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +1 -1
  45. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
  46. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
  47. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
  48. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +9 -0
  49. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
  50. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
  51. package/dist/.pikku/schemas/register.gen.js +13 -1
  52. package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
  53. package/dist/.pikku/schemas/schemas/PikkuGraphWiringsOutput.schema.json +1 -0
  54. package/dist/.pikku/schemas/schemas/PikkuImportN8nInput.schema.json +1 -0
  55. package/dist/.pikku/schemas/schemas/PikkuScopesInput.schema.json +1 -0
  56. package/dist/.pikku/schemas/schemas/PikkuWebhookOutput.schema.json +1 -0
  57. package/dist/.pikku/schemas/schemas/ScopesAuditInput.schema.json +1 -0
  58. package/dist/.pikku/schemas/schemas/ScopesPruneInput.schema.json +1 -0
  59. package/dist/.pikku/scopes/pikku-scope-types.gen.d.ts +5 -0
  60. package/dist/.pikku/scopes/pikku-scope-types.gen.js +4 -0
  61. package/dist/.pikku/scopes/pikku-scopes-meta.gen.json +1 -0
  62. package/dist/.pikku/scopes/pikku-scopes.gen.d.ts +35 -0
  63. package/dist/.pikku/scopes/pikku-scopes.gen.js +27 -0
  64. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
  65. package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
  66. package/dist/.pikku/secrets/pikku-secrets-meta.gen.json +1 -0
  67. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +11 -1
  68. package/dist/.pikku/secrets/pikku-secrets.gen.js +11 -1
  69. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
  70. package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
  71. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
  72. package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
  73. package/dist/.pikku/variables/pikku-variables-meta.gen.json +1 -0
  74. package/dist/.pikku/variables/pikku-variables.gen.d.ts +11 -1
  75. package/dist/.pikku/variables/pikku-variables.gen.js +13 -3
  76. package/dist/.pikku/workflow/meta/allWorkflow.gen.json +48 -6
  77. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +4 -1
  78. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
  79. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
  80. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
  81. package/dist/bin/pikku-bin.mjs +2 -2
  82. package/dist/src/cli.wiring.js +47 -4
  83. package/dist/src/deploy/analyzer/analyzer.js +6 -0
  84. package/dist/src/fabric/fabric-commands.d.ts +3 -3
  85. package/dist/src/fabric/functions/llm-key.function.d.ts +4 -4
  86. package/dist/src/fabric/functions/validate.function.js +42 -2
  87. package/dist/src/functions/commands/bootstrap.js +3 -0
  88. package/dist/src/functions/commands/dev.js +14 -3
  89. package/dist/src/functions/commands/enable.d.ts +1 -0
  90. package/dist/src/functions/commands/enable.js +10 -5
  91. package/dist/src/functions/commands/import-n8n.d.ts +10 -0
  92. package/dist/src/functions/commands/import-n8n.js +130 -0
  93. package/dist/src/functions/commands/info.js +0 -13
  94. package/dist/src/functions/commands/new-addon.js +33 -35
  95. package/dist/src/functions/commands/pikku-command-bootstrap.js +6 -0
  96. package/dist/src/functions/commands/scopes-audit.d.ts +1 -0
  97. package/dist/src/functions/commands/scopes-audit.js +37 -0
  98. package/dist/src/functions/commands/scopes-prune.d.ts +14 -0
  99. package/dist/src/functions/commands/scopes-prune.js +50 -0
  100. package/dist/src/functions/commands/scopes-shared.d.ts +39 -0
  101. package/dist/src/functions/commands/scopes-shared.js +83 -0
  102. package/dist/src/functions/commands/serve.js +4 -2
  103. package/dist/src/functions/commands/skills.js +18 -10
  104. package/dist/src/functions/wirings/ai-agent/serialize-ai-agent-types.js +2 -1
  105. package/dist/src/functions/wirings/console/serialize-console-functions.js +6 -0
  106. package/dist/src/functions/wirings/credentials/serialize-credentials-types.js +22 -0
  107. package/dist/src/functions/wirings/functions/pikku-command-function-types-split.js +1 -1
  108. package/dist/src/functions/wirings/functions/pikku-command-function-types.js +2 -2
  109. package/dist/src/functions/wirings/functions/serialize-function-types.d.ts +1 -1
  110. package/dist/src/functions/wirings/functions/serialize-function-types.js +14 -16
  111. package/dist/src/functions/wirings/functions/serialize-pikku-types-hub.d.ts +1 -1
  112. package/dist/src/functions/wirings/functions/serialize-pikku-types-hub.js +6 -2
  113. package/dist/src/functions/wirings/graph/pikku-command-graph-wirings.d.ts +1 -0
  114. package/dist/src/functions/wirings/graph/pikku-command-graph-wirings.js +21 -0
  115. package/dist/src/functions/wirings/graph/serialize-graph-wirings.d.ts +5 -0
  116. package/dist/src/functions/wirings/graph/serialize-graph-wirings.js +14 -0
  117. package/dist/src/functions/wirings/http/serialize-http-types.js +2 -30
  118. package/dist/src/functions/wirings/package/pikku-command-package-types.d.ts +1 -0
  119. package/dist/src/functions/wirings/package/pikku-command-package-types.js +14 -1
  120. package/dist/src/functions/wirings/package/serialize-package-types.d.ts +1 -0
  121. package/dist/src/functions/wirings/package/serialize-package-types.js +5 -0
  122. package/dist/src/functions/wirings/permissions/pikku-command-permissions.js +1 -3
  123. package/dist/src/functions/wirings/permissions/serialize-permissions-imports.d.ts +6 -1
  124. package/dist/src/functions/wirings/permissions/serialize-permissions-imports.js +7 -64
  125. package/dist/src/functions/wirings/rpc/pikku-command-rpc-map.d.ts +5 -0
  126. package/dist/src/functions/wirings/rpc/pikku-command-rpc-map.js +20 -0
  127. package/dist/src/functions/wirings/rpc/serialize-typed-rpc-map.d.ts +1 -0
  128. package/dist/src/functions/wirings/rpc/serialize-typed-rpc-map.js +8 -3
  129. package/dist/src/functions/wirings/scopes/pikku-command-scopes.d.ts +7 -0
  130. package/dist/src/functions/wirings/scopes/pikku-command-scopes.js +34 -0
  131. package/dist/src/functions/wirings/scopes/serialize-scopes-types.d.ts +15 -0
  132. package/dist/src/functions/wirings/scopes/serialize-scopes-types.js +86 -0
  133. package/dist/src/functions/wirings/secrets/serialize-secrets-types.js +13 -0
  134. package/dist/src/functions/wirings/variables/serialize-variables-types.js +15 -2
  135. package/dist/src/functions/wirings/webhook/pikku-command-webhook.d.ts +1 -0
  136. package/dist/src/functions/wirings/webhook/pikku-command-webhook.js +25 -0
  137. package/dist/src/functions/wirings/webhook/serialize-webhook.d.ts +14 -0
  138. package/dist/src/functions/wirings/webhook/serialize-webhook.js +34 -0
  139. package/dist/src/functions/wirings/workflow/serialize-workflow-routes.js +29 -0
  140. package/dist/src/functions/wirings/workflow/serialize-workflow-types.js +3 -0
  141. package/dist/src/functions/workflows/all.workflow.js +23 -3
  142. package/dist/src/services.d.ts +1 -0
  143. package/dist/src/services.js +1 -0
  144. package/dist/src/utils/pikku-cli-config.js +20 -0
  145. package/dist/tsconfig.tsbuildinfo +1 -1
  146. package/package.json +9 -8
  147. package/skills/pikku-addon/SKILL.md +7 -3
  148. package/skills/pikku-ai-agent/SKILL.md +6 -3
  149. package/skills/pikku-ai-vercel/SKILL.md +6 -3
  150. package/skills/pikku-ai-voice/SKILL.md +6 -3
  151. package/skills/pikku-audit/SKILL.md +10 -3
  152. package/skills/pikku-aws/SKILL.md +9 -5
  153. package/skills/pikku-backblaze/SKILL.md +4 -3
  154. package/skills/pikku-better-auth/SKILL.md +10 -5
  155. package/skills/pikku-cli/SKILL.md +6 -3
  156. package/skills/pikku-concepts/SKILL.md +9 -4
  157. package/skills/pikku-concepts/references/concept-mapping.md +12 -10
  158. package/skills/pikku-config/SKILL.md +9 -5
  159. package/skills/pikku-cron/SKILL.md +6 -3
  160. package/skills/pikku-deploy-azure/SKILL.md +5 -3
  161. package/skills/pikku-deploy-cloudflare/SKILL.md +5 -3
  162. package/skills/pikku-deploy-express/SKILL.md +6 -3
  163. package/skills/pikku-deploy-fastify/SKILL.md +6 -3
  164. package/skills/pikku-deploy-lambda/SKILL.md +6 -3
  165. package/skills/pikku-deploy-nextjs/SKILL.md +5 -3
  166. package/skills/pikku-deploy-uws/SKILL.md +7 -4
  167. package/skills/pikku-deps/SKILL.md +13 -6
  168. package/skills/pikku-emails/SKILL.md +10 -5
  169. package/skills/pikku-feature/SKILL.md +1 -1
  170. package/skills/pikku-gateway-slack/SKILL.md +6 -3
  171. package/skills/pikku-http/SKILL.md +15 -21
  172. package/skills/pikku-http/references/http-options.md +0 -2
  173. package/skills/pikku-info/SKILL.md +9 -4
  174. package/skills/pikku-jose/SKILL.md +6 -3
  175. package/skills/pikku-kysely/SKILL.md +13 -5
  176. package/skills/pikku-machine-auth/SKILL.md +9 -3
  177. package/skills/pikku-mcp/SKILL.md +7 -3
  178. package/skills/pikku-middleware/SKILL.md +11 -6
  179. package/skills/pikku-mongodb/SKILL.md +8 -5
  180. package/skills/pikku-n8n-import/SKILL.md +109 -0
  181. package/skills/pikku-n8n-import/SPEC.md +84 -0
  182. package/skills/pikku-n8n-import/references/addon-mapping.md +121 -0
  183. package/skills/pikku-n8n-import/references/code-translation.md +121 -0
  184. package/skills/pikku-n8n-import/references/loops-and-control.md +87 -0
  185. package/skills/pikku-permissions/SKILL.md +26 -15
  186. package/skills/pikku-pino/SKILL.md +5 -3
  187. package/skills/pikku-product-second-opinion/README.md +43 -0
  188. package/skills/pikku-product-second-opinion/SKILL.md +158 -0
  189. package/skills/pikku-product-second-opinion/example/sample-report.md +90 -0
  190. package/skills/pikku-product-second-opinion/references/report-template.md +73 -0
  191. package/skills/pikku-queue/SKILL.md +7 -4
  192. package/skills/pikku-redis/SKILL.md +9 -6
  193. package/skills/pikku-rpc/SKILL.md +7 -4
  194. package/skills/pikku-rtl/SKILL.md +1 -1
  195. package/skills/pikku-scenario/SKILL.md +215 -0
  196. package/skills/pikku-schedule/SKILL.md +6 -3
  197. package/skills/pikku-schema-ajv/SKILL.md +5 -3
  198. package/skills/pikku-schema-cfworker/SKILL.md +6 -3
  199. package/skills/pikku-security/SKILL.md +8 -4
  200. package/skills/pikku-services/SKILL.md +8 -4
  201. package/skills/pikku-software-archaeology/README.md +70 -0
  202. package/skills/pikku-software-archaeology/SKILL.md +186 -0
  203. package/skills/pikku-software-archaeology/references/blueprint.schema.json +625 -0
  204. package/skills/pikku-software-archaeology/references/pikku-mapping.md +49 -0
  205. package/skills/pikku-software-archaeology/scripts/validate.mjs +173 -0
  206. package/skills/pikku-template-clone/SKILL.md +1 -1
  207. package/skills/pikku-trigger/SKILL.md +7 -3
  208. package/skills/pikku-versioning/SKILL.md +7 -3
  209. package/skills/pikku-websocket/SKILL.md +8 -4
  210. package/skills/pikku-workflow/SKILL.md +7 -3
  211. package/skills/pikku-ws/SKILL.md +5 -3
  212. package/skills/pikku-n8n-addon-map/SKILL.md +0 -178
  213. package/skills/pikku-n8n-code-translate/SKILL.md +0 -166
  214. package/skills/pikku-testing/SKILL.md +0 -328
  215. package/skills/pikku-testing/references/cucumber-bdd-testing.md +0 -176
@@ -1,9 +1,14 @@
1
1
  ---
2
2
  name: pikku-better-auth
3
- description: 'Use when integrating Better Auth with a Pikku app. Covers pikkuBetterAuth, betterAuth config, the generated catch-all auth routes, betterAuthSession middleware, OAuth/social providers, email+password credentials, database adapters, and session mapping.
4
- TRIGGER when: code uses pikkuBetterAuth, betterAuth, betterAuthSession, createAuthHandler, user asks about Better Auth, OAuth/social providers, MFA, organizations, login/logout, or @pikku/better-auth.
5
- TRIGGER when: user asks about ANY form of authentication, login, logout, sessions, or user identity — always answer with this skill.
6
- DO NOT TRIGGER when: user asks about JWT middleware (use pikku-security) or custom session services (use pikku-services).'
3
+ description: >-
4
+ Use when integrating Better Auth with a Pikku app. Covers pikkuBetterAuth, betterAuth config,
5
+ the generated catch-all auth routes, betterAuthSession middleware, OAuth/social providers,
6
+ email+password credentials, database adapters, and session mapping. TRIGGER when: code uses
7
+ pikkuBetterAuth, betterAuth, betterAuthSession, createAuthHandler, user asks about Better Auth,
8
+ OAuth/social providers, MFA, organizations, login/logout, or @pikku/better-auth. TRIGGER when:
9
+ user asks about ANY form of authentication, login, logout, sessions, or user identity — always
10
+ answer with this skill. DO NOT TRIGGER when: user asks about JWT middleware (use pikku-security)
11
+ or custom session services (use pikku-services).
7
12
  ---
8
13
 
9
14
  # Pikku Better Auth Integration
@@ -50,7 +55,7 @@ Better Auth owns its own HTTP surface, database tables, and session cookie. The
50
55
  3. **Generated session middleware** — with `session.cookieCache` enabled (recommended), a separate `auth-middleware.gen.ts` adds the lean stateless `betterAuthStatelessSession()`; without it, `auth.gen.ts` adds the stateful `betterAuthSession()` that bundles the full server into every unit. See "Stateless session" below.
51
56
  4. **Generated `auth-secrets.gen.ts`** — a `wireSecret` for `BETTER_AUTH_SECRET` and for each social provider's OAuth credentials, plus a `wireVariable` for any non-secret provider config (e.g. `tenantId`).
52
57
 
53
- You do NOT hand-write routes, the session middleware, or the secret wiring — `pikkuBetterAuth` + the CLI generate all of it. Re-run `pikku auth` (or `pikku all`) to regenerate.
58
+ You do NOT hand-write routes, the session middleware, or the secret wiring — `pikkuBetterAuth` + the CLI generate all of it. Re-run `pikku all` to regenerate.
54
59
 
55
60
  ### The console requires Better Auth
56
61
 
@@ -1,8 +1,11 @@
1
1
  ---
2
2
  name: pikku-cli
3
- description: 'Use when building CLI commands with Pikku. Covers wireCLI, pikkuCLICommand, subcommands, options, parameters, custom renderers, and nested command groups.
4
- TRIGGER when: code uses wireCLI/pikkuCLICommand, user asks about CLI commands, terminal tools, command-line interface, or adding subcommands.
5
- DO NOT TRIGGER when: user asks about the pikku CLI tool itself (use pikku-info) or HTTP endpoints (use pikku-http).'
3
+ description: >-
4
+ Use when building CLI commands with Pikku. Covers wireCLI, pikkuCLICommand, subcommands,
5
+ options, parameters, custom renderers, and nested command groups. TRIGGER when: code uses
6
+ wireCLI/pikkuCLICommand, user asks about CLI commands, terminal tools, command-line interface,
7
+ or adding subcommands. DO NOT TRIGGER when: user asks about the pikku CLI tool itself (use
8
+ pikku-info) or HTTP endpoints (use pikku-http).
6
9
  installGroups: [core]
7
10
  ---
8
11
 
@@ -1,8 +1,13 @@
1
1
  ---
2
2
  name: pikku-concepts
3
- description: 'Foundational guide to Pikku framework concepts. Use this skill when working with any Pikku codebase, starting a new Pikku project, or migrating a backend to Pikku. Covers the core mental model, function types, project structure, code generation, testing, and how Pikku maps to traditional backend patterns.
4
- TRIGGER when: user asks "what is Pikku?", starts a new Pikku project, migrates from Express/NestJS/Hono, or needs to understand how Pikku works.
5
- DO NOT TRIGGER when: user is doing a specific wiring task (use the specific skill instead, e.g. pikku-http, pikku-websocket).'
3
+ description: >-
4
+ Foundational guide to Pikku framework concepts. Use this skill when working with any Pikku
5
+ codebase, starting a new Pikku project, or migrating a backend to Pikku. Covers the core mental
6
+ model, function types, project structure, code generation, testing, and how Pikku maps to
7
+ traditional backend patterns. TRIGGER when: user asks "what is Pikku?", starts a new Pikku
8
+ project, migrates from Express/NestJS/Hono, or needs to understand how Pikku works. DO NOT
9
+ TRIGGER when: user is doing a specific wiring task (use the specific skill instead, e.g.
10
+ pikku-http, pikku-websocket).
6
11
  installGroups: [core]
7
12
  ---
8
13
 
@@ -149,7 +154,7 @@ await server.start()
149
154
 
150
155
  ## Code Generation
151
156
 
152
- Run `npx pikku prebuild` to generate:
157
+ Run `npx pikku all` to generate:
153
158
 
154
159
  - `pikku-types.gen.ts` — Typed function factories and wiring functions
155
160
  - `pikku-fetch.gen.ts` — Type-safe HTTP client
@@ -18,7 +18,7 @@ Authoritative mapping table plus side-by-side code examples showing how common b
18
18
  | **Cron / Scheduled tasks** | `wireScheduler` | `pikku-cron` |
19
19
  | **Module / Feature grouping** | Tags + wiring files | `pikku-concepts` |
20
20
  | **Error handling** | Throw typed errors (`NotFoundError`, `ForbiddenError`) | `pikku-concepts` |
21
- | **Type-safe API client** | `npx pikku prebuild` generates clients | `pikku-concepts` |
21
+ | **Type-safe API client** | `npx pikku all` generates clients | `pikku-concepts` |
22
22
  | **Secrets / Config** | `wireSecret`, `wireVariable`, `services.variables` | `pikku-config` |
23
23
 
24
24
  ## Route Handler / Controller → pikkuFunc
@@ -197,20 +197,22 @@ const isAdmin = pikkuPermission(async (services, data, wire) => {
197
197
  return session?.role === 'admin'
198
198
  })
199
199
 
200
- // Apply to route pattern
201
- addHTTPPermission('/admin/*', { admin: [isAdmin] })
202
-
203
- // Or inline on specific wiring
204
- wireHTTP({
205
- route: '/users/:id',
206
- method: 'delete',
207
- func: deleteUser,
200
+ // Declare on the function definition (the only place permissions live)
201
+ export const deleteUser = pikkuFunc({
202
+ func: async (services, data) => {
203
+ /* ... */
204
+ },
208
205
  permissions: { admin: [isAdmin] },
209
206
  })
207
+
208
+ // App-wide baseline every function must also pass (AND gate, narrow-only)
209
+ addGlobalPermission([signedInUser])
210
210
  ```
211
211
 
212
212
  **Permission groups:** `{ groupA: [perm1, perm2], groupB: [perm3] }` means `(perm1 AND perm2) OR perm3`.
213
213
 
214
+ > Route-pattern (`addHTTPPermission`) and wire-level `permissions` were removed in #972 — permissions live on the function, plus the optional global gate.
215
+
214
216
  ---
215
217
 
216
218
  ## DTO / Request Validation → Standard Schema
@@ -549,4 +551,4 @@ const result = await client.post('/todos', { title: 'New todo' })
549
551
  // result is fully typed as TodoOutput - no manual type casting
550
552
  ```
551
553
 
552
- Generated by running `npx pikku prebuild`. Both HTTP and WebSocket clients available.
554
+ Generated by running `npx pikku all`. Both HTTP and WebSocket clients available.
@@ -1,8 +1,12 @@
1
1
  ---
2
2
  name: pikku-config
3
- description: 'Use when managing secrets, environment variables, config, or OAuth2 credentials in a Pikku app. Covers wireSecret, wireVariable, wireOAuth2Credential, and typed config access.
4
- TRIGGER when: code uses wireSecret/wireVariable/wireOAuth2Credential, user asks about env vars, secrets, config, OAuth2, or "how do I access environment variables".
5
- DO NOT TRIGGER when: user asks about API versioning/breaking changes (use pikku-versioning), service factories (use pikku-services), or auth middleware (use pikku-security).'
3
+ description: >-
4
+ Use when managing secrets, environment variables, config, or OAuth2 credentials in a Pikku app.
5
+ Covers wireSecret, wireVariable, wireOAuth2Credential, and typed config access. TRIGGER when:
6
+ code uses wireSecret/wireVariable/wireOAuth2Credential, user asks about env vars, secrets,
7
+ config, OAuth2, or "how do I access environment variables". DO NOT TRIGGER when: user asks about
8
+ API versioning/breaking changes (use pikku-versioning), service factories (use pikku-services),
9
+ or auth middleware (use pikku-security).
6
10
  installGroups: [core]
7
11
  ---
8
12
 
@@ -57,7 +61,7 @@ wireVariable({
57
61
 
58
62
  ```typescript
59
63
  // Secrets — encrypted, sensitive values
60
- const config = await services.secrets.getSecretJSON('SECRET_NAME')
64
+ const config = await services.secrets.getSecret('SECRET_NAME')
61
65
 
62
66
  // Variables — plain-text configuration
63
67
  const flags = await services.variables.getVariableJSON('VARIABLE_NAME')
@@ -90,7 +94,7 @@ wireSecret({
90
94
  })
91
95
 
92
96
  // In your function — fully typed
93
- const config = await secrets.getSecretJSON('STRIPE_CONFIG')
97
+ const config = await secrets.getSecret('STRIPE_CONFIG')
94
98
  // config.apiKey → string (autocompleted)
95
99
  // config.webhookSecret → string (autocompleted)
96
100
 
@@ -1,8 +1,11 @@
1
1
  ---
2
2
  name: pikku-cron
3
- description: 'Use when adding scheduled tasks, recurring jobs, or cron-based automation to a Pikku app. Covers wireScheduler, cron expressions, scheduled task wire object, and scheduler middleware.
4
- TRIGGER when: code uses wireScheduler, user asks about cron, scheduled tasks, recurring jobs, or "run every X minutes/hours".
5
- DO NOT TRIGGER when: user asks about background jobs with retries (use pikku-queue) or event-driven triggers (use pikku-trigger).'
3
+ description: >-
4
+ Use when adding scheduled tasks, recurring jobs, or cron-based automation to a Pikku app. Covers
5
+ wireScheduler, cron expressions, scheduled task wire object, and scheduler middleware. TRIGGER
6
+ when: code uses wireScheduler, user asks about cron, scheduled tasks, recurring jobs, or "run
7
+ every X minutes/hours". DO NOT TRIGGER when: user asks about background jobs with retries (use
8
+ pikku-queue) or event-driven triggers (use pikku-trigger).
6
9
  ---
7
10
 
8
11
  # Pikku Cron/Scheduler Wiring
@@ -1,8 +1,10 @@
1
1
  ---
2
2
  name: pikku-deploy-azure
3
- description: 'Use when deploying a Pikku app to Azure Functions. Covers PikkuAzFunctionsLogger and PikkuAzTimerRequest for Azure Functions runtime.
4
- TRIGGER when: user asks about Azure Functions, Azure deployment, or @pikku/azure-functions.
5
- DO NOT TRIGGER when: user asks about AWS Lambda (use pikku-deploy-lambda) or Cloudflare Workers (use pikku-deploy-cloudflare).'
3
+ description: >-
4
+ Use when deploying a Pikku app to Azure Functions. Covers PikkuAzFunctionsLogger and
5
+ PikkuAzTimerRequest for Azure Functions runtime. TRIGGER when: user asks about Azure Functions,
6
+ Azure deployment, or @pikku/azure-functions. DO NOT TRIGGER when: user asks about AWS Lambda
7
+ (use pikku-deploy-lambda) or Cloudflare Workers (use pikku-deploy-cloudflare).
6
8
  ---
7
9
 
8
10
  # Pikku Azure Functions Deployment
@@ -1,8 +1,10 @@
1
1
  ---
2
2
  name: pikku-deploy-cloudflare
3
- description: 'Use when deploying a Pikku app to Cloudflare Workers. Covers HTTP fetch handler, scheduled tasks, and WebSocket via Durable Objects.
4
- TRIGGER when: code imports @pikku/cloudflare, user mentions Cloudflare Workers deployment, or worker entry uses ExportedHandler/wrangler.toml.
5
- DO NOT TRIGGER when: just defining functions/wirings without Cloudflare-specific code.'
3
+ description: >-
4
+ Use when deploying a Pikku app to Cloudflare Workers. Covers HTTP fetch handler, scheduled
5
+ tasks, and WebSocket via Durable Objects. TRIGGER when: code imports @pikku/cloudflare, user
6
+ mentions Cloudflare Workers deployment, or worker entry uses ExportedHandler/wrangler.toml. DO
7
+ NOT TRIGGER when: just defining functions/wirings without Cloudflare-specific code.
6
8
  installGroups: [fabric]
7
9
  ---
8
10
 
@@ -1,8 +1,11 @@
1
1
  ---
2
2
  name: pikku-deploy-express
3
- description: 'Use when deploying a Pikku app with Express. Covers PikkuExpressServer standalone and pikkuExpressMiddleware for existing Express apps.
4
- TRIGGER when: code imports @pikku/express or @pikku/express-middleware, user mentions Express deployment, or start.ts creates a PikkuExpressServer.
5
- DO NOT TRIGGER when: just defining functions/wirings without Express-specific code.'
3
+ description: >-
4
+ Use when deploying a Pikku app with Express. Covers PikkuExpressServer standalone and
5
+ pikkuExpressMiddleware for existing Express apps. TRIGGER when: code imports @pikku/express or
6
+ @pikku/express-middleware, user mentions Express deployment, or start.ts creates a
7
+ PikkuExpressServer. DO NOT TRIGGER when: just defining functions/wirings without
8
+ Express-specific code.
6
9
  ---
7
10
 
8
11
  # Pikku Express Deployment
@@ -1,8 +1,11 @@
1
1
  ---
2
2
  name: pikku-deploy-fastify
3
- description: 'Use when deploying a Pikku app with Fastify. Covers PikkuFastifyServer standalone and pikkuFastifyPlugin for existing Fastify apps.
4
- TRIGGER when: code imports @pikku/fastify or @pikku/fastify-plugin, user mentions Fastify deployment, or start.ts creates a PikkuFastifyServer.
5
- DO NOT TRIGGER when: just defining functions/wirings without Fastify-specific code.'
3
+ description: >-
4
+ Use when deploying a Pikku app with Fastify. Covers PikkuFastifyServer standalone and
5
+ pikkuFastifyPlugin for existing Fastify apps. TRIGGER when: code imports @pikku/fastify or
6
+ @pikku/fastify-plugin, user mentions Fastify deployment, or start.ts creates a
7
+ PikkuFastifyServer. DO NOT TRIGGER when: just defining functions/wirings without
8
+ Fastify-specific code.
6
9
  ---
7
10
 
8
11
  # Pikku Fastify Deployment
@@ -1,8 +1,11 @@
1
1
  ---
2
2
  name: pikku-deploy-lambda
3
- description: 'Use when deploying a Pikku app to AWS Lambda. Covers HTTP handlers, scheduled tasks, SQS queue workers, WebSocket via API Gateway, and cold start caching.
4
- TRIGGER when: code imports @pikku/lambda, user mentions Lambda/serverless/AWS deployment, or handler files export Lambda-typed functions.
5
- DO NOT TRIGGER when: just defining functions/wirings without Lambda-specific code.'
3
+ description: >-
4
+ Use when deploying a Pikku app to AWS Lambda. Covers HTTP handlers, scheduled tasks, SQS queue
5
+ workers, WebSocket via API Gateway, and cold start caching. TRIGGER when: code imports
6
+ @pikku/lambda, user mentions Lambda/serverless/AWS deployment, or handler files export
7
+ Lambda-typed functions. DO NOT TRIGGER when: just defining functions/wirings without
8
+ Lambda-specific code.
6
9
  ---
7
10
 
8
11
  # Pikku AWS Lambda Deployment
@@ -1,8 +1,10 @@
1
1
  ---
2
2
  name: pikku-deploy-nextjs
3
- description: 'Use when deploying a Pikku app with Next.js. Covers API route handlers, server-side data fetching, and RPC calls from Server Components.
4
- TRIGGER when: code imports @pikku/next, user mentions Next.js integration, or app/api route files use pikkuAPIRequest.
5
- DO NOT TRIGGER when: just defining functions/wirings without Next.js-specific code.'
3
+ description: >-
4
+ Use when deploying a Pikku app with Next.js. Covers API route handlers, server-side data
5
+ fetching, and RPC calls from Server Components. TRIGGER when: code imports @pikku/next, user
6
+ mentions Next.js integration, or app/api route files use pikkuAPIRequest. DO NOT TRIGGER when:
7
+ just defining functions/wirings without Next.js-specific code.
6
8
  ---
7
9
 
8
10
  # Pikku Next.js Deployment
@@ -1,8 +1,11 @@
1
1
  ---
2
2
  name: pikku-deploy-uws
3
- description: 'Use when deploying a Pikku app with uWebSockets.js. Covers PikkuUWSServer with built-in HTTP and WebSocket support, and pikkuWebsocketHandler for standalone ws library.
4
- TRIGGER when: code imports @pikku/uws or @pikku/ws, user mentions uWebSockets or high-performance server, or start.ts creates a PikkuUWSServer.
5
- DO NOT TRIGGER when: just defining functions/wirings without uWS-specific code.'
3
+ description: >-
4
+ Use when deploying a Pikku app with uWebSockets.js. Covers PikkuUWSServer with built-in HTTP and
5
+ WebSocket support, and pikkuWebsocketHandler for standalone ws library. TRIGGER when: code
6
+ imports @pikku/uws or @pikku/ws, user mentions uWebSockets or high-performance server, or
7
+ start.ts creates a PikkuUWSServer. DO NOT TRIGGER when: just defining functions/wirings without
8
+ uWS-specific code.
6
9
  ---
7
10
 
8
11
  # Pikku uWebSockets.js Deployment
@@ -17,7 +20,7 @@ Use this skill as an execution checklist, not reference material.
17
20
  4. Validate with the narrowest relevant command first, then run `pikku-verify` or `pikku all` when functions, wirings, schemas, or generated clients may have changed.
18
21
  5. If validation fails, fix the source cause and rerun validation. Do not paper over generated errors by editing generated files.
19
22
 
20
- Highest performance option. Handles both HTTP and WebSocket automatically.
23
+ Highest-throughput option among Pikku's runtimes. Handles both HTTP and WebSocket automatically.
21
24
 
22
25
  ```bash
23
26
  yarn add @pikku/uws
@@ -1,8 +1,14 @@
1
1
  ---
2
2
  name: pikku-deps
3
- description: 'Use for the Pikku dependency security audit: the `pikku audit` CLI command, the `.pikku/audit.json` artifact, the `SecurityAuditReport` type in @pikku/core, and the console Security screen (getSecurityAudit / runSecurityAudit / updateDependency + SecurityAuditView).
4
- TRIGGER when: user asks about `pikku audit`, dependency vulnerabilities/advisories, outdated dependencies, the Security screen/page in the console, updating a vulnerable dependency, or reading/rendering audit.json.
5
- DO NOT TRIGGER when: user asks about authentication/sessions/JWT (use pikku-security), permissions (use pikku-permissions), or secrets/env vars (use pikku-config).'
3
+ description: >-
4
+ Use for the Pikku dependency security audit: the `pikku audit` CLI command, the
5
+ `.pikku/audit.json` artifact, the `SecurityAuditReport` type in @pikku/core, and the console
6
+ Security screen (getSecurityAudit / runSecurityAudit / updateDependency + SecurityAuditView).
7
+ TRIGGER when: user asks about `pikku audit`, dependency vulnerabilities/advisories, outdated
8
+ dependencies, the Security screen/page in the console, updating a vulnerable dependency, or
9
+ reading/rendering audit.json. DO NOT TRIGGER when: user asks about authentication/sessions/JWT
10
+ (use pikku-security), permissions (use pikku-permissions), or secrets/env vars (use
11
+ pikku-config).
6
12
  installGroups: [core]
7
13
  ---
8
14
 
@@ -21,9 +27,10 @@ installGroups: [core]
21
27
  `SecuritySeverity` / `SecurityUpdateLevel`) are exported from **@pikku/core**.
22
28
  The CLI writes it, the addon reads it, the UI renders it — never redeclare
23
29
  the type at a call site.
24
- 3. Validate with `pikku tsc` after changes; the command never fails a build
25
- (advisories are informational; a missing/failed audit yields an
26
- empty-but-valid report).
30
+ 3. Validate with `pikku all --tsc` after changes it type-checks and **fails on
31
+ type errors**, like any real build gate. Separately, `pikku audit` never fails
32
+ a build: advisories are informational, and a missing/failed audit yields an
33
+ empty-but-valid report.
27
34
 
28
35
  ## The `pikku audit` command
29
36
 
@@ -1,10 +1,15 @@
1
1
  ---
2
2
  name: pikku-emails
3
- description: "Use when working with Pikku's file-based email templates: authoring HTML/subject/text templates, locales, partials and theme, running `pikku emails generate`, and rendering/sending them through an EmailService.
4
- TRIGGER when: code uses renderEmailTemplate, EmailTemplateName, EmailService, SendTemplateEmailInput, LocalEmailService, or imports from .pikku/email/pikku-emails.gen.
5
- TRIGGER when: the project has an emails/ directory (templates/, locales/, partials/, theme.json) or emailTemplatesDir in pikku.config.json.
6
- TRIGGER when: user asks to add/edit a transactional email (verification, password reset, invitation, receipt), wire email sending, or translate an email.
7
- DO NOT TRIGGER when: user asks about i18n for the app UI (use pikku-i18n) or auth flows in general (use pikku-better-auth)."
3
+ description: >-
4
+ Use when working with Pikku's file-based email templates: authoring HTML/subject/text templates,
5
+ locales, partials and theme, running `pikku emails generate`, and rendering/sending them through
6
+ an EmailService. TRIGGER when: code uses renderEmailTemplate, EmailTemplateName, EmailService,
7
+ SendTemplateEmailInput, LocalEmailService, or imports from .pikku/email/pikku-emails.gen.
8
+ TRIGGER when: the project has an emails/ directory (templates/, locales/, partials/, theme.json)
9
+ or emailTemplatesDir in pikku.config.json. TRIGGER when: user asks to add/edit a transactional
10
+ email (verification, password reset, invitation, receipt), wire email sending, or translate an
11
+ email. DO NOT TRIGGER when: user asks about i18n for the app UI (use pikku-i18n) or auth flows
12
+ in general (use pikku-better-auth).
8
13
  ---
9
14
 
10
15
  # Pikku Emails
@@ -128,7 +128,7 @@ in-app features don't.
128
128
  - **Secrets and env-vars: NEVER `process.env`.** Declare them with
129
129
  `wireSecret` (sensitive) or `wireVariable` (non-sensitive) — both with a
130
130
  zod schema for type-safe access. Read with
131
- `services.secrets.getSecretJSON('NAME')` or `services.variables.get('NAME')`.
131
+ `services.secrets.getSecret('NAME')` or `services.variables.get('NAME')`.
132
132
  See the **pikku-config** skill for the full pattern (including
133
133
  OAuth2 credentials). This applies even in `config.ts` and singleton
134
134
  service factories.
@@ -1,8 +1,11 @@
1
1
  ---
2
2
  name: pikku-gateway-slack
3
- description: 'Use when integrating Slack with a Pikku app. Covers SlackGatewayAdapter, slash commands, OAuth flow, message handling, and signature verification.
4
- TRIGGER when: code uses SlackGatewayAdapter, parseSlashCommand, buildSlackInstallUrl, or user asks about Slack integration, Slack bots, or @pikku/gateway-slack.
5
- DO NOT TRIGGER when: user asks about general gateway/webhook patterns (use pikku-trigger).'
3
+ description: >-
4
+ Use when integrating Slack with a Pikku app. Covers SlackGatewayAdapter, slash commands, OAuth
5
+ flow, message handling, and signature verification. TRIGGER when: code uses SlackGatewayAdapter,
6
+ parseSlashCommand, buildSlackInstallUrl, or user asks about Slack integration, Slack bots, or
7
+ @pikku/gateway-slack. DO NOT TRIGGER when: user asks about general gateway/webhook patterns (use
8
+ pikku-trigger).
6
9
  ---
7
10
 
8
11
  # Pikku Gateway Slack
@@ -1,8 +1,12 @@
1
1
  ---
2
2
  name: pikku-http
3
- description: 'Use when adding HTTP routes, REST APIs, web endpoints, or SSE streams to a Pikku app. Covers wireHTTP, defineHTTPRoutes, route groups, auth, middleware, permissions, SSE, and generated fetch client.
4
- TRIGGER when: code uses wireHTTP/defineHTTPRoutes/wireHTTPRoutes, user asks about REST endpoints, API routes, SSE, or the generated fetch client.
5
- DO NOT TRIGGER when: user asks about WebSocket (use pikku-websocket), queue workers (use pikku-queue), or deployment (use pikku-deploy-*).'
3
+ description: >-
4
+ Use when adding HTTP routes, REST APIs, web endpoints, or SSE streams to a Pikku app. Covers
5
+ wireHTTP, defineHTTPRoutes, route groups, auth, middleware, SSE, and generated
6
+ fetch client. TRIGGER when: code uses wireHTTP/defineHTTPRoutes/wireHTTPRoutes, user asks about
7
+ REST endpoints, API routes, SSE, or the generated fetch client. DO NOT TRIGGER when: user asks
8
+ about WebSocket (use pikku-websocket), queue workers (use pikku-queue), or deployment (use
9
+ pikku-deploy-*).
6
10
  installGroups: [core]
7
11
  ---
8
12
 
@@ -18,7 +22,7 @@ Use this skill as an execution checklist, not reference material.
18
22
  4. Validate with the narrowest relevant command first, then run `pikku-verify` or `pikku all` when functions, wirings, schemas, or generated clients may have changed.
19
23
  5. If validation fails, fix the source cause and rerun validation. Do not paper over generated errors by editing generated files.
20
24
 
21
- Wire Pikku functions to HTTP endpoints. Supports single routes, composable route groups, auth, middleware, permissions, SSE, and auto-generated type-safe clients.
25
+ Wire Pikku functions to HTTP endpoints. Supports single routes, composable route groups, auth, middleware, SSE, and auto-generated type-safe clients. (Authorization lives on the function, not the wiring — see `pikku-permissions`.)
22
26
 
23
27
  ## Before You Start
24
28
 
@@ -50,11 +54,7 @@ addHTTPMiddleware('*', [authBearer()]) // All routes
50
54
  addHTTPMiddleware('/api/*', [rateLimit()]) // Pattern match
51
55
  ```
52
56
 
53
- ### `addHTTPPermission(pattern, permissions)`
54
-
55
- ```typescript
56
- addHTTPPermission('/admin/*', { admin: [isAdmin] })
57
- ```
57
+ > HTTP-route-level permissions (`addHTTPPermission`, a `permissions` field on the wiring) were removed in #972. Declare authorization on the function definition (`pikkuFunc({ permissions })`, see `pikku-permissions`), or app-wide via `addGlobalPermission`. Tags/patterns are for *middleware* only now.
58
58
 
59
59
  ## Data Flow
60
60
 
@@ -107,24 +107,18 @@ wireHTTPRoutes({
107
107
  // Results in: GET /api/v1/books, POST /api/v1/books, GET /api/v1/todos, etc.
108
108
  ```
109
109
 
110
- ### Auth & Permissions
110
+ ### Auth
111
111
 
112
112
  ```typescript
113
113
  // Public route (no auth)
114
114
  wireHTTP({ method: 'get', route: '/books', func: listBooks, auth: false })
115
115
 
116
- // Route with permission check
117
- wireHTTP({
118
- method: 'delete',
119
- route: '/books/:bookId',
120
- func: deleteBook,
121
- permissions: { admin: isAdmin },
122
- })
123
-
124
- // Pattern-based permissions
125
- addHTTPPermission('/admin/*', { admin: isAdmin })
116
+ // Authenticated route (default when a global auth middleware is set)
117
+ wireHTTP({ method: 'delete', route: '/books/:bookId', func: deleteBook })
126
118
  ```
127
119
 
120
+ Authorization is not a wiring concern — declare it on the function via `permissions` (see `pikku-permissions`), or app-wide via `addGlobalPermission`.
121
+
128
122
  ### Middleware
129
123
 
130
124
  ```typescript
@@ -178,7 +172,7 @@ const getTodos = pikkuFunc({
178
172
 
179
173
  ### Generated Fetch Client
180
174
 
181
- After `npx pikku prebuild`, a type-safe client is generated:
175
+ After `npx pikku all`, a type-safe client is generated:
182
176
 
183
177
  ```typescript
184
178
  import { pikkuFetch } from '.pikku/pikku-fetch.gen.js'
@@ -11,7 +11,6 @@ Wire a single function to an HTTP endpoint. Import from `@pikku/core/http`.
11
11
  | `func` | `PikkuFunc` | The function to call |
12
12
  | `auth?` | `boolean` | Override default auth (`true` = require session) |
13
13
  | `tags?` | `string[]` | For grouping, middleware targeting |
14
- | `permissions?` | `Record<string, PikkuPermission \| PikkuPermission[]>` | Permission checks |
15
14
  | `middleware?` | `PikkuMiddleware[]` | Per-route middleware |
16
15
  | `sse?` | `boolean` | Enable Server-Sent Events |
17
16
  | `contentType?` | `'xml' \| 'json'` | Response content type |
@@ -35,7 +34,6 @@ const routes = defineHTTPRoutes({
35
34
  route: string,
36
35
  func: PikkuFunc,
37
36
  auth?: boolean, // Override group auth
38
- permissions?: Record<string, PikkuPermission | PikkuPermission[]>,
39
37
  middleware?: PikkuMiddleware[],
40
38
  }
41
39
  }
@@ -1,8 +1,13 @@
1
1
  ---
2
2
  name: pikku-info
3
- description: 'Discover what exists in a Pikku project — functions, tags, middleware, permissions, HTTP routes, channels, schedulers, queues, and more. Use when you need to understand the project structure, find existing functions, or check what middleware and permissions are defined.
4
- TRIGGER when: user asks "what functions exist?", "show me the project structure", "list routes/middleware/permissions", or needs to understand an existing Pikku codebase.
5
- DO NOT TRIGGER when: user is writing new code (use the specific wiring skill) or asking about Pikku concepts (use pikku-concepts).'
3
+ description: >-
4
+ Discover what exists in a Pikku project — functions, tags, middleware, permissions, HTTP routes,
5
+ channels, schedulers, queues, and more. Use when you need to understand the project structure,
6
+ find existing functions, or check what middleware and permissions are defined. TRIGGER when:
7
+ user asks "what functions exist?", "show me the project structure", "list
8
+ routes/middleware/permissions", or needs to understand an existing Pikku codebase. DO NOT
9
+ TRIGGER when: user is writing new code (use the specific wiring skill) or asking about Pikku
10
+ concepts (use pikku-concepts).
6
11
  installGroups: [core]
7
12
  allowed-tools: Bash(yarn pikku info *)
8
13
  argument-hint: '[functions|tags|middleware|permissions] [--verbose] [--limit N]'
@@ -42,7 +47,7 @@ yarn pikku info functions --verbose --silent
42
47
 
43
48
  ### Tags
44
49
 
45
- List all tags with counts of associated functions, middleware, and permissions:
50
+ List all tags with counts of associated functions and middleware:
46
51
 
47
52
  ```bash
48
53
  yarn pikku info tags --silent
@@ -1,8 +1,11 @@
1
1
  ---
2
2
  name: pikku-jose
3
- description: 'Use when setting up JWT authentication with the jose library in a Pikku app. Covers JoseJWTService constructor, secret rotation, token encoding/decoding/verification.
4
- TRIGGER when: code uses JoseJWTService, user asks about JWT setup, token signing, token verification, or @pikku/jose.
5
- DO NOT TRIGGER when: user asks about session middleware (use pikku-security) or general service setup (use pikku-services).'
3
+ description: >-
4
+ Use when setting up JWT authentication with the jose library in a Pikku app. Covers
5
+ JoseJWTService constructor, secret rotation, token encoding/decoding/verification. TRIGGER when:
6
+ code uses JoseJWTService, user asks about JWT setup, token signing, token verification, or
7
+ @pikku/jose. DO NOT TRIGGER when: user asks about session middleware (use pikku-security) or
8
+ general service setup (use pikku-services).
6
9
  ---
7
10
 
8
11
  # Pikku Jose (JWT Service)
@@ -1,8 +1,16 @@
1
1
  ---
2
2
  name: pikku-kysely
3
- description: 'Use when WRITING KYSELY QUERIES (select/join/aggregate/insert/update/delete) inside a Pikku function body, or when setting up SQL database services with Kysely. Covers the query builder API (joins, aggregates + groupBy/having, returning, sql template, expression builder, $if, transactions, jsonArrayFrom relation helpers) AND @pikku/kysely service setup (channel stores, workflow services, secret services, AI storage, deployment services).
4
- TRIGGER when: writing any non-trivial kysely query (a join, an aggregate/count/sum, groupBy, subquery, transaction, or conditional query), the injected `kysely` service is used in a function body, or code uses PikkuKysely, KyselyChannelStore, KyselyWorkflowService, KyselySecretService, or the user asks about SQL setup with Pikku.
5
- DO NOT TRIGGER when: user asks about MongoDB (use pikku-mongodb) or Redis (use pikku-redis).'
3
+ description: >-
4
+ Use when WRITING KYSELY QUERIES (select/join/aggregate/insert/update/delete) inside a Pikku
5
+ function body, or when setting up SQL database services with Kysely. Covers the query builder
6
+ API (joins, aggregates + groupBy/having, returning, sql template, expression builder, $if,
7
+ transactions, jsonArrayFrom relation helpers) AND @pikku/kysely service setup (channel stores,
8
+ workflow services, secret services, AI storage, deployment services). TRIGGER when: writing any
9
+ non-trivial kysely query (a join, an aggregate/count/sum, groupBy, subquery, transaction, or
10
+ conditional query), the injected `kysely` service is used in a function body, or code uses
11
+ PikkuKysely, KyselyChannelStore, KyselyWorkflowService, KyselySecretService, or the user asks
12
+ about SQL setup with Pikku. DO NOT TRIGGER when: user asks about MongoDB (use pikku-mongodb) or
13
+ Redis (use pikku-redis).
6
14
  installGroups: [core]
7
15
  ---
8
16
 
@@ -156,8 +164,8 @@ const secrets = new PgKyselySecretService(db.kysely, {
156
164
  })
157
165
  await secrets.init()
158
166
 
159
- await secrets.setSecretJSON('api-key', { key: 'sk-...' })
160
- const value = await secrets.getSecretJSON<{ key: string }>('api-key')
167
+ await secrets.setSecret('api-key', { key: 'sk-...' })
168
+ const value = await secrets.getSecret<{ key: string }>('api-key')
161
169
  await secrets.rotateKEK() // Re-encrypt all secrets with new KEK
162
170
  ```
163
171
 
@@ -1,8 +1,14 @@
1
1
  ---
2
2
  name: pikku-machine-auth
3
- description: 'Use when authenticating a CLI/agent/service against a Pikku server, adding machine-to-machine (M2M) auth, issuing scoped API keys for sandboxes/agents/workers, or wiring better-auth sessions into Pikku middleware. Covers `pikku login` (device-authorization), the better-auth API Key plugin, machine identities, and `betterAuthSession` with the api-key branch.
4
- TRIGGER when: user asks about CLI login, `pikku login`, machine agents, service-to-service auth, API keys, client credentials, sandbox/worker tokens, or resolving a better-auth session in a Pikku function.
5
- DO NOT TRIGGER when: user asks about end-user HTTP session/cookie auth only (use pikku-http + the app betterAuth config) or about WebSocket channel mechanics (use pikku-websocket).'
3
+ description: >-
4
+ Use when authenticating a CLI/agent/service against a Pikku server, adding machine-to-machine
5
+ (M2M) auth, issuing scoped API keys for sandboxes/agents/workers, or wiring better-auth sessions
6
+ into Pikku middleware. Covers `pikku login` (device-authorization), the better-auth API Key
7
+ plugin, machine identities, and `betterAuthSession` with the api-key branch. TRIGGER when: user
8
+ asks about CLI login, `pikku login`, machine agents, service-to-service auth, API keys, client
9
+ credentials, sandbox/worker tokens, or resolving a better-auth session in a Pikku function. DO
10
+ NOT TRIGGER when: user asks about end-user HTTP session/cookie auth only (use pikku-http + the
11
+ app betterAuth config) or about WebSocket channel mechanics (use pikku-websocket).
6
12
  ---
7
13
 
8
14
  # Pikku Machine Auth
@@ -1,8 +1,12 @@
1
1
  ---
2
2
  name: pikku-mcp
3
- description: 'Use when exposing Pikku functions as MCP tools, resources, or prompts for AI assistants. Covers mcp: true flag, pikkuMCPResourceFunc, pikkuMCPPromptFunc, and MCP wire object.
4
- TRIGGER when: code uses mcp: true or pikkuMCPResourceFunc/pikkuMCPPromptFunc, user asks about MCP, Model Context Protocol, AI tool integration, or exposing functions to Claude/ChatGPT.
5
- DO NOT TRIGGER when: user asks about AI agents (use pikku-ai-agent) or general function definitions (use pikku-concepts).'
3
+ description: >-
4
+ Use when exposing Pikku functions as MCP tools, resources, or prompts for AI assistants. Covers
5
+ mcp: true flag, pikkuMCPResourceFunc, pikkuMCPPromptFunc, and MCP wire object. TRIGGER when:
6
+ code uses mcp: true or pikkuMCPResourceFunc/pikkuMCPPromptFunc, user asks about MCP, Model
7
+ Context Protocol, AI tool integration, or exposing functions to Claude/ChatGPT. DO NOT TRIGGER
8
+ when: user asks about AI agents (use pikku-ai-agent) or general function definitions (use
9
+ pikku-concepts).
6
10
  installGroups: [core]
7
11
  ---
8
12