[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79GKCKDWV5BY8XD94H3GAP9":3,"skill-same:01M79GKCKDWV5BY8XD94H3GAP9":48},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M79GKCKDWV5BY8XD94H3GAP9","saasaloy-kv",null,"Runbook for the kv capability — a provider-agnostic key-value store in packages\u002Fkv with per-provider modules (kv-cloudflare, kv-upstash, kv-memory). Use when caching a value from a route, building a namespaced key, choosing or switching KV_PROVIDER, hitting a TTL floor or a key-size error, registering a rate limit policy, or writing a custom kv provider.","mimukit\u002Fsaasaloy","mimukit","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F11677026?v=4","01M79GFSERAQQ77QPQMC1N0Y6M","Mukitul Islam Mukit","01M79GFSFA4WMGEEBHA68N59WV",4,"MIT","https:\u002F\u002Fgithub.com\u002Fmimukit\u002Fsaasaloy\u002Fblob\u002Fmain\u002Fmodules\u002Fkv\u002Fskills\u002Fsaasaloy-kv\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: saasaloy-kv\ndescription: Runbook for the kv capability — a provider-agnostic key-value store in packages\u002Fkv with per-provider modules (kv-cloudflare, kv-upstash, kv-memory). Use when caching a value from a route, building a namespaced key, choosing or switching KV_PROVIDER, hitting a TTL floor or a key-size error, registering a rate limit policy, or writing a custom kv provider.\n---\n\n# kv — provider-agnostic key-value storage from `packages\u002Fkv`\n\n`packages\u002Fkv` (`@repo\u002Fkv`) is the capability core: a provider registry, a rate limit policy table,\nnamespaced key building, JSON serialization, and one normalized error type. It has **zero runtime\ndependencies** and imports no vendor SDK and no Workers binding. Each provider ships as its own\nmodule — `kv-cloudflare` (Workers KV plus the Rate Limiting binding), `kv-upstash` (Upstash Redis over\nHTTPS, with a globally exact limiter) and `kv-memory` (an in-process map for dev and tests) — dropping one file into `src\u002Fproviders\u002F` and registering itself in the\n`providers` array in `src\u002Findex.ts`.\n\nCallers import `@repo\u002Fkv`, call `createKv(env)`, and never learn which provider is active.\n\n## Providers\n\n| Module | `KV_PROVIDER` | `minTtlSeconds` | `consume` | Needs |\n|---|---|---|---|---|\n| `kv-cloudflare` | `cloudflare` | 60 | yes, through the Rate Limiting binding | a KV namespace, plus the `kv_namespaces` and `ratelimits` entries its patches add to `apps\u002Fapi\u002Fwrangler.jsonc` |\n| `kv-upstash` | `upstash` | 1 | yes, one global fixed-window count with `remaining` and `resetAt` | an Upstash Redis database, `UPSTASH_REDIS_REST_URL`, `UPSTASH_REDIS_REST_TOKEN` and a non-empty `KV_KEY_PREFIX` |\n| `kv-memory` | `memory` | 0 | yes, a real fixed-window count | nothing — no account, no binding, no network |\n\n`kv-memory` is per-isolate. Two `wrangler dev` processes, or two isolates of one deployed Worker, hold two unrelated maps. Use it for development and tests, never for anything shared.\n\nThey differ in four ways a test can see, and each one is a way to pass locally and fail in production:\n\n- **Consistency.** `kv-memory` reads back a write on the next line, and so does `kv-upstash`. Workers KV takes up to 60 seconds to reach another location.\n- **The TTL floor.** `set(key, value, { ttlSeconds: 5 })` works on `kv-memory` and `kv-upstash`, and throws `invalid_ttl` on `kv-cloudflare`. Nothing rounds.\n- **How much `consume` reports.** `kv-memory` and `kv-upstash` fill in `remaining` and `resetAt`. Cloudflare's binding returns `{ success }` alone, so a test asserting on `remaining` is asserting about those two providers, not about the contract.\n- **What `list` pages over.** `kv-cloudflare` and `kv-memory` return a full page until the last one. `kv-upstash` passes Redis `SCAN` through, where `limit` is a hint and an empty page can carry a live cursor. Page until `complete` is true on every provider, never until a page comes back empty.\n\n## Read and write from a route\n\n```ts\n\u002F\u002F apps\u002Fapi\u002Fsrc\u002Froutes\u002Fwidgets.ts\nimport { Hono } from \"hono\";\nimport { createKv } from \"@repo\u002Fkv\";\n\nconst widgets = new Hono();\n\nwidgets.get(\"\u002F:id\", async (c) => {\n  const store = createKv(c.env);\n  const key = store.key({ namespace: \"widget\", parts: [c.req.param(\"id\")] });\n\n  const widget = await store.cached(key, 300, () => loadWidget(c.req.param(\"id\")));\n  return c.json(widget);\n});\n```\n\n`get` returns `null` for a key that is absent or expired. A miss is not an error, so there is\nnothing to catch on the happy path.\n\n## Build every key with `key()`\n\nNever hand-write a key string. `store.key({ namespace, parts })` produces\n`\u003CKV_KEY_PREFIX>\u003Cnamespace>:\u003Cpart>:\u003Cpart>`, so two modules that both cache \"user 7\" cannot collide.\n\n```ts\nstore.key({ namespace: \"session\", parts: [userId] }); \u002F\u002F \"session:u_42\"\nstore.key({ namespace: \"flags\", parts: [\"doc\", tenantId] }); \u002F\u002F \"flags:doc:t_9\"\n```\n\nRules the core enforces, all as `KvError` with code `invalid_key`:\n\n- A `:` inside a namespace or a part is refused, not escaped. Pass it as its own part.\n- An empty namespace or part is refused.\n- A built key over **512 bytes** is refused. The count is UTF-8 bytes, so an emoji costs four.\n  Hash the long piece and put the hash in the key.\n\n`KV_KEY_PREFIX` (empty by default) goes in front of everything, which lets a staging and a\nproduction Worker share one namespace. `kv-upstash` requires it: its preset in\n`packages\u002Fkv\u002Fsrc\u002Fenv-preset.ts` sits after the core's own keys in `kvPreset.extends`, and the\nlast declaration of a key wins, so a blank prefix fails `createEnv` once `kv-upstash` is in.\n\n## The TTL floor, and why nothing rounds\n\nEvery provider declares `minTtlSeconds` — **60 on `kv-cloudflare`**, 1 on `kv-upstash` (Redis `EX` takes whole seconds), 0 on `kv-memory`. A `set` with\na shorter TTL throws `KvError(\"invalid_ttl\")` naming the floor and the provider. It is never\nrounded up, because the same call would then expire at a different time on a different provider\nwith nothing in the logs to say so.\n\n```ts\nawait store.set(key, value, { ttlSeconds: 60 }); \u002F\u002F fine everywhere\nawait store.set(key, value, { ttlSeconds: 5 }); \u002F\u002F throws on kv-cloudflare, works on upstash and memory\n```\n\nOmit `ttlSeconds` for an entry that never expires.\n\n## Cache-aside, and what it does not do\n\n`store.cached(key, ttlSeconds, load)` reads, and on a miss runs `load`, writes and returns.\n\n- **No stampede protection.** Two concurrent misses both run `load` and both write. A lock needs\n  an atomic compare-and-set, which Workers KV does not have.\n- **No stale-while-revalidate.** An expired entry is a plain miss.\n- **A `null` from `load` is not written.** A cached `null` reads back the same as a miss, so the\n  write would only spend quota. Model \"known absent\" as a value, such as `{ found: false }`.\n\nOn `kv-cloudflare` the 60 second TTL floor plus the 60 second propagation window means a value can\nbe up to two minutes behind in another location. Cache slow-changing data only. Do not cache-aside\na session, a balance, or anything a user expects to see change straight after their own write.\n\n## Rate limit policies live here\n\nA policy is a **name**, not a counter. `consume` takes the name and the core resolves it against\nthe table registered in `src\u002Findex.ts`:\n\n```ts\nconst { success, remaining } = await store.consume({ policy: \"strict\", key: ip });\n```\n\n- An unregistered name throws `KvError(\"not_supported\")` naming the registered policies.\n- A provider with no `consume` throws `not_supported` naming the provider. Nothing is thrown at\n  construction — Workers has no `env` at module scope.\n- A refusal is `{ success: false }`, not a throw.\n- `remaining` and `resetAt` are **optional**. Cloudflare's Rate Limiting binding returns\n  `{ success }` and nothing else, so a caller must send `RateLimit-Remaining` only when the field\n  is present rather than invent a number. `kv-upstash` and `kv-memory` both report them.\n- **Only `kv-upstash` counts globally.** Cloudflare counts per colo, and `kv-memory` counts per\n  isolate. A budget that has to be exact across every request — an API key quota, a paid tier's\n  ceiling — needs `KV_PROVIDER=upstash`.\n\n`saasaloy add ratelimit` registers `strict`, `default` and `loose` and ships the Hono middleware.\n`kv-cloudflare` ships the matching `RL_STRICT`, `RL_DEFAULT` and `RL_LOOSE` bindings. Adding a fourth policy takes an edit in two places — see \"Setting up `kv-cloudflare`\" below.\n\n## Errors\n\nOne error type, `KvError`, with six codes:\n\n| Code | Raised when |\n|---|---|\n| `invalid_key` | Empty key, a `:` in a namespace or part, or over 512 bytes. |\n| `invalid_ttl` | TTL below the provider's floor, or not a positive whole number. |\n| `too_large` | The encoded value is over 25 MiB. Raised in the core, before any provider call. |\n| `rate_limited` | The provider refused for its own quota — not a `consume` refusal. |\n| `not_supported` | No `consume` on the provider, an unregistered policy, or an unstorable value. |\n| `provider_error` | Everything else, with the raw failure in `cause` and the vendor code in `providerCode`. |\n\nA missing key is **not** an error. The package never retries; `retryable` is the hook for a caller\nto decide.\n\n## Choosing the provider\n\n`KV_PROVIDER` is required even when exactly one provider is installed, and an unknown value throws\nat construction. There is no default in either direction: a fallback would let a production deploy\nquietly read an empty in-process map, or a test run quietly write to the real namespace.\n\n```sh\n# packages\u002Fenv\u002F.env.example — the project's one key list\nKV_PROVIDER=memory   # kv-memory, for local development and tests\n```\n\n`pnpm env:setup` writes it into `apps\u002Fapi\u002F.env`, which is what `wrangler dev` reads.\n\n`upstash` selects `kv-upstash`, which also needs its two secrets and a non-empty `KV_KEY_PREFIX`.\n\nSwapping providers is the env var plus `saasaloy add kv-\u003Cprovider>`. No call site changes.\n\n## Setting up `kv-cloudflare`\n\n`saasaloy add kv-cloudflare` writes four entries into `apps\u002Fapi\u002Fwrangler.jsonc` and registers the provider. One of them may need a human afterwards.\n\n**1. The namespace needs no id.** The patch writes the binding alone:\n\n```jsonc\n\u002F\u002F apps\u002Fapi\u002Fwrangler.jsonc\n\"kv_namespaces\": [{ \"binding\": \"KV\" }]\n```\n\nLocal dev keys the miniflare store by the binding, so it runs with no account. On the first `pnpm deploy:production`, wrangler creates a namespace titled `\u003Cworker name>-kv` (for example `api-kv`) and binds it. Every later deploy reuses the namespace the deployed Worker already holds. An interactive deploy offers to write the id back into `wrangler.jsonc`; keep it or discard it, both work. A namespace you created by hand works too: put its `id` on the binding.\n\nOne case creates a second namespace: deleting the Worker and deploying again. The new Worker holds no binding to inherit, so wrangler tries to create `api-kv` again and Cloudflare refuses the duplicate title. Put the old namespace's `id` (from `wrangler kv namespace list`) on the binding before you redeploy.\n\nA project made before this change carries `\"id\": \"\u003Creplace-me>\"`. Delete that field, or replace it with the real id; wrangler sends any id it finds.\n\nLeave `binding` as `KV` unless you pass a different name to `cloudflare({ binding })` in `packages\u002Fkv\u002Fsrc\u002Findex.ts`. The binding name is the credential; there is no API token and no secret for this provider.\n\n**2. Check the `namespace_id` values on a busy account.** The three limiter entries ship as `\"1001\"`, `\"1002\"` and `\"1003\"`:\n\n```jsonc\n\"ratelimits\": [\n  { \"name\": \"RL_STRICT\",  \"namespace_id\": \"1001\", \"simple\": { \"limit\": 10,   \"period\": 10 } },\n  { \"name\": \"RL_DEFAULT\", \"namespace_id\": \"1002\", \"simple\": { \"limit\": 100,  \"period\": 60 } },\n  { \"name\": \"RL_LOOSE\",   \"namespace_id\": \"1003\", \"simple\": { \"limit\": 1000, \"period\": 60 } }\n]\n```\n\nEach `namespace_id` must be a unique positive integer **per Cloudflare account**. Cloudflare does not document what a collision does. If the account already runs limiters, change these three to numbers it does not use.\n\n**3. Add a fourth policy in both places.** Write the `definePolicy` factory in `packages\u002Fkv\u002Fsrc\u002Fpolicies\u002Fratelimit.ts` and add the call to the `policies` array in `packages\u002Fkv\u002Fsrc\u002Findex.ts`; the binding is what enforces it. Add both, and keep the name in step: policy `burst` needs binding `RL_BURST`.\n\n```jsonc\n{ \"name\": \"RL_BURST\", \"namespace_id\": \"1004\", \"simple\": { \"limit\": 5, \"period\": 10 } }\n```\n\n`period` is **10 or 60, nothing else**. The provider throws `not_supported` on any other value rather than letting `wrangler deploy` fail later.\n\n**4. Know that the numbers can drift, and nothing checks them.** `wrangler.jsonc` holds the limits Cloudflare enforces. The `limit` and `periodSeconds` in `definePolicy` document the intent and drive the counting providers, and **editing them alone changes nothing on Cloudflare**. `saasaloy doctor` checks that every registered policy name has an `RL_\u003CNAME>` binding; it never compares the numbers, because that would mean reading literal values out of a project's TypeScript.\n\n**5. The limiter counts per location.** Cloudflare's Rate Limiting binding counts per colo, not globally, so a `limit` of 10 is 10 per colo and a distributed burst gets a multiple of it. Cloudflare calls the API \"permissive, eventually consistent, and intentionally designed to not be used as an accurate accounting system\". Use it to blunt abuse. Never meter subscription with it.\n\n## Setting up `kv-upstash`\n\n`saasaloy add kv-upstash` adds `@upstash\u002Fredis` to `packages\u002Fkv\u002Fpackage.json` and registers the provider. It writes nothing into `apps\u002Fapi\u002Fwrangler.jsonc`, because an HTTP provider has no binding. Three things need a human.\n\n**1. Create the database and copy its REST credentials.** Create a Redis database at \u003Chttps:\u002F\u002Fconsole.upstash.com>, open the REST API panel, and copy the URL and the **read-write** token. The read-only token cannot `SET`, `DEL`, or run the limiter's `EVAL`.\n\n```sh\n# packages\u002Fenv\u002F.env, then pnpm env:setup writes them into apps\u002Fapi\u002F.env\nUPSTASH_REDIS_REST_URL=https:\u002F\u002F\u003Cname>-\u003Cid>.upstash.io\nUPSTASH_REDIS_REST_TOKEN=\u003Ctoken>\n```\n\nPut the production values in `packages\u002Fenv\u002F.env.prod`, and `pnpm deploy:production` ships them as Worker secrets. The token is a secret. Never put it in `apps\u002Fapi\u002Fwrangler.jsonc`; that file is committed.\n\n**2. Set `KV_KEY_PREFIX`, which this provider requires.** One Redis database is one flat keyspace. Without a prefix, `list({})` scans every key in the database and hands back keys the project does not own, so the env gate refuses an empty or unset value: `pnpm env:setup` stops on it, and the api's `createEnv` throws `KV_KEY_PREFIX (kv-upstash): unset`. The provider also throws `provider_error` on a blank prefix, for a client built without the gate.\n\nA project that added `kv-upstash` before saasaloy 0.8.0 still has `# Blank on purpose: this key may stay empty.` above `KV_KEY_PREFIX` in `packages\u002Fenv\u002F.env.example`. Delete that line, so `pnpm env:setup` checks the key too.\n\n```sh\n# packages\u002Fenv\u002F.env (and packages\u002Fenv\u002F.env.prod for a deploy)\nKV_PROVIDER=upstash\nKV_KEY_PREFIX=app:\n```\n\nA `list` prefix is the one `client.key()` produced, so it already carries `KV_KEY_PREFIX`, the same as on the other providers. The provider keeps the `SCAN` glob inside `KV_KEY_PREFIX`: a shorter prefix, or none, scans the project's keys only, and a prefix outside it returns no keys without a request. It prepends `KV_KEY_PREFIX` to every limiter bucket, and escapes the glob characters, so a key holding a `*` or a `[` matches itself and nothing else.\n\n**3. Know the two size numbers disagree.** The core refuses a value over 25 MiB. Upstash caps one record at 1 MB on the free plan and 100 MB on paid, so a value can pass the core and still be refused. The provider maps that refusal to `too_large`, so a caller sees one code either way.\n\nThe limiter needs no setup. `consume` runs one Lua script holding `INCR`, `EXPIRE NX` and `PTTL`, atomically, against a bucket named `\u003CKV_KEY_PREFIX>rl:\u003Cpolicy>:\u003Ckey>`. It is a fixed window, the same shape `kv-memory` uses, and there is no 10-or-60 restriction on `periodSeconds` here — that rule is Cloudflare's binding alone.\n\n## Limits worth knowing before you design around KV\n\nWorkers KV is **eventually consistent**: a write is visible at once in its own location and takes\nup to 60 seconds elsewhere. One write per second to the same key, and concurrent writes to one key\noverwrite each other. A key caps at 512 bytes and a value at 25 MiB. The Free plan allows 1,000\nwrites a day to distinct keys.\n\nIt is a cache and a config store, not a database. Anything that needs to be read back immediately\nafter a write, or counted exactly, belongs in `database` instead.\n\n## Writing a provider\n\nFollow `.agents\u002Fskills\u002Fcreate-provider\u002F`. A provider is one file in `src\u002Fproviders\u002F` and one\n`plugin-array` patch. It implements `name`, `minTtlSeconds`, `get`, `set`, `delete` and `list`, and\noptionally `consume`. It stores strings only — the core does the JSON encoding, the size cap, the\nkey checks and the TTL floor, so none of that is re-implemented per vendor.\n\nMap every vendor failure onto a `KvError` code, keep the raw code in `providerCode`, and set\n`retryable` honestly. A caller's `catch` must only ever see one shape.\n\n## Removal\n\nRemove the dependents first. `kv-cloudflare`, `kv-memory` and `kv-upstash` depend on `kv`, and so do `ratelimit` and `feature-flags`. `remove kv` refuses while any of them is installed. `--force` overrides the refusal, and it leaves the dependents broken.\n\n`saasaloy remove kv-\u003Cprovider>` deletes the provider file and reverses its `plugin-array` registration in the core's `providers` array. A provider that needs a Workers binding also reverses its descriptor patches. `kv-upstash` deletes its `env.ts` too, and it does not delete the Upstash database or its keys. Delete the database in the Upstash console and revoke `UPSTASH_REDIS_REST_TOKEN`.\n\n`saasaloy remove kv` then deletes the `packages\u002Fkv` workspace (`index.ts`, `define.ts`, `provider.ts`, `keys.ts`, `cached.ts`, `env-preset.ts`) and reverses the `plugin-array` patch that adds the kv preset to `apps\u002Fapi\u002Fsrc\u002Fenv.ts`. The `@repo\u002Fkv` line in `apps\u002Fapi\u002Fpackage.json` survives, because a `package-json-dependency` patch has no removal inverse. Drop it by hand and run `pnpm install`. A file you edited by hand since `add` counts as drift, and `remove` asks before it deletes it. `remove` does not edit `packages\u002Fenv\u002F.env`, so delete the `KV_PROVIDER`, `KV_KEY_PREFIX` and any provider secret lines by hand.\n\nEvery route that imports `@repo\u002Fkv` stops compiling, and every rate limit policy goes with `define.ts`. The stored entries survive in the vendor namespace.\n\n## Failure modes\n\n- `KV_PROVIDER is not set.` thrown by `createKv(env)`. The key is required even with one provider installed. Set it in `packages\u002Fenv\u002F.env` and run `pnpm env:setup`.\n- `KV_PROVIDER is \"\u003Cx>\", which is not registered.` Fix the value or `saasaloy add kv-\u003Cx>`.\n- `KvError(\"invalid_ttl\")` with `ttlSeconds \u003Cn> is below the \"\u003Cprovider>\" provider's floor`. The core does not round up. Raise the TTL to the floor, or omit it.\n- `KvError(\"not_supported\")` with `Rate limit policy \"\u003Cname>\" is not registered.` Add the policy to the `policies` list in the kv `index.ts`.\n- `KvError(\"not_supported\")` with `The \"\u003Cprovider>\" provider cannot count, so it has no rate limiting.` Install a provider that implements `consume`, such as `kv-cloudflare` or `kv-memory`, and point `KV_PROVIDER` at it.\n- `KvError(\"provider_error\")` with ``No `\u003Cbinding>` KV binding on this Worker's env.`` from `kv-cloudflare`. Add the binding to `apps\u002Fapi\u002Fwrangler.jsonc`.\n- `KvError(\"provider_error\")` with `KV_KEY_PREFIX is empty or unset, and kv-upstash requires it.` Set a prefix per project.\n- `KvError(\"provider_error\")` with ``No `UPSTASH_REDIS_REST_URL` on this Worker's env`` or the token. Set both keys. A wrong token returns `providerCode` `401` and `retryable: false`.\n\n## Next\n\nRun `saasaloy-ratelimit` to put a rate limit policy on a route.\n","# kv — provider-agnostic key-value storage from `packages\u002Fkv`\n\n`packages\u002Fkv` (`@repo\u002Fkv`) is the capability core: a provider registry, a rate limit policy table,\nnamespaced key building, JSON serialization, and one normalized error type. It has **zero runtime\ndependencies** and imports no vendor SDK and no Workers binding. Each provider ships as its own\nmodule — `kv-cloudflare` (Workers KV plus the Rate Limiting binding), `kv-upstash` (Upstash Redis over\nHTTPS, with a globally exact limiter) and `kv-memory` (an in-process map for dev and tests) — dropping one file into `src\u002Fproviders\u002F` and registering itself in the\n`providers` array in `src\u002Findex.ts`.\n\nCallers import `@repo\u002Fkv`, call `createKv(env)`, and never learn which provider is active.\n\n## Providers\n\n| Module | `KV_PROVIDER` | `minTtlSeconds` | `consume` | Needs |\n|---|---|---|---|---|\n| `kv-cloudflare` | `cloudflare` | 60 | yes, through the Rate Limiting binding | a KV namespace, plus the `kv_namespaces` and `ratelimits` entries its patches add to `apps\u002Fapi\u002Fwrangler.jsonc` |\n| `kv-upstash` | `upstash` | 1 | yes, one global fixed-window count with `remaining` and `resetAt` | an Upstash Redis database, `UPSTASH_REDIS_REST_URL`, `UPSTASH_REDIS_REST_TOKEN` and a non-empty `KV_KEY_PREFIX` |\n| `kv-memory` | `memory` | 0 | yes, a real fixed-window count | nothing — no account, no binding, no network |\n\n`kv-memory` is per-isolate. Two `wrangler dev` processes, or two isolates of one deployed Worker, hold two unrelated maps. Use it for development and tests, never for anything shared.\n\nThey differ in four ways a test can see, and each one is a way to pass locally and fail in production:\n\n- **Consistency.** `kv-memory` reads back a write on the next line, and so does `kv-upstash`. Workers KV takes up to 60 seconds to reach another location.\n- **The TTL floor.** `set(key, value, { ttlSeconds: 5 })` works on `kv-memory` and `kv-upstash`, and throws `invalid_ttl` on `kv-cloudflare`. Nothing rounds.\n- **How much `consume` reports.** `kv-memory` and `kv-upstash` fill in `remaining` and `resetAt`. Cloudflare's binding returns `{ success }` alone, so a test asserting on `remaining` is asserting about those two providers, not about the contract.\n- **What `list` pages over.** `kv-cloudflare` and `kv-memory` return a full page until the last one. `kv-upstash` passes Redis `SCAN` through, where `limit` is a hint and an empty page can carry a live cursor. Page until `complete` is true on every provider, never until a page comes back empty.\n\n## Read and write from a route\n\n```ts\n\u002F\u002F apps\u002Fapi\u002Fsrc\u002Froutes\u002Fwidgets.ts\nimport { Hono } from \"hono\";\nimport { createKv } from \"@repo\u002Fkv\";\n\nconst widgets = new Hono();\n\nwidgets.get(\"\u002F:id\", async (c) => {\n  const store = createKv(c.env);\n  const key = store.key({ namespace: \"widget\", parts: [c.req.param(\"id\")] });\n\n  const widget = await store.cached(key, 300, () => loadWidget(c.req.param(\"id\")));\n  return c.json(widget);\n});\n```\n\n`get` returns `null` for a key that is absent or expired. A miss is not an error, so there is\nnothing to catch on the happy path.\n\n## Build every key with `key()`\n\nNever hand-write a key string. `store.key({ namespace, parts })` produces\n`\u003CKV_KEY_PREFIX>\u003Cnamespace>:\u003Cpart>:\u003Cpart>`, so two modules that both cache \"user 7\" cannot collide.\n\n```ts\nstore.key({ namespace: \"session\", parts: [userId] }); \u002F\u002F \"session:u_42\"\nstore.key({ namespace: \"flags\", parts: [\"doc\", tenantId] }); \u002F\u002F \"flags:doc:t_9\"\n```\n\nRules the core enforces, all as `KvError` with code `invalid_key`:\n\n- A `:` inside a namespace or a part is refused, not escaped. Pass it as its own part.\n- An empty namespace or part is refused.\n- A built key over **512 bytes** is refused. The count is UTF-8 bytes, so an emoji costs four.\n  Hash the long piece and put the hash in the key.\n\n`KV_KEY_PREFIX` (empty by default) goes in front of everything, which lets a staging and a\nproduction Worker share one namespace. `kv-upstash` requires it: its preset in\n`packages\u002Fkv\u002Fsrc\u002Fenv-preset.ts` sits after the core's own keys in `kvPreset.extends`, and the\nlast declaration of a key wins, so a blank prefix fails `createEnv` once `kv-upstash` is in.\n\n## The TTL floor, and why nothing rounds\n\nEvery provider declares `minTtlSeconds` — **60 on `kv-cloudflare`**, 1 on `kv-upstash` (Redis `EX` takes whole seconds), 0 on `kv-memory`. A `set` with\na shorter TTL throws `KvError(\"invalid_ttl\")` naming the floor and the provider. It is never\nrounded up, because the same call would then expire at a different time on a different provider\nwith nothing in the logs to say so.\n\n```ts\nawait store.set(key, value, { ttlSeconds: 60 }); \u002F\u002F fine everywhere\nawait store.set(key, value, { ttlSeconds: 5 }); \u002F\u002F throws on kv-cloudflare, works on upstash and memory\n```\n\nOmit `ttlSeconds` for an entry that never expires.\n\n## Cache-aside, and what it does not do\n\n`store.cached(key, ttlSeconds, load)` reads, and on a miss runs `load`, writes and returns.\n\n- **No stampede protection.** Two concurrent misses both run `load` and both write. A lock needs\n  an atomic compare-and-set, which Workers KV does not have.\n- **No stale-while-revalidate.** An expired entry is a plain miss.\n- **A `null` from `load` is not written.** A cached `null` reads back the same as a miss, so the\n  write would only spend quota. Model \"known absent\" as a value, such as `{ found: false }`.\n\nOn `kv-cloudflare` the 60 second TTL floor plus the 60 second propagation window means a value can\nbe up to two minutes behind in another location. Cache slow-changing data only. Do not cache-aside\na session, a balance, or anything a user expects to see change straight after their own write.\n\n## Rate limit policies live here\n\nA policy is a **name**, not a counter. `consume` takes the name and the core resolves it against\nthe table registered in `src\u002Findex.ts`:\n\n```ts\nconst { success, remaining } = await store.consume({ policy: \"strict\", key: ip });\n```\n\n- An unregistered name throws `KvError(\"not_supported\")` naming the registered policies.\n- A provider with no `consume` throws `not_supported` naming the provider. Nothing is thrown at\n  construction — Workers has no `env` at module scope.\n- A refusal is `{ success: false }`, not a throw.\n- `remaining` and `resetAt` are **optional**. Cloudflare's Rate Limiting binding returns\n  `{ success }` and nothing else, so a caller must send `RateLimit-Remaining` only when the field\n  is present rather than invent a number. `kv-upstash` and `kv-memory` both report them.\n- **Only `kv-upstash` counts globally.** Cloudflare counts per colo, and `kv-memory` counts per\n  isolate. A budget that has to be exact across every request — an API key quota, a paid tier's\n  ceiling — needs `KV_PROVIDER=upstash`.\n\n`saasaloy add ratelimit` registers `strict`, `default` and `loose` and ships the Hono middleware.\n`kv-cloudflare` ships the matching `RL_STRICT`, `RL_DEFAULT` and `RL_LOOSE` bindings. Adding a fourth policy takes an edit in two places — see \"Setting up `kv-cloudflare`\" below.\n\n## Errors\n\nOne error type, `KvError`, with six codes:\n\n| Code | Raised when |\n|---|---|\n| `invalid_key` | Empty key, a `:` in a namespace or part, or over 512 bytes. |\n| `invalid_ttl` | TTL below the provider's floor, or not a positive whole number. |\n| `too_large` | The encoded value is over 25 MiB. Raised in the core, before any provider call. |\n| `rate_limited` | The provider refused for its own quota — not a `consume` refusal. |\n| `not_supported` | No `consume` on the provider, an unregistered policy, or an unstorable value. |\n| `provider_error` | Everything else, with the raw failure in `cause` and the vendor code in `providerCode`. |\n\nA missing key is **not** an error. The package never retries; `retryable` is the hook for a caller\nto decide.\n\n## Choosing the provider\n\n`KV_PROVIDER` is required even when exactly one provider is installed, and an unknown value throws\nat construction. There is no default in either direction: a fallback would let a production deploy\nquietly read an empty in-process map, or a test run quietly write to the real namespace.\n\n```sh\n# packages\u002Fenv\u002F.env.example — the project's one key list\nKV_PROVIDER=memory   # kv-memory, for local development and tests\n```\n\n`pnpm env:setup` writes it into `apps\u002Fapi\u002F.env`, which is what `wrangler dev` reads.\n\n`upstash` selects `kv-upstash`, which also needs its two secrets and a non-empty `KV_KEY_PREFIX`.\n\nSwapping providers is the env var plus `saasaloy add kv-\u003Cprovider>`. No call site changes.\n\n## Setting up `kv-cloudflare`\n\n`saasaloy add kv-cloudflare` writes four entries into `apps\u002Fapi\u002Fwrangler.jsonc` and registers the provider. One of them may need a human afterwards.\n\n**1. The namespace needs no id.** The patch writes the binding alone:\n\n```jsonc\n\u002F\u002F apps\u002Fapi\u002Fwrangler.jsonc\n\"kv_namespaces\": [{ \"binding\": \"KV\" }]\n```\n\nLocal dev keys the miniflare store by the binding, so it runs with no account. On the first `pnpm deploy:production`, wrangler creates a namespace titled `\u003Cworker name>-kv` (for example `api-kv`) and binds it. Every later deploy reuses the namespace the deployed Worker already holds. An interactive deploy offers to write the id back into `wrangler.jsonc`; keep it or discard it, both work. A namespace you created by hand works too: put its `id` on the binding.\n\nOne case creates a second namespace: deleting the Worker and deploying again. The new Worker holds no binding to inherit, so wrangler tries to create `api-kv` again and Cloudflare refuses the duplicate title. Put the old namespace's `id` (from `wrangler kv namespace list`) on the binding before you redeploy.\n\nA project made before this change carries `\"id\": \"\u003Creplace-me>\"`. Delete that field, or replace it with the real id; wrangler sends any id it finds.\n\nLeave `binding` as `KV` unless you pass a different name to `cloudflare({ binding })` in `packages\u002Fkv\u002Fsrc\u002Findex.ts`. The binding name is the credential; there is no API token and no secret for this provider.\n\n**2. Check the `namespace_id` values on a busy account.** The three limiter entries ship as `\"1001\"`, `\"1002\"` and `\"1003\"`:\n\n```jsonc\n\"ratelimits\": [\n  { \"name\": \"RL_STRICT\",  \"namespace_id\": \"1001\", \"simple\": { \"limit\": 10,   \"period\": 10 } },\n  { \"name\": \"RL_DEFAULT\", \"namespace_id\": \"1002\", \"simple\": { \"limit\": 100,  \"period\": 60 } },\n  { \"name\": \"RL_LOOSE\",   \"namespace_id\": \"1003\", \"simple\": { \"limit\": 1000, \"period\": 60 } }\n]\n```\n\nEach `namespace_id` must be a unique positive integer **per Cloudflare account**. Cloudflare does not document what a collision does. If the account already runs limiters, change these three to numbers it does not use.\n\n**3. Add a fourth policy in both places.** Write the `definePolicy` factory in `packages\u002Fkv\u002Fsrc\u002Fpolicies\u002Fratelimit.ts` and add the call to the `policies` array in `packages\u002Fkv\u002Fsrc\u002Findex.ts`; the binding is what enforces it. Add both, and keep the name in step: policy `burst` needs binding `RL_BURST`.\n\n```jsonc\n{ \"name\": \"RL_BURST\", \"namespace_id\": \"1004\", \"simple\": { \"limit\": 5, \"period\": 10 } }\n```\n\n`period` is **10 or 60, nothing else**. The provider throws `not_supported` on any other value rather than letting `wrangler deploy` fail later.\n\n**4. Know that the numbers can drift, and nothing checks them.** `wrangler.jsonc` holds the limits Cloudflare enforces. The `limit` and `periodSeconds` in `definePolicy` document the intent and drive the counting providers, and **editing them alone changes nothing on Cloudflare**. `saasaloy doctor` checks that every registered policy name has an `RL_\u003CNAME>` binding; it never compares the numbers, because that would mean reading literal values out of a project's TypeScript.\n\n**5. The limiter counts per location.** Cloudflare's Rate Limiting binding counts per colo, not globally, so a `limit` of 10 is 10 per colo and a distributed burst gets a multiple of it. Cloudflare calls the API \"permissive, eventually consistent, and intentionally designed to not be used as an accurate accounting system\". Use it to blunt abuse. Never meter subscription with it.\n\n## Setting up `kv-upstash`\n\n`saasaloy add kv-upstash` adds `@upstash\u002Fredis` to `packages\u002Fkv\u002Fpackage.json` and registers the provider. It writes nothing into `apps\u002Fapi\u002Fwrangler.jsonc`, because an HTTP provider has no binding. Three things need a human.\n\n**1. Create the database and copy its REST credentials.** Create a Redis database at \u003Chttps:\u002F\u002Fconsole.upstash.com>, open the REST API panel, and copy the URL and the **read-write** token. The read-only token cannot `SET`, `DEL`, or run the limiter's `EVAL`.\n\n```sh\n# packages\u002Fenv\u002F.env, then pnpm env:setup writes them into apps\u002Fapi\u002F.env\nUPSTASH_REDIS_REST_URL=https:\u002F\u002F\u003Cname>-\u003Cid>.upstash.io\nUPSTASH_REDIS_REST_TOKEN=\u003Ctoken>\n```\n\nPut the production values in `packages\u002Fenv\u002F.env.prod`, and `pnpm deploy:production` ships them as Worker secrets. The token is a secret. Never put it in `apps\u002Fapi\u002Fwrangler.jsonc`; that file is committed.\n\n**2. Set `KV_KEY_PREFIX`, which this provider requires.** One Redis database is one flat keyspace. Without a prefix, `list({})` scans every key in the database and hands back keys the project does not own, so the env gate refuses an empty or unset value: `pnpm env:setup` stops on it, and the api's `createEnv` throws `KV_KEY_PREFIX (kv-upstash): unset`. The provider also throws `provider_error` on a blank prefix, for a client built without the gate.\n\nA project that added `kv-upstash` before saasaloy 0.8.0 still has `# Blank on purpose: this key may stay empty.` above `KV_KEY_PREFIX` in `packages\u002Fenv\u002F.env.example`. Delete that line, so `pnpm env:setup` checks the key too.\n\n```sh\n# packages\u002Fenv\u002F.env (and packages\u002Fenv\u002F.env.prod for a deploy)\nKV_PROVIDER=upstash\nKV_KEY_PREFIX=app:\n```\n\nA `list` prefix is the one `client.key()` produced, so it already carries `KV_KEY_PREFIX`, the same as on the other providers. The provider keeps the `SCAN` glob inside `KV_KEY_PREFIX`: a shorter prefix, or none, scans the project's keys only, and a prefix outside it returns no keys without a request. It prepends `KV_KEY_PREFIX` to every limiter bucket, and escapes the glob characters, so a key holding a `*` or a `[` matches itself and nothing else.\n\n**3. Know the two size numbers disagree.** The core refuses a value over 25 MiB. Upstash caps one record at 1 MB on the free plan and 100 MB on paid, so a value can pass the core and still be refused. The provider maps that refusal to `too_large`, so a caller sees one code either way.\n\nThe limiter needs no setup. `consume` runs one Lua script holding `INCR`, `EXPIRE NX` and `PTTL`, atomically, against a bucket named `\u003CKV_KEY_PREFIX>rl:\u003Cpolicy>:\u003Ckey>`. It is a fixed window, the same shape `kv-memory` uses, and there is no 10-or-60 restriction on `periodSeconds` here — that rule is Cloudflare's binding alone.\n\n## Limits worth knowing before you design around KV\n\nWorkers KV is **eventually consistent**: a write is visible at once in its own location and takes\nup to 60 seconds elsewhere. One write per second to the same key, and concurrent writes to one key\noverwrite each other. A key caps at 512 bytes and a value at 25 MiB. The Free plan allows 1,000\nwrites a day to distinct keys.\n\nIt is a cache and a config store, not a database. Anything that needs to be read back immediately\nafter a write, or counted exactly, belongs in `database` instead.\n\n## Writing a provider\n\nFollow `.agents\u002Fskills\u002Fcreate-provider\u002F`. A provider is one file in `src\u002Fproviders\u002F` and one\n`plugin-array` patch. It implements `name`, `minTtlSeconds`, `get`, `set`, `delete` and `list`, and\noptionally `consume`. It stores strings only — the core does the JSON encoding, the size cap, the\nkey checks and the TTL floor, so none of that is re-implemented per vendor.\n\nMap every vendor failure onto a `KvError` code, keep the raw code in `providerCode`, and set\n`retryable` honestly. A caller's `catch` must only ever see one shape.\n\n## Removal\n\nRemove the dependents first. `kv-cloudflare`, `kv-memory` and `kv-upstash` depend on `kv`, and so do `ratelimit` and `feature-flags`. `remove kv` refuses while any of them is installed. `--force` overrides the refusal, and it leaves the dependents broken.\n\n`saasaloy remove kv-\u003Cprovider>` deletes the provider file and reverses its `plugin-array` registration in the core's `providers` array. A provider that needs a Workers binding also reverses its descriptor patches. `kv-upstash` deletes its `env.ts` too, and it does not delete the Upstash database or its keys. Delete the database in the Upstash console and revoke `UPSTASH_REDIS_REST_TOKEN`.\n\n`saasaloy remove kv` then deletes the `packages\u002Fkv` workspace (`index.ts`, `define.ts`, `provider.ts`, `keys.ts`, `cached.ts`, `env-preset.ts`) and reverses the `plugin-array` patch that adds the kv preset to `apps\u002Fapi\u002Fsrc\u002Fenv.ts`. The `@repo\u002Fkv` line in `apps\u002Fapi\u002Fpackage.json` survives, because a `package-json-dependency` patch has no removal inverse. Drop it by hand and run `pnpm install`. A file you edited by hand since `add` counts as drift, and `remove` asks before it deletes it. `remove` does not edit `packages\u002Fenv\u002F.env`, so delete the `KV_PROVIDER`, `KV_KEY_PREFIX` and any provider secret lines by hand.\n\nEvery route that imports `@repo\u002Fkv` stops compiling, and every rate limit policy goes with `define.ts`. The stored entries survive in the vendor namespace.\n\n## Failure modes\n\n- `KV_PROVIDER is not set.` thrown by `createKv(env)`. The key is required even with one provider installed. Set it in `packages\u002Fenv\u002F.env` and run `pnpm env:setup`.\n- `KV_PROVIDER is \"\u003Cx>\", which is not registered.` Fix the value or `saasaloy add kv-\u003Cx>`.\n- `KvError(\"invalid_ttl\")` with `ttlSeconds \u003Cn> is below the \"\u003Cprovider>\" provider's floor`. The core does not round up. Raise the TTL to the floor, or omit it.\n- `KvError(\"not_supported\")` with `Rate limit policy \"\u003Cname>\" is not registered.` Add the policy to the `policies` list in the kv `index.ts`.\n- `KvError(\"not_supported\")` with `The \"\u003Cprovider>\" provider cannot count, so it has no rate limiting.` Install a provider that implements `consume`, such as `kv-cloudflare` or `kv-memory`, and point `KV_PROVIDER` at it.\n- `KvError(\"provider_error\")` with ``No `\u003Cbinding>` KV binding on this Worker's env.`` from `kv-cloudflare`. Add the binding to `apps\u002Fapi\u002Fwrangler.jsonc`.\n- `KvError(\"provider_error\")` with `KV_KEY_PREFIX is empty or unset, and kv-upstash requires it.` Set a prefix per project.\n- `KvError(\"provider_error\")` with ``No `UPSTASH_REDIS_REST_URL` on this Worker's env`` or the token. Set both keys. A wrong token returns `providerCode` `401` and `retryable: false`.\n\n## Next\n\nRun `saasaloy-ratelimit` to put a rate limit policy on a route.\n",{"name":5,"description":7},"main","5ecf3d110b216ef678e06a1630f6b63a8e730bb5","modules\u002Fkv\u002Fskills\u002Fsaasaloy-kv",0,"https:\u002F\u002Fgithub.com\u002Fmimukit\u002Fsaasaloy","https:\u002F\u002Fsaasaloy.com","https:\u002F\u002Fgithub.com\u002Fmimukit","https:\u002F\u002Fmimukit.com","Senior Software Engineer · 9+ yrs Fullstack (TS\u002FNode\u002FReact) · AI integrations, distributed systems · Building @saasaloy & @codealoy · Bangladesh 🇧🇩 \u002F Remote","2026-11-13 20:39:28",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add mimukit\u002Fsaasaloy --skill saasaloy-kv",{"tool":40,"command":41},"bunx","bunx skills add mimukit\u002Fsaasaloy --skill saasaloy-kv",{"tool":43,"command":44},"pnpm","pnpm dlx skills add mimukit\u002Fsaasaloy --skill saasaloy-kv","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmimukit\u002Fsaasaloy\u002Fblob\u002Fmain\u002Fmodules\u002Fkv\u002Fskills\u002Fsaasaloy-kv\u002FSKILL.md",true,[],[49,56,63,70,77,83],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M7BE75C34XHSPVJNQC8FY4Q0","saasaloy-subscription","Runbook for the subscription capability — provider-agnostic subscriptions in packages\u002Fsubscription, with a plan file, a projection table, a billable-subject file, plan entitlements and per-provider modules. Use when adding a plan, adding a plan feature or a numeric limit, gating an API route with requireFeature or requireWithinLimit, reading the 402 it returns, working out why a subject resolves to the free plan, wiring a checkout or portal route, reading a SubscriptionError, choosing or switching SUBSCRIPTION_PROVIDER, registering a webhook in the vendor's dashboard, writing a third subscription provider, or upgrading a project that still has `billing` installed.","https:\u002F\u002Fgithub.com\u002Fmimukit\u002Fsaasaloy\u002Fblob\u002Fmain\u002Fmodules\u002Fsubscription\u002Fskills\u002Fsaasaloy-subscription\u002FSKILL.md",[],[],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7BE68MJ8H47JZKTBDFYR6JD","saasaloy-notification","Runbook for the notification module, in-app notifications for apps\u002Fapp. It owns the notifications and notification_opt_outs tables, notify() in apps\u002Fapi\u002Fsrc\u002Flib\u002Fnotify.ts, the \u002Fnotifications api routes, the bell in the app header, the sidebar badge, the \u002Fnotifications page with Inbox and Preferences tabs, the notification config section, and the daily prune. Use when sending a notification from an api route, adding or changing a category, changing retention, debugging a badge or bell count that does not move, or removing the module.","https:\u002F\u002Fgithub.com\u002Fmimukit\u002Fsaasaloy\u002Fblob\u002Fmain\u002Fmodules\u002Fnotification\u002Fskills\u002Fsaasaloy-notification\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7BE53PDQV0YDPG8RNVGTPEQ","saasaloy-cms","Runbook for the cms module, the in-house CMS behind apps\u002Fadmin. Covers code-defined collections, the Tiptap editor, drafts, revisions and redirects, the publish-time renderer, the public blog on apps\u002Fweb and its 60-second cache. Use when adding a collection or a field, rendering a stored body, reusing the editor, renderer or media field from another module, moving the blog to another path, re-rendering live posts after a renderer upgrade or a STORAGE_PUBLIC_URL change, or working out why a published post is not live yet.","https:\u002F\u002Fgithub.com\u002Fmimukit\u002Fsaasaloy\u002Fblob\u002Fmain\u002Fmodules\u002Fcms\u002Fskills\u002Fsaasaloy-cms\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M79GQ03M63V5EKSST92B3S5X","saasaloy-beta","The beta module's own procedure.","https:\u002F\u002Fgithub.com\u002Fmimukit\u002Fsaasaloy\u002Fblob\u002Fmain\u002Fpackages\u002Fcli\u002Ftest\u002Ffixtures\u002Fregistry-clean\u002Fbeta\u002Fsaasaloy-beta\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M79GPXV3K8YF3M4VA0KGVE0B","helper","https:\u002F\u002Fgithub.com\u002Fmimukit\u002Fsaasaloy\u002Fblob\u002Fmain\u002Fpackages\u002Fcli\u002Ftest\u002Ffixtures\u002Fregistry-broken\u002Fbad-skill\u002Fhelper\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M79GPR8EVS1YX0W8X33Q9YD8","saasaloy-update","Runbook for an AI agent that updates this project to a newer Saasaloy CLI and newer module versions with saasaloy update. Use when the owner says \"update saasaloy\", \"upgrade the CLI\", \"pull the latest modules\", \"update the base template\", \"work the merge plan\", \"clear the update notes\", when saasaloy update or saasaloy outdated --check exits 3 or 2, when a merge plan or .saasaloy\u002Fmerge-plan.md is handed to you, or when an adopted project takes its first update. Covers the CLI upgrade, the preview, --out, the file merges, the update notes and \"Notes that may apply\", --resolved and --done, a file deleted locally and --restore, a three-way or two-way base, an update that skips releases, --from, the verify commands, and the exit codes.","https:\u002F\u002Fgithub.com\u002Fmimukit\u002Fsaasaloy\u002Fblob\u002Fmain\u002Fpackages\u002Fcli\u002Ftemplates\u002Fbase\u002F_agents\u002Fskills\u002Fsaasaloy-update\u002FSKILL.md",[],[]]