@pikku/skills 0.12.22 → 0.12.26

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 (106) hide show
  1. package/CHANGELOG.md +134 -0
  2. package/dist/skills.gen.js +1 -1
  3. package/package.json +1 -1
  4. package/skills/pikku-a11y/SKILL.md +59 -0
  5. package/skills/pikku-addon/SKILL.md +2 -2
  6. package/skills/pikku-agent/SKILL.md +67 -316
  7. package/skills/pikku-agent/references/agents.md +299 -0
  8. package/skills/{pikku-ai-vercel/SKILL.md → pikku-agent/references/runner-vercel.md} +2 -24
  9. package/skills/{pikku-ai-voice/SKILL.md → pikku-agent/references/voice.md} +1 -22
  10. package/skills/pikku-architect/SKILL.md +265 -0
  11. package/skills/pikku-auth/SKILL.md +89 -0
  12. package/skills/{pikku-better-auth/SKILL.md → pikku-auth/references/better-auth.md} +126 -34
  13. package/skills/{pikku-jose/SKILL.md → pikku-auth/references/jose.md} +1 -23
  14. package/skills/{pikku-machine-auth/SKILL.md → pikku-auth/references/machine-auth.md} +0 -23
  15. package/skills/pikku-auth/references/permissions.md +261 -0
  16. package/skills/{pikku-security/SKILL.md → pikku-auth/references/sessions.md} +0 -20
  17. package/skills/pikku-build/SKILL.md +88 -0
  18. package/skills/{pikku-build-app/SKILL.md → pikku-build/references/app.md} +76 -24
  19. package/skills/{pikku-feature/SKILL.md → pikku-build/references/feature.md} +1 -8
  20. package/skills/{pikku-build-app → pikku-build}/references/multi-app.md +56 -1
  21. package/skills/{pikku-build-platform/SKILL.md → pikku-build/references/platform.md} +22 -37
  22. package/skills/{pikku-template-clone/SKILL.md → pikku-build/references/post-clone.md} +0 -6
  23. package/skills/{pikku-build-quick/SKILL.md → pikku-build/references/quick.md} +4 -20
  24. package/skills/{pikku-build-app → pikku-build}/references/ship.md +9 -3
  25. package/skills/pikku-concepts/SKILL.md +72 -7
  26. package/skills/pikku-concepts/references/concept-mapping.md +8 -8
  27. package/skills/pikku-deploy/SKILL.md +158 -0
  28. package/skills/{pikku-deploy-azure/SKILL.md → pikku-deploy/references/azure.md} +18 -50
  29. package/skills/pikku-deploy/references/cloudflare.md +104 -0
  30. package/skills/pikku-deploy/references/express.md +92 -0
  31. package/skills/{pikku-deploy-fastify/SKILL.md → pikku-deploy/references/fastify.md} +8 -32
  32. package/skills/{pikku-deploy-lambda/SKILL.md → pikku-deploy/references/lambda.md} +6 -27
  33. package/skills/{pikku-deploy-nextjs/SKILL.md → pikku-deploy/references/nextjs.md} +9 -33
  34. package/skills/pikku-deploy/references/uws.md +72 -0
  35. package/skills/pikku-deploy/references/ws.md +75 -0
  36. package/skills/pikku-emails/SKILL.md +3 -2
  37. package/skills/pikku-fabric/SKILL.md +47 -20
  38. package/skills/{pikku-fabric-debug/SKILL.md → pikku-fabric/references/debugging.md} +0 -6
  39. package/skills/pikku-i18n/SKILL.md +62 -207
  40. package/skills/{pikku-paraglide/SKILL.md → pikku-i18n/references/enum-labels.md} +0 -6
  41. package/skills/pikku-i18n/references/messages.md +218 -0
  42. package/skills/{pikku-rtl/SKILL.md → pikku-i18n/references/rtl.md} +3 -9
  43. package/skills/pikku-knowledge/SKILL.md +15 -0
  44. package/skills/pikku-kysely/SKILL.md +13 -13
  45. package/skills/pikku-list-query/SKILL.md +163 -0
  46. package/skills/pikku-meta/SKILL.md +58 -130
  47. package/skills/{pikku-deps/SKILL.md → pikku-meta/references/audit.md} +1 -17
  48. package/skills/pikku-meta/references/meta.md +114 -0
  49. package/skills/{pikku-versioning/SKILL.md → pikku-meta/references/versioning.md} +0 -26
  50. package/skills/pikku-middleware/SKILL.md +5 -5
  51. package/skills/pikku-n8n-import/SKILL.md +0 -1
  52. package/skills/pikku-permissions/SKILL.md +75 -229
  53. package/skills/pikku-react/SKILL.md +50 -298
  54. package/skills/pikku-react/references/client.md +313 -0
  55. package/skills/{pikku-react-query/SKILL.md → pikku-react/references/react-query.md} +2 -22
  56. package/skills/{pikku-workflows-client/SKILL.md → pikku-react/references/workflows.md} +1 -22
  57. package/skills/pikku-realtime/SKILL.md +110 -251
  58. package/skills/pikku-scenario/SKILL.md +60 -45
  59. package/skills/pikku-scenario/references/persona-run.md +148 -0
  60. package/skills/pikku-seo/SKILL.md +133 -0
  61. package/skills/pikku-service-backends/SKILL.md +154 -0
  62. package/skills/pikku-service-backends/references/aws.md +106 -0
  63. package/skills/pikku-service-backends/references/backblaze.md +57 -0
  64. package/skills/pikku-service-backends/references/mongodb.md +90 -0
  65. package/skills/pikku-service-backends/references/redis.md +75 -0
  66. package/skills/pikku-service-backends/references/schema.md +63 -0
  67. package/skills/pikku-services/SKILL.md +68 -291
  68. package/skills/{pikku-audit/SKILL.md → pikku-services/references/audit.md} +0 -22
  69. package/skills/{pikku-config/SKILL.md → pikku-services/references/config.md} +1 -25
  70. package/skills/{pikku-pino/SKILL.md → pikku-services/references/pino.md} +0 -20
  71. package/skills/pikku-services/references/services.md +272 -0
  72. package/skills/pikku-software-archaeology/README.md +5 -1
  73. package/skills/pikku-software-archaeology/SKILL.md +16 -2
  74. package/skills/{pikku-product-second-opinion/example/sample-report.md → pikku-software-archaeology/example/second-opinion-sample-report.md} +1 -1
  75. package/skills/pikku-software-archaeology/references/blueprint.schema.json +1 -1
  76. package/skills/pikku-software-archaeology/references/pikku-mapping.md +3 -3
  77. package/skills/{pikku-product-second-opinion/SKILL.md → pikku-software-archaeology/references/second-opinion.md} +4 -9
  78. package/skills/pikku-webhook/SKILL.md +224 -0
  79. package/skills/pikku-wiring/SKILL.md +180 -0
  80. package/skills/{pikku-websocket/SKILL.md → pikku-wiring/references/channel.md} +2 -35
  81. package/skills/{pikku-cli/SKILL.md → pikku-wiring/references/cli.md} +1 -33
  82. package/skills/{pikku-gateway-slack/SKILL.md → pikku-wiring/references/gateway-slack.md} +0 -23
  83. package/skills/{pikku-http/SKILL.md → pikku-wiring/references/http.md} +3 -39
  84. package/skills/{pikku-mcp/SKILL.md → pikku-wiring/references/mcp.md} +0 -33
  85. package/skills/{pikku-queue/SKILL.md → pikku-wiring/references/queue.md} +1 -33
  86. package/skills/pikku-wiring/references/realtime.md +265 -0
  87. package/skills/{pikku-rpc/SKILL.md → pikku-wiring/references/rpc.md} +0 -32
  88. package/skills/{pikku-schedule/SKILL.md → pikku-wiring/references/scheduler.md} +1 -35
  89. package/skills/{pikku-trigger/SKILL.md → pikku-wiring/references/trigger.md} +0 -43
  90. package/skills/pikku-workflow/SKILL.md +39 -2
  91. package/skills/pikku-aws/SKILL.md +0 -161
  92. package/skills/pikku-backblaze/SKILL.md +0 -104
  93. package/skills/pikku-deploy-cloudflare/SKILL.md +0 -123
  94. package/skills/pikku-deploy-express/SKILL.md +0 -122
  95. package/skills/pikku-deploy-uws/SKILL.md +0 -144
  96. package/skills/pikku-mongodb/SKILL.md +0 -113
  97. package/skills/pikku-product-second-opinion/README.md +0 -43
  98. package/skills/pikku-redis/SKILL.md +0 -99
  99. package/skills/pikku-schema-ajv/SKILL.md +0 -83
  100. package/skills/pikku-schema-cfworker/SKILL.md +0 -82
  101. package/skills/pikku-ws/SKILL.md +0 -87
  102. /package/skills/{pikku-build-app → pikku-build}/references/theming.md +0 -0
  103. /package/skills/{pikku-product-second-opinion/references/report-template.md → pikku-software-archaeology/references/second-opinion-report-template.md} +0 -0
  104. /package/skills/{pikku-cli/references/complete-example.md → pikku-wiring/references/cli-complete-example.md} +0 -0
  105. /package/skills/{pikku-http → pikku-wiring}/references/http-options.md +0 -0
  106. /package/skills/{pikku-realtime/references/other-routes.md → pikku-wiring/references/realtime-other-routes.md} +0 -0
@@ -0,0 +1,180 @@
1
+ ---
2
+ name: pikku-wiring
3
+ description: >-
4
+ Use when exposing a Pikku function over a transport — HTTP routes and SSE, WebSocket channels,
5
+ typed realtime pub/sub, internal and exposed RPC, queue workers, cron schedules, event triggers,
6
+ MCP tools/resources/prompts, CLI commands, or a Slack gateway. Covers choosing the wiring, the
7
+ model every wiring shares, and what differs: which function type each needs, where a session
8
+ comes from, and which calls throw instead of returning. TRIGGER when: code uses wireHTTP,
9
+ defineHTTPRoutes, wireChannel, wireQueueWorker, wireScheduler, wireTrigger, wireTriggerSource,
10
+ wireCLI, wireMCPResource, wireMCPPrompt, `mcp: true`, `sse: true`, `expose: true`, rpc.invoke,
11
+ SlackGatewayAdapter, or the user asks how to expose, route, schedule, queue, stream or publish a
12
+ function. DO NOT TRIGGER when: writing the function body itself (use pikku-concepts), declaring
13
+ authorization (use pikku-auth), or serving the app on a runtime (use pikku-deploy).
14
+ installGroups: [core]
15
+ ---
16
+
17
+ # Pikku Wiring
18
+
19
+ ## Agent Operating Procedure
20
+
21
+ Use this skill as an execution checklist, not reference material.
22
+
23
+ 1. Discover before editing. Run the relevant `pikku meta ... --json` command and inspect only the focused output you need.
24
+ 2. Identify the source files that own the behavior. Do not start by reading generated output, `.pikku`, `node_modules`, vendored packages, or broad build artifacts.
25
+ 3. Make the smallest source change that satisfies the task. Keep generated files generated, and avoid hand-editing SDKs, schema output, or typegen.
26
+ 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.
27
+ 5. If validation fails, fix the source cause and rerun validation. Do not paper over generated errors by editing generated files.
28
+
29
+ ## Before you start
30
+
31
+ ```bash
32
+ pikku info functions --verbose # existing functions, their types, tags, middleware
33
+ pikku info tags --verbose # project organisation and naming conventions
34
+ pikku info middleware --verbose # what middleware is already applied
35
+ ```
36
+
37
+ Follow the patterns you find. Option tables and exact signatures come from
38
+ `pikku doc` — run `pikku doc --ai` for the installed surface. This skill is what
39
+ the compiler cannot tell you: which wiring to reach for, and what changes when
40
+ you move a function from one to another.
41
+
42
+ ## What a wiring is
43
+
44
+ A **function** owns behaviour, its `input`/`output` schemas, and its
45
+ authorization. A **wiring** owns only the transport: how a caller reaches that
46
+ function. The same function can be wired to several transports at once, which is
47
+ why nothing transport-specific belongs in its body.
48
+
49
+ Three consequences that hold for every wiring below:
50
+
51
+ - **Input and output types are never declared on the wiring.** They come from the
52
+ function's own `input:`/`output:` schemas. Route params, query params and body
53
+ are merged into the function's `data` argument.
54
+ - **Permissions are never declared on the wiring.** Wire-level permissions were
55
+ removed in #972 — declare them on the function (`pikkuFunc({ permissions })`,
56
+ see `pikku-auth`) or app-wide via `addGlobalPermission`. Tags and
57
+ patterns now target *middleware* only.
58
+ - **The wire is the third argument**, not a service. `channel`, `rpc`, `session`,
59
+ `setSession`, `mcp`, `queue`, `scheduledTask` and `cli` all live there.
60
+
61
+ ## Import from `#pikku/*`, never `@pikku/core/*`
62
+
63
+ Every wiring factory has two versions. The generated `#pikku/*` entrypoint binds
64
+ it to your project's service, session and middleware types; the `@pikku/core/*`
65
+ export is the unbound generic. **Both compile.** Importing from core costs you
66
+ exactly the typing that makes the wiring worth having, silently.
67
+
68
+ | Wiring | Import from |
69
+ | --- | --- |
70
+ | `wireHTTP`, `defineHTTPRoutes`, `wireHTTPRoutes` | `#pikku/http` |
71
+ | `wireChannel`, `defineChannelRoutes` | `#pikku/channel` |
72
+ | `wireQueueWorker` | `#pikku/queue` |
73
+ | `wireScheduler` | `#pikku/scheduler` |
74
+ | `wireTrigger`, `wireTriggerSource`, `pikkuTriggerFunc` | `#pikku/trigger` |
75
+ | `wireCLI`, `pikkuCLICommand`, `pikkuCLIRender` | `#pikku/cli` |
76
+ | `pikkuMCPToolFunc`, `pikkuMCPResourceFunc`, `pikkuMCPPromptFunc`, `wireMCPResource`, `wireMCPPrompt` | `#pikku/mcp` |
77
+
78
+ ## Pick a wiring
79
+
80
+ | Reach for | When | Reference |
81
+ | --- | --- | --- |
82
+ | **HTTP** | REST endpoints, web APIs, and SSE streams (`sse: true`, `get` only) | `references/http.md` |
83
+ | **Channel** | A hand-designed WebSocket protocol with your own action routing | `references/channel.md` |
84
+ | **Realtime** | Typed pub/sub push — the scaffolded `/events` channel and SSE topics | `references/realtime.md` |
85
+ | **RPC** | One function calling another, or dispatching a name from outside | `references/rpc.md` |
86
+ | **Queue** | Reliable background work that must survive a crash and retry | `references/queue.md` |
87
+ | **Scheduler** | Recurring work on a cron expression | `references/scheduler.md` |
88
+ | **Trigger** | Reacting in-process to an external event source (Redis pub/sub, PG LISTEN) | `references/trigger.md` |
89
+ | **MCP** | Exposing functions to an AI assistant as tools, resources or prompts | `references/mcp.md` |
90
+ | **CLI** | A terminal program with commands, subcommands and options | `references/cli.md` |
91
+ | **Gateway** | An inbound integration from a third-party product — Slack is the shipped adapter | `references/gateway-slack.md` |
92
+
93
+ Realtime and Channel are the pair most often confused. If the shape is "server
94
+ pushes typed events to subscribers", use Realtime — `pikku enable events`
95
+ generates the channel, the SSE route and the cleanup for you. Reach for Channel
96
+ only when the client also sends structured messages you need to route on.
97
+
98
+ ## What differs, and where it bites
99
+
100
+ ### Each wiring demands a particular function type
101
+
102
+ | Wiring | Function type | Why |
103
+ | --- | --- | --- |
104
+ | HTTP, Channel, Queue, CLI, MCP | `pikkuFunc` / `pikkuSessionlessFunc` | Ordinary request/response |
105
+ | Scheduler | **`pikkuVoidFunc`** | A cron has no input and no caller to return to |
106
+ | Trigger *source* | **`pikkuTriggerFunc`** | Runs **once at startup**, not once per event |
107
+
108
+ A trigger source is the one that surprises people: it sets up a listener, calls
109
+ `trigger.invoke(...)` per event, and returns a teardown function. It receives
110
+ **singleton services only** — no session, no request, no per-wire services,
111
+ because the listener outlives every event it emits.
112
+
113
+ ### Where a session comes from is not uniform
114
+
115
+ An HTTP or channel caller arrives with credentials and middleware mints a
116
+ session. Nothing else does.
117
+
118
+ - **A cron runs with no session at all.** It cannot invoke a permission- or
119
+ scope-gated RPC, and nothing it writes can be attributed. A scheduled task is a
120
+ machine principal — give it one in the task's own `middleware`, exactly as a
121
+ bearer-authenticated caller gets one. See the machine-auth section of
122
+ `pikku-middleware`.
123
+ - **A queue worker and a trigger handler are the same case.** Whatever identity
124
+ they need is minted in middleware, not inherited.
125
+ - **A channel authenticates per action.** `setSession` is on the wire, and an
126
+ `auth: false` action (conventionally `authenticate`) is how the session is
127
+ established mid-connection.
128
+ - **`auth` on `wireCLI` guards only the generated websocket channel.** A locally
129
+ executed CLI has no connection to authenticate, so it is not a way to require a
130
+ session for local runs.
131
+
132
+ ### Some control-flow calls throw instead of returning
133
+
134
+ `wire.scheduledTask.skip(reason)` and `wire.queue.discard(reason)` both read like
135
+ an early return and are not — they throw, so nothing after the call runs and no
136
+ `return` is needed. The consequence lands in middleware: a `try/catch` around
137
+ `await next()` catches a skip or a discard and reports it as a failure. If your
138
+ middleware distinguishes success from failure, let those pass through rather than
139
+ logging them as errors.
140
+
141
+ ### Delivery semantics differ, and that is usually the real choice
142
+
143
+ | Wiring | Delivery | Runs where |
144
+ | --- | --- | --- |
145
+ | Trigger | **At-most-once**, synchronous | In-process, alongside the listener |
146
+ | Queue | **At-least-once** with retries and a dead-letter queue | Distributed workers |
147
+ | Scheduler | Depends on the runtime — see below | Wherever the scheduler service runs |
148
+
149
+ Reach for a trigger to react immediately, and a queue when the work must not be
150
+ lost. A trigger that must not drop events is a queue with extra steps.
151
+
152
+ Scheduled tasks are the trap: on serverless runtimes the same `wireScheduler`
153
+ declaration behaves three different ways, and the deployment unit rather than the
154
+ cron expression can decide which tasks fire. `pikku-deploy` has the comparison.
155
+
156
+ ### Codegen owns several wirings — do not hand-write them
157
+
158
+ | Turn it on | Codegen writes | Never hand-write |
159
+ | --- | --- | --- |
160
+ | `pikku enable rpc` | `rpc-public.gen.ts` — the `POST /rpc/:rpcName` route | A second route on the same path collides |
161
+ | `pikku enable events` | `events.gen.ts` — the `/events` channel and `GET /events/:topic` | A hand-rolled `/events` misses disconnect cleanup |
162
+ | `wireCLI` | `<program>-channel.gen.ts` — the same commands over a channel | It is regenerated on every build |
163
+
164
+ Enabling the RPC endpoint says the endpoint exists, not who may call it — each
165
+ `expose: true` function is still gated by its own `auth`, permissions and scopes.
166
+
167
+ ## What NOT to do
168
+
169
+ - Do not import a wiring factory from `@pikku/core/*`. It compiles and silently
170
+ drops your project's types; use the `#pikku/*` entrypoint.
171
+ - Do not put `permissions` on a wiring. They were removed in #972 and belong on
172
+ the function.
173
+ - Do not declare input or output types on a wiring — they come from the
174
+ function's schemas.
175
+ - Do not `return` after `skip()` or `discard()`, and do not let middleware
176
+ report them as failures.
177
+ - Do not hand-write `/rpc/:rpcName`, `/events`, or a CLI's channel file.
178
+ - Do not reach for a trigger when losing an event matters — use a queue.
179
+ - Do not put `sse: true` on anything but a `get`, or `query` on anything but a
180
+ `post`; the config union rejects both rather than failing at runtime.
@@ -1,44 +1,11 @@
1
- ---
2
- name: pikku-websocket
3
- description: >-
4
- Use when adding real-time features, WebSocket channels, live updates, chat, or pub/sub to a
5
- Pikku app. Covers wireChannel, action routing, auth, EventHub pub/sub, channel middleware, and
6
- generated WebSocket client. TRIGGER when: code uses wireChannel, user asks about WebSocket,
7
- real-time, live updates, chat, pub/sub, or the generated WebSocket client. DO NOT TRIGGER when:
8
- user asks about HTTP/REST (use pikku-http), SSE (use pikku-http with sse: true), or WebSocket
9
- deployment specifics (use pikku-deploy-uws), or typed pub/sub events (use pikku-realtime).
10
- installGroups: [core]
11
- ---
12
-
13
1
  # Pikku WebSocket Wiring
14
2
 
15
- ## Agent Operating Procedure
16
-
17
- Use this skill as an execution checklist, not reference material.
18
-
19
- 1. Discover before editing. Run the relevant `pikku meta ... --json` command and inspect only the focused output you need.
20
- 2. Identify the source files that own the behavior. Do not start by reading generated output, `.pikku`, `node_modules`, vendored packages, or broad build artifacts.
21
- 3. Make the smallest source change that satisfies the task. Keep generated files generated, and avoid hand-editing SDKs, schema output, or typegen.
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.
23
- 5. If validation fails, fix the source cause and rerun validation. Do not paper over generated errors by editing generated files.
24
-
25
- Wire Pikku functions to WebSocket channels with structured message routing, auth per-action, pub/sub via EventHub, and auto-generated type-safe clients.
26
-
27
- ## Before You Start
28
-
29
- ```bash
30
- pikku info functions --verbose # See existing functions and their types
31
- pikku info tags --verbose # Understand project organization
32
- ```
33
-
34
- Follow existing patterns. See `pikku-concepts` for the core mental model.
35
-
36
3
  ## API Reference
37
4
 
38
5
  ### `wireChannel(config)`
39
6
 
40
7
  ```typescript
41
- import { wireChannel } from '@pikku/core/channel'
8
+ import { wireChannel } from '#pikku/channel'
42
9
 
43
10
  wireChannel({
44
11
  name: string, // Channel name (e.g. 'todos')
@@ -66,7 +33,7 @@ wireChannel({
66
33
 
67
34
  Note there is **no `permissions` key on a message wiring** — wire-level
68
35
  permissions were removed in #972. Authorization lives on the function's own
69
- `permissions` field (see `pikku-permissions`).
36
+ `permissions` field (see `pikku-auth`).
70
37
 
71
38
  ### `pikkuChannelMiddleware(fn)`
72
39
 
@@ -1,37 +1,5 @@
1
- ---
2
- name: pikku-cli
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-meta) or HTTP endpoints (use pikku-http).
9
- installGroups: [core]
10
- ---
11
-
12
1
  # Pikku CLI Wiring
13
2
 
14
- ## Agent Operating Procedure
15
-
16
- Use this skill as an execution checklist, not reference material.
17
-
18
- 1. Discover before editing. Run the relevant `pikku meta ... --json` command and inspect only the focused output you need.
19
- 2. Identify the source files that own the behavior. Do not start by reading generated output, `.pikku`, `node_modules`, vendored packages, or broad build artifacts.
20
- 3. Make the smallest source change that satisfies the task. Keep generated files generated, and avoid hand-editing SDKs, schema output, or typegen.
21
- 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.
22
- 5. If validation fails, fix the source cause and rerun validation. Do not paper over generated errors by editing generated files.
23
-
24
- Wire Pikku functions as CLI commands with parameters, options, subcommands, and custom terminal renderers.
25
-
26
- ## Before You Start
27
-
28
- ```bash
29
- pikku info functions --verbose # See existing functions and their types
30
- pikku info tags --verbose # Understand project organization
31
- ```
32
-
33
- See `pikku-concepts` for the core mental model.
34
-
35
3
  ## API Reference
36
4
 
37
5
  ### `wireCLI(config)`
@@ -244,4 +212,4 @@ session for local runs. Don't hand-write or edit the generated channel file.
244
212
 
245
213
  ## Complete Example
246
214
 
247
- For a full functions + renderers + nested-subcommand wiring walkthrough, see `references/complete-example.md`.
215
+ For a full functions + renderers + nested-subcommand wiring walkthrough, see `cli-complete-example.md`.
@@ -1,28 +1,5 @@
1
- ---
2
- name: pikku-gateway-slack
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).
9
- installGroups: [core]
10
- ---
11
-
12
1
  # Pikku Gateway Slack
13
2
 
14
- ## Agent Operating Procedure
15
-
16
- Use this skill as an execution checklist, not reference material.
17
-
18
- 1. Discover before editing. Run the relevant `pikku meta ... --json` command and inspect only the focused output you need.
19
- 2. Identify the source files that own the behavior. Do not start by reading generated output, `.pikku`, `node_modules`, vendored packages, or broad build artifacts.
20
- 3. Make the smallest source change that satisfies the task. Keep generated files generated, and avoid hand-editing SDKs, schema output, or typegen.
21
- 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.
22
- 5. If validation fails, fix the source cause and rerun validation. Do not paper over generated errors by editing generated files.
23
-
24
- `@pikku/gateway-slack` provides a Slack Events API gateway adapter, slash command handling, OAuth installation flow, and message utilities.
25
-
26
3
  ## Installation
27
4
 
28
5
  ```bash
@@ -1,41 +1,5 @@
1
- ---
2
- name: pikku-http
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-*).
10
- installGroups: [core]
11
- ---
12
-
13
1
  # Pikku HTTP Wiring
14
2
 
15
- ## Agent Operating Procedure
16
-
17
- Use this skill as an execution checklist, not reference material.
18
-
19
- 1. Discover before editing. Run the relevant `pikku meta ... --json` command and inspect only the focused output you need.
20
- 2. Identify the source files that own the behavior. Do not start by reading generated output, `.pikku`, `node_modules`, vendored packages, or broad build artifacts.
21
- 3. Make the smallest source change that satisfies the task. Keep generated files generated, and avoid hand-editing SDKs, schema output, or typegen.
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.
23
- 5. If validation fails, fix the source cause and rerun validation. Do not paper over generated errors by editing generated files.
24
-
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`.)
26
-
27
- ## Before You Start
28
-
29
- Run these commands to understand the current project:
30
-
31
- ```bash
32
- pikku info functions --verbose # See existing functions, their types, tags, middleware
33
- pikku info tags --verbose # Understand project organization and naming conventions
34
- pikku info middleware --verbose # See what middleware is already applied
35
- ```
36
-
37
- Follow existing patterns you find (naming, tag usage, file organization). See `pikku-concepts` for the core mental model.
38
-
39
3
  ## API Reference
40
4
 
41
5
  All three come from `#pikku/http` (the generated `.pikku/http/index.ts`), which
@@ -50,7 +14,7 @@ Function input/output types come from the function's own `input:`/`output:` zod
50
14
 
51
15
  Config cascading across groups: `basePath` concatenates down the chain, `tags` merge (union), `auth` child overrides parent.
52
16
 
53
- For the full option tables (every `wireHTTP` field, the `defineHTTPRoutes`/`wireHTTPRoutes` config shape), read `references/http-options.md`.
17
+ For the full option tables (every `wireHTTP` field, the `defineHTTPRoutes`/`wireHTTPRoutes` config shape), read `http-options.md`.
54
18
 
55
19
  ### `addHTTPMiddleware(pattern, middlewares)`
56
20
 
@@ -59,7 +23,7 @@ addHTTPMiddleware('*', [authBearer()]) // All routes
59
23
  addHTTPMiddleware('/api/*', [rateLimit()]) // Pattern match
60
24
  ```
61
25
 
62
- > 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.
26
+ > 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-auth`), or app-wide via `addGlobalPermission`. Tags/patterns are for _middleware_ only now.
63
27
 
64
28
  ## Data Flow
65
29
 
@@ -122,7 +86,7 @@ wireHTTP({ method: 'get', route: '/books', func: listBooks, auth: false })
122
86
  wireHTTP({ method: 'delete', route: '/books/:bookId', func: deleteBook })
123
87
  ```
124
88
 
125
- Authorization is not a wiring concern — declare it on the function via `permissions` (see `pikku-permissions`), or app-wide via `addGlobalPermission`.
89
+ Authorization is not a wiring concern — declare it on the function via `permissions` (see `pikku-auth`), or app-wide via `addGlobalPermission`.
126
90
 
127
91
  ### Middleware
128
92
 
@@ -1,38 +1,5 @@
1
- ---
2
- name: pikku-mcp
3
- description: >-
4
- Use when exposing Pikku functions as MCP tools, resources, or prompts for AI assistants. Covers
5
- mcp: true, pikkuMCPToolFunc, pikkuMCPResourceFunc, pikkuMCPPromptFunc, wireMCPResource,
6
- wireMCPPrompt, the MCP wire object and PikkuMCPServer. TRIGGER when: code uses mcp: true or any
7
- pikkuMCP*Func/wireMCP* helper, user asks about MCP, Model Context Protocol, AI tool integration,
8
- or exposing functions to Claude/ChatGPT. DO NOT TRIGGER when: user asks about AI agents (use
9
- pikku-agent) or general function definitions (use pikku-concepts).
10
- installGroups: [core]
11
- ---
12
-
13
1
  # Pikku MCP Wiring
14
2
 
15
- ## Agent Operating Procedure
16
-
17
- Use this skill as an execution checklist, not reference material.
18
-
19
- 1. Discover before editing. Run the relevant `pikku meta ... --json` command and inspect only the focused output you need.
20
- 2. Identify the source files that own the behavior. Do not start by reading generated output, `.pikku`, `node_modules`, vendored packages, or broad build artifacts.
21
- 3. Make the smallest source change that satisfies the task. Keep generated files generated, and avoid hand-editing SDKs, schema output, or typegen.
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.
23
- 5. If validation fails, fix the source cause and rerun validation. Do not paper over generated errors by editing generated files.
24
-
25
- Expose Pikku functions as Model Context Protocol (MCP) tools, resources, and prompts for AI assistants like Claude, ChatGPT, and others.
26
-
27
- ## Before You Start
28
-
29
- ```bash
30
- pikku info functions --verbose # See existing functions that could become MCP tools
31
- pikku info tags --verbose # Understand project organization
32
- ```
33
-
34
- See `pikku-concepts` for the core mental model.
35
-
36
3
  ## The shape of MCP in Pikku
37
4
 
38
5
  MCP has three surfaces, and Pikku wires them differently:
@@ -1,43 +1,11 @@
1
- ---
2
- name: pikku-queue
3
- description: >-
4
- Use when adding background job processing, async task queues, or distributed workers to a Pikku
5
- app. Covers wireQueueWorker, job enqueuing, progress tracking, retries, BullMQ and PgBoss
6
- adapters. TRIGGER when: code uses wireQueueWorker, user asks about background jobs, task queues,
7
- async processing, BullMQ, PgBoss, or job retries. DO NOT TRIGGER when: user asks about scheduled
8
- cron tasks (use pikku-schedule) or event-driven triggers (use pikku-trigger).
9
- installGroups: [core]
10
- ---
11
-
12
1
  # Pikku Queue Wiring
13
2
 
14
- ## Agent Operating Procedure
15
-
16
- Use this skill as an execution checklist, not reference material.
17
-
18
- 1. Discover before editing. Run the relevant `pikku meta ... --json` command and inspect only the focused output you need.
19
- 2. Identify the source files that own the behavior. Do not start by reading generated output, `.pikku`, `node_modules`, vendored packages, or broad build artifacts.
20
- 3. Make the smallest source change that satisfies the task. Keep generated files generated, and avoid hand-editing SDKs, schema output, or typegen.
21
- 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.
22
- 5. If validation fails, fix the source cause and rerun validation. Do not paper over generated errors by editing generated files.
23
-
24
- Wire Pikku functions as background queue workers. Supports job control (progress, retry, discard), configurable concurrency, and type-safe job publishing.
25
-
26
- ## Before You Start
27
-
28
- ```bash
29
- pikku info functions --verbose # See existing functions and their types
30
- pikku info tags --verbose # Understand project organization
31
- ```
32
-
33
- See `pikku-concepts` for the core mental model.
34
-
35
3
  ## API Reference
36
4
 
37
5
  ### `wireQueueWorker(config)`
38
6
 
39
7
  ```typescript
40
- import { wireQueueWorker } from '@pikku/core/queue'
8
+ import { wireQueueWorker } from '#pikku/queue'
41
9
 
42
10
  wireQueueWorker({
43
11
  name: string, // Queue name (unique identifier)