@ericrisco/rsc 0.1.50 → 0.1.52

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.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: tauri
3
- description: "Use when building a lightweight cross-platform desktop (or v2 mobile) app with Tauri — a Rust core plus the OS-native WebView — wiring Rust commands and IPC, streaming data to the frontend, locking down the capabilities/permissions security model, or bundling and auto-updating tiny signed binaries. Triggers: 'build a Tauri app', 'expose a Rust command to my frontend', 'invoke from JS', 'tauri.conf.json', 'capabilities and permissions', 'stream download progress to the WebView', 'my command froze the UI', 'shrink my desktop binary vs Electron', 'set up the Tauri updater', 'crear una app d'escriptori lleugera amb Rust en lloc d'Electron', 'reducir el tamaño del binario de escritorio'. NOT a Chromium+Node desktop app that needs Node APIs in a main process (that is electron)."
3
+ description: "Use when building a lightweight cross-platform desktop (or v2 mobile) app with Tauri — a Rust core plus the OS-native WebView: Rust commands and IPC, streaming to the frontend, the default-deny capabilities/permissions ACL, bundling and signed auto-updates. NOT a Chromium+Node shell needing Node APIs in a main process (that is electron)."
4
4
  tags: [tauri, desktop, rust, cross-platform, ipc, webview]
5
5
  recommends: [rust, electron, react, secure-coding, github-actions]
6
6
  origin: risco
@@ -22,7 +22,8 @@ so the same Rust core can ship to mobile.
22
22
 
23
23
  This skill owns the **shell**: commands, IPC, the security ACL, the bundler, the updater.
24
24
  It does **not** own the Rust language itself (that is the `rust` skill), the web UI inside
25
- the window (the `react`/`nextjs` skills), or a Chromium+Node shell (`../electron/SKILL.md`).
25
+ the window (the `react`/`nextjs` skills), a Chromium+Node shell (`../electron/SKILL.md`), or
26
+ app-code hardening beyond the IPC boundary (`../secure-coding/SKILL.md`).
26
27
 
27
28
  ## Pick your starting shape
28
29
 
@@ -213,12 +214,6 @@ across three OSes is the `github-actions` skill's job; this skill defines what t
213
214
  | Copying a v1 `tauri.conf.json > allowlist` | That key does not exist in v2 | Use `capabilities/*.json` (ACL) |
214
215
  | Assuming bundled Chromium | It's the **OS** WebView (WebKit/WebView2) | Test rendering on each OS's engine; avoid Chromium-only CSS/JS |
215
216
 
216
- ## Pointers
217
-
218
- - `references/security.md` — capabilities/permissions/scope JSON, CSP recipes, isolation setup.
219
- - `references/bundling-distribution.md` — per-OS signing, updater keypair, sidecar, CI matrix.
220
- - Siblings: `../electron/SKILL.md` (the Chromium+Node alternative when you need a Node main
221
- process), `../secure-coding/SKILL.md` (app-code hardening). The `rust` skill owns the
222
- language; `react`/`nextjs` own the frontend UI; `github-actions` owns the release CI matrix.
223
- - `scripts/verify.sh` — advisory static lint over `src-tauri/` (capabilities present, registered
224
- commands exist, no v1 `allowlist`, fallible-looking commands return `Result`).
217
+ `scripts/verify.sh` is an advisory static lint over an `src-tauri/` tree that catches several of
218
+ these: capabilities present, registered commands exist, no v1 `allowlist`, fallible-looking
219
+ commands return `Result`.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: webhooks
3
- description: "Use when building the inbound side of a webhook — the HTTP endpoint that receives events a system pushes you, proves they are authentic, refuses to process the same one twice, and acks fast. Covers the mechanics every source shares: raw-body HMAC verification, ~5-min timestamp/replay window, idempotency on a stable event id, fast-ack-then-queue, retry/poison handling. Triggers: 'receive webhooks and process them safely', 'verify an incoming webhook signature', 'my signature verification fails even though the secret is correct', 'provider keeps retrying and we process the same event twice', 'handler times out under load, ack fast and queue', 'recibir webhooks entrantes', 'verificar la firma del webhook entrante', 'evitar procesar el mismo evento dos veces'. NOT the Stripe-Signature scheme (that is stripe), NOT email bounce/suppression hooks (that is email-connector), NOT outbound clients calling a third-party API (that is api-connector-builder), NOT what runs after the event lands (that is automation-flows)."
3
+ description: "Use when building the receiving end of a webhook — a provider-agnostic endpoint that proves pushed events are authentic and never processes one twice: raw-body HMAC, ~5-min replay window, idempotency on the event id, fast-ack-then-queue. NOT the Stripe-Signature scheme (that is stripe), NOT outbound clients you call (that is api-connector-builder)."
4
4
  tags: [webhooks, inbound-webhooks, hmac-verification, idempotency, signature-verification, queue, connectors]
5
5
  recommends: [stripe, email-connector, api-connector-builder, automation-flows, redis, secure-coding]
6
6
  profiles: []
@@ -13,14 +13,9 @@ You are building the side of a webhook that *receives*. Some external system
13
13
  pushes an HTTP POST at your endpoint; your job is to prove it is real, refuse to
14
14
  act on it twice, and answer fast. That is the whole mandate.
15
15
 
16
- This skill is provider-agnostic. It teaches the mechanics every webhook source
17
- shares, not any one vendor's event catalog. The deliverable is secret-safe
18
- server code plus minimal config: a handler that reads the **raw** request body
19
- for HMAC verification, compares signatures in **constant time**, rejects events
20
- outside a **timestamp tolerance**, **dedupes** on a stable event id, then
21
- **persists-or-enqueues before returning `2xx`**.
22
-
23
- It ends at "enqueued." What happens to the event afterward is a different job:
16
+ This skill is provider-agnostic — it teaches the mechanics every webhook source
17
+ shares, not any one vendor's event catalog — and it ends at "enqueued." What
18
+ happens to the event afterward is a different job:
24
19
 
25
20
  - The Stripe-specific scheme (`Stripe-Signature`, `t=,v1=`, `stripe listen`,
26
21
  the event model) → `../stripe/SKILL.md`.
@@ -29,8 +24,10 @@ It ends at "enqueued." What happens to the event afterward is a different job:
29
24
  - The *outbound* client that calls someone else's API → `api-connector-builder`.
30
25
  - Multi-step orchestration after the event lands → `automation-flows`.
31
26
  - Broker/queue tuning (BullMQ concurrency, DLQ ops) → `redis`.
27
+ - Constant-time compare, secret handling, supply-chain hygiene →
28
+ `../secure-coding/SKILL.md`.
32
29
 
33
- ## The pipeline — non-negotiable order
30
+ ## The pipeline
34
31
 
35
32
  These five stages run in exactly this order. Each one exists to protect the one
36
33
  after it; reorder them and you either trust forged data or waste work.
@@ -43,13 +40,9 @@ after it; reorder them and you either trust forged data or waste work.
43
40
  | 4 | **Dedupe** on the event id | At-least-once delivery means duplicates are normal. Mark it seen before doing work, not after. |
44
41
  | 5 | **Persist/enqueue → `2xx`** | Hand the event to durable storage, then ack. The ack means "I own this now." |
45
42
 
46
- Two facts make this order non-negotiable:
47
-
48
- - **Delivery is at-least-once, never exactly-once.** Every major provider
49
- retries on non-2xx or timeout, so duplicate deliveries are normal traffic.
50
- Idempotency is required, not a nice-to-have.
51
- - **The handler must be fast.** Heavy synchronous work inside it causes provider
52
- timeouts and a storm of retries. Verify, dedupe, enqueue, ack — then work.
43
+ **Delivery is at-least-once, never exactly-once.** Every major provider retries
44
+ on non-2xx or timeout, so duplicate deliveries are normal traffic and idempotency
45
+ is required, not a nice-to-have.
53
46
 
54
47
  ## Verify the signature
55
48
 
@@ -180,8 +173,10 @@ it?" check and both run. Let the UNIQUE constraint (or `NX`) be the lock.
180
173
 
181
174
  ## Fast-ack & queue
182
175
 
183
- Return `2xx` as soon as the event is durably stored or enqueued, then do the
184
- real work in a background worker. The status code is a contract with the sender:
176
+ Heavy synchronous work inside the handler causes provider timeouts and a storm
177
+ of retries. Return `2xx` as soon as the event is durably stored or enqueued,
178
+ then do the real work in a background worker. The status code is a contract with
179
+ the sender:
185
180
 
186
181
  | You return | Meaning to the provider | Use it when |
187
182
  |------------|-------------------------|-------------|
@@ -229,18 +224,6 @@ Capturing the raw body is framework-specific and is the usual culprit behind
229
224
 
230
225
  `scripts/verify.sh` is a read-only heuristic linter. Run it from the root of the
231
226
  project that contains your handler; it scans candidate files and prints
232
- PASS/WARN/FAIL for each invariant (raw-body verify, constant-time compare,
233
- timestamp check, secret-from-env, dedupe-on-event-id). It is advisory, not a
234
- compiler — a WARN means "I could not find evidence," which on a clean/empty tree
235
- is expected and exits `0`.
236
-
237
- ## Cross-references
238
-
239
- - Stripe's exact scheme and event model → `../stripe/SKILL.md`
240
- - Email bounce/complaint suppression webhooks → `../email-connector/SKILL.md`
241
- - The outbound API client (auth, pagination, retries you initiate) →
242
- `api-connector-builder`
243
- - Orchestrating what happens after the event lands → `automation-flows`
244
- - Queue/broker concurrency and DLQ operations → `redis`
245
- - Constant-time compare, secret handling, supply-chain hygiene →
246
- `../secure-coding/SKILL.md`
227
+ PASS/WARN/FAIL per invariant (raw-body verify, constant-time compare, timestamp
228
+ check, secret-from-env, dedupe-on-event-id). A WARN means "I could not find
229
+ evidence," which on a clean tree is expected and exits `0`.