[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7BE53PDQV0YDPG8RNVGTPEQ":3,"skill-same:01M7BE53PDQV0YDPG8RNVGTPEQ":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},"01M7BE53PDQV0YDPG8RNVGTPEQ","saasaloy-cms",null,"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.","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\u002Fcms\u002Fskills\u002Fsaasaloy-cms\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: saasaloy-cms\ndescription: 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.\n---\n\n# cms: collections, drafts, revisions and the public blog\n\nStaff write and publish content in `apps\u002Fadmin`, and `apps\u002Fweb` serves it with no deploy. A developer declares each content type in code as a **collection**. Admins fill entries in, and they cannot create types. The module ships one collection, `blog`.\n\n| File | What it holds |\n|---|---|\n| `packages\u002Fcms\u002F` (`@repo\u002Fcms`) | the registry, the field builders, the form rules, the renderer, the editor (`@repo\u002Fcms\u002Feditor`) and the web client (`@repo\u002Fcms\u002Fclient`) |\n| `packages\u002Fcms\u002Fsrc\u002Fcollections\u002Fblog.ts` | the `blog` collection |\n| `packages\u002Fcms\u002Fscripts\u002Frerender.ts` | `pnpm cms:rerender`, the local re-render |\n| `packages\u002Fdb\u002Fsrc\u002Fschema\u002Fcms.ts` | `cms_entries`, `cms_revisions` and `cms_redirects`, in your driver's dialect |\n| `packages\u002Fdb\u002Fsrc\u002Frepositories\u002Fcms.ts` | publish, restore, pruning, redirects and every other query |\n| `packages\u002Fvalidators\u002Fsrc\u002Fcms.ts` | the request bodies and queries |\n| `packages\u002Fconfig\u002Fsrc\u002Fsections\u002Fcms.ts` | the `cms` config section |\n| `apps\u002Fapi\u002Fsrc\u002Froutes\u002Fcms.ts` | the admin and public routes at `\u002Fcms` |\n| `apps\u002Fadmin\u002Fsrc\u002Froutes\u002Fcms\u002F$collection\u002F` | the list, new-entry and editor screens |\n| `apps\u002Fweb\u002Fsrc\u002Fpages\u002Fblog\u002F` | the index, the post page, `rss.xml` and `sitemap.xml`, all on demand |\n| `apps\u002Fweb\u002Fsrc\u002Flib\u002Fcms.ts` | `cmsClient()`, the blog copy and the prose styles |\n\n## How a post moves\n\n`cms_entries` holds the **working draft**. Typed columns carry `collection`, `slug`, `status`, `title`, `published_at`, `author_id`, `updated_by`, `version` and `published_revision_id`. Every other field lives in the JSON `data` column, and the collection's Zod schema checks it on every write.\n\n- **Save draft** writes the working row only. The live post does not change.\n- **Publish** copies the working row into a new `cms_revisions` row, renders its HTML once, stores it as `html`, and points `published_revision_id` at it. The public site serves that revision.\n- **Unpublish** sets `published_revision_id` to null and the status to `draft`. **Archive** also takes the entry offline and hides it from the default admin list. Publishing an archived entry puts it live again.\n- **Restore** copies a revision into the working draft. The live post changes on the next publish only.\n- **Delete** works on `draft` and `archived` entries only, and it cascades to their revisions and redirects. A published entry answers `409 invalid_state`.\n\nEach entry keeps its newest 50 revisions. A publish prunes older ones and never prunes the live one. `published_at` is set on the first publish only. The post page shows \"Updated\" when the live revision's date falls on a later UTC day.\n\nWhen a publish changes the live slug, the repository writes a `cms_redirects` row. A public read of the old slug answers 301 to the current one. A redirect points at the entry, so a chain of renames ends at the current slug.\n\nEvery write sends the `version` it started from. A stale version answers `409 conflict`, and the body names the last editor and the time (`conflict.updatedByName`, `conflict.updatedAt`). The admin editor shows that in its conflict alert and offers Reload only. Nothing is merged.\n\n## Add a collection\n\nA new collection needs no migration, because every collection shares `cms_entries`. It needs one file, one array entry and one nav row.\n\n1. Write the collection in a file of your own, beside `blog.ts`:\n\n   ```ts\n   \u002F\u002F packages\u002Fcms\u002Fsrc\u002Fcollections\u002Fchangelog.ts\n   import { defineCollection } from \"..\u002Fdefine\";\n   import { richText, slug, text } from \"..\u002Ffields\";\n\n   export function changelogCollection() {\n     return defineCollection({\n       name: \"changelog\",\n       label: \"Changelog\",\n       singular: \"Release\",\n       fields: {\n         title: text({ label: \"Version\", maxLength: 80, required: true }),\n         slug: slug(),\n         body: richText({ label: \"Notes\", required: true }),\n         summary: text({ label: \"Summary\", multiline: true, placement: \"side\" }),\n       },\n     });\n   }\n   ```\n\n2. Register it in the collections array in `packages\u002Fcms\u002Fsrc\u002Findex.ts`:\n\n   ```ts\n   export const cms = defineCms({\n     collections: [blogCollection(), changelogCollection()],\n   });\n   ```\n\n   Keep that line in the shape `export const cms = defineCms({ collections: [...] })`. It is the `plugin-array` patch point. A module that ships a collection registers it the way this module registers `blog`: a `plugin-array` patch on `packages\u002Fcms\u002Fsrc\u002Findex.ts` with `exportName: \"cms\"`, `arrayProp: \"collections\"` and the factory as `call`.\n\n3. Add the nav row by hand in the \"Content\" group of `NAV_AREAS` in `apps\u002Fadmin\u002Fsrc\u002Fcomponents\u002Fnav.ts`: `{ to: \"\u002Fcms\u002Fchangelog\", label: \"Changelog\", icon: ScrollTextIcon }`. A module adds it with a `nav-entry` patch (`area: \"\u002F\"`, `group: \"Content\"`).\n\nThe list and editor screens at `\u002Fcms\u002Fchangelog` then work with no screen code, and the public routes answer at `\u002Fcms\u002Fchangelog\u002Fentries`. No `apps\u002Fweb` page reads the new collection until you write one (see \"Read content on the web\").\n\nThe rules `defineCollection` enforces, each with an error at startup:\n\n- `name` is lower-case kebab. It is stored in `cms_entries.collection` and appears in admin URLs. Avoid `admin`, which reads like the admin route prefix.\n- `title` is built with `text()` and `slug` with `slug()`. Both are typed columns, not keys in `data`.\n- A name registers once. A second registration throws.\n\nDo not edit `blog.ts` to change the blog's fields. The file is the module's, and `saasaloy update` may rewrite it. Copy it into your own file, register your factory, and take `blogCollection()` out of the array.\n\n### The field builders\n\n| Builder | Value in `data` | Default column |\n|---|---|---|\n| `text({ label, required?, maxLength? = 200, multiline?, help?, placement? })` | a string | main |\n| `slug({ label? = \"Slug\", from? = \"title\", help? })` | the `slug` column | main |\n| `richText({ label, required?, help?, placement? })` | a Tiptap JSON document | main |\n| `media({ label, required?, help?, placement? })` | `{ objectId, key, alt? }` or `null` | side |\n| `seo({ label?, help?, placement? })` | `{ metaTitle?, metaDescription?, ogImage? }` | side |\n\n`placement: \"main\" | \"side\"` moves a field to the other editor column. `slug` takes no `placement`.\n\n### How the form is built from the collection\n\nThe editor reads `collection.fields` in declaration order, and `formLayout(collection)` splits them into the main column and the 20rem side column. The side column always starts with the Publishing panel, and it moves below the body under `lg`.\n\n- The `title` field is a large input. While the entry was never published, it drives the slug through `nextSlug`.\n- `slug` shows the URL prefix from `slugPrefix(name, config.cms.basePath)`. The blog uses `basePath`, and any other collection uses `\u002F\u003Cname>\u002F`.\n- `richText` is `@repo\u002Fcms\u002Feditor` with the admin toolbar and image upload.\n- `media` is the media picker: `FileDrop` while empty, then the stored image with Replace and Remove.\n- `seo` is Meta title, Meta description and an Open Graph picker. Its placeholders come from `seoPlaceholders`.\n- `text` is an input, or a textarea when `multiline` is set.\n\nIn the side column each field is a panel, with `label` as its title and `help` under it. In the main column `help` is the line under the control. `emptyValues`, `valuesFromEntry`, `toPayload` and `isDirty` in `packages\u002Fcms\u002Fsrc\u002Fform.ts` build what a save sends. A new field kind needs a new control in `control()` in `apps\u002Fadmin\u002Fsrc\u002Fcomponents\u002Fcms\u002Fentry-editor.tsx`.\n\n### Which fields the public routes read\n\nThe public answer maps fields by kind, not by name:\n\n- the body is the first `richText` field, and it is the only one rendered into `html`,\n- the cover is the first `media` field,\n- the SEO block is the first `seo` field,\n- the excerpt is the field named `excerpt`. An empty one falls back to the first 160 characters of the body text.\n\nMeta title falls back to the title, meta description to the excerpt, and the Open Graph image to the cover. The api resolves every fallback, so the web pages get finished strings. A second `richText` field is stored and edited, but no public answer renders it.\n\n## Render a field\n\nThe api renders once, at publish, with `renderCollectionHtml(collection, data, { imageUrl })`, and stores the string in `cms_revisions.html`. `apps\u002Fweb` serves that string and carries no Tiptap. To render a body yourself, call the renderer on the server side:\n\n```ts\nimport { renderRichText } from \"@repo\u002Fcms\";\nimport { publicImageUrl } from \"..\u002Flib\u002Ffile-uploads\";\n\nconst html = renderRichText(doc, { imageUrl: (key) => publicImageUrl(c.env, key) });\n```\n\nTwo mappings replace Tiptap's own output:\n\n- **Links.** A link keeps only an href that `isSafeHref` accepts: `http`, `https`, `mailto`, `tel`, or a relative URL. A refused link renders its text with no `\u003Ca>`. Protocol-relative (`\u002F\u002Fhost`) and backslash URLs are refused. The editor's Link extension checks the same rule, and the renderer checks it again, so a crafted api write cannot put a `javascript:` URL on the site. An absolute web link gets `rel=\"noopener noreferrer\"`.\n- **Images.** A body image is an `image` node with `storageKey` and `objectId`. The renderer builds its `src` from `storageKey` through `imageUrl`, which the api backs with `publicImageUrl` from `file-uploads`. An image with no buildable URL renders nothing. Uploads are public (`visibility: \"public\"`), and a public image needs `STORAGE_PUBLIC_URL`.\n\n`renderRichText` throws on a node or mark that the extension list does not know. The api maps that throw to `400 invalid_input`, on save and on publish.\n\nThe image URL is baked into the stored HTML at publish. That is why a `STORAGE_PUBLIC_URL` change needs a re-render.\n\n## Re-render live posts\n\nRun a re-render after a Tiptap or renderer upgrade, after a change to `cmsExtensions()` or the renderer's mappings, and after `STORAGE_PUBLIC_URL` or `STORAGE_IMAGE_TRANSFORMS` changes. It rebuilds `html` for every live revision. Drafts and older revisions stay as they are.\n\n- **Local:** `pnpm cms:rerender` from the repo root. It writes to the local database that `vite dev` uses, and it reads `apps\u002Fapi\u002F.env`. Under `database-postgres` that file must carry `DATABASE_URL`. It refuses `NODE_ENV=production`.\n- **A deployed Worker:** `POST \u002Fcms\u002Fadmin\u002Frerender` with an admin session. It runs inside the Worker, with that environment's bindings and `STORAGE_PUBLIC_URL`, and answers `{ rerendered, skipped }`. From the admin app, call it through the typed client, or from the browser console on the admin origin:\n\n  ```ts\n  await fetch(`${API_URL}\u002Fcms\u002Fadmin\u002Frerender`, {\n    method: \"POST\",\n    credentials: \"include\",\n    headers: { \"x-auth-audience\": \"admin\" },\n  }).then((r) => r.json());\n  ```\n\nA revision whose collection is no longer registered, or whose body throws in the renderer, keeps its old `html` and counts in `skipped`. A non-zero `skipped` after an upgrade means a stored node the new renderer does not know.\n\n## Reuse the editor, renderer and media field from another module\n\nA later module, such as `ecommerce` for product descriptions, reuses the CMS building blocks and never imports Tiptap. `packages\u002Fcms` owns every Tiptap dependency (ADR 0020), so add `@repo\u002Fcms: workspace:*` with a `package-json-dependency` patch and import these:\n\n| Need | Import |\n|---|---|\n| a rich-text column and its Zod check | `richText`, `richTextDocument`, `RichTextDocument` from `@repo\u002Fcms` |\n| an image column | `media`, `mediaValue`, `MediaValue` from `@repo\u002Fcms` |\n| HTML from a stored body | `renderRichText` from `@repo\u002Fcms`, on the server |\n| plain text and an excerpt | `plainText`, `excerptOf` from `@repo\u002Fcms` |\n| the link rule | `isSafeHref` from `@repo\u002Fcms` |\n| the editor | `RichTextEditor`, `PickedImage` from `@repo\u002Fcms\u002Feditor` |\n\n`RichTextEditor` takes `value` and `onChange` (Tiptap JSON both ways), and these optional props:\n\n- `onRequestImage` resolves a `PickedImage` (`{ objectId, key, alt?, url? }`) or `null`. Leave it out to hide the image tool.\n- `onRequestLink` asks for a link URL. It defaults to `window.prompt`.\n- `onLinkRefused` receives a URL the link rule refused, so the host can say why.\n- `toolbar` is a render prop that receives the tools as data. `apps\u002Fadmin` draws them with the shell primitives in `apps\u002Fadmin\u002Fsrc\u002Fcomponents\u002Fcms\u002Feditor-toolbar.tsx`. Without it, a plain toolbar of text buttons renders.\n\nReact is a peer dependency, so the host app's React runs. Store the document as JSON in your own table, never as HTML. Render it once when it goes live, and store the HTML beside it, the same way the CMS does.\n\nFor an image field in an admin screen, copy `apps\u002Fadmin\u002Fsrc\u002Fcomponents\u002Fcms\u002Fmedia-picker.tsx` and its upload helper in `apps\u002Fadmin\u002Fsrc\u002Flib\u002Fcms-api.ts`. They use the `file-uploads` three-step upload and add no storage code.\n\n## Read content on the web\n\n`apps\u002Fweb` reads the public routes over `PUBLIC_API_URL` with `@repo\u002Fcms\u002Fclient`, which reaches neither Tiptap nor Zod. There is no service binding.\n\n```ts\nimport { cmsClient } from \"@web\u002Flib\u002Fcms\";\n\nconst result = await cmsClient().entry(\"changelog\", Astro.params.slug ?? \"\");\nif (result.kind === \"missing\") return new Response(null, { status: 404 });\nif (result.kind === \"redirect\") return Astro.redirect(`\u002Fchangelog\u002F${result.slug}`, 301);\nconst { entry } = result; \u002F\u002F title, html, excerpt, cover, seo, authorName, publishedAt, updatedAt\n```\n\n`list(collection, page)` answers one page, newest `publishedAt` first, with `config.cms.pageSize` entries. A page that reads the client must set `export const prerender = false`.\n\n**The cache.** The client keeps an isolate-local `Map` with a 60-second TTL, shared by every client in the isolate and keyed by URL. It caches entries, pages, 404s and redirects. It never caches an error. A publish takes up to 60 seconds to show, and nothing purges the cache on publish. Pass `ttlSeconds: 0` to `createCmsClient` to turn it off. If traffic outgrows one cache per isolate, move it to the `kv` capability.\n\n## Move the blog to another path\n\n`config.cms.basePath` (default `\u002Fblog`) builds every **link** the blog writes: post links, the pager, the RSS and sitemap URLs, and the admin slug prefix. It does not move a route. Astro routes by folder, so the pages answer at `\u002Fblog` whatever the config says. To move the blog to `\u002Fnotes`, change all of these in one edit:\n\n1. Set `cms: { basePath: \"\u002Fnotes\" }` in `packages\u002Fconfig\u002Fsrc\u002Fproject.ts`.\n2. Rename `apps\u002Fweb\u002Fsrc\u002Fpages\u002Fblog\u002F` to `apps\u002Fweb\u002Fsrc\u002Fpages\u002Fnotes\u002F`.\n3. Change the two `assets.run_worker_first` entries in `apps\u002Fweb\u002Fwrangler.jsonc` to `\"\u002Fnotes\"` and `\"\u002Fnotes\u002F*\"`.\n4. Change the Blog row in `pageLinks` in `packages\u002Fui\u002Fsrc\u002Fblocks\u002Fnavbar.tsx` to `href: \"\u002Fnotes\"`.\n\nOld `\u002Fblog` links then answer the site's 404. Add a redirect yourself if they are already shared.\n\n## `run_worker_first`\n\n`apps\u002Fweb\u002Fwrangler.jsonc` carries `assets.run_worker_first: [\"\u002Fblog\", \"\u002Fblog\u002F*\"]`. With `not_found_handling: \"404-page\"`, the assets layer answers a browser navigation that matches no file with the 404 page, and the Worker never runs. `curl` gets 200 and a browser gets 404. The two entries send blog paths to the Worker first. A new on-demand page for another collection needs its own pair.\n\nThe Astro Cloudflare adapter sets the Worker `main` itself once one page is on demand, so `wrangler.jsonc` needs no `main`.\n\n## Deleting a media file breaks live posts\n\n**The CMS does not track which entries use a file.** A cover, an Open Graph image and every body image point at a `storage_objects` row by key. Delete that file from the Files screen, or through `DELETE \u002Ffiles\u002F:id`, and every live post that uses it shows a broken image. Nothing warns first, and a re-render does not fix it. Check the posts before you delete an image, and replace the image in each entry, then publish again.\n\n## Settings\n\n| Key | Default | What it does |\n|---|---|---|\n| `cms.basePath` | `\u002Fblog` | The prefix of every blog link. See \"Move the blog to another path\". |\n| `cms.pageSize` | `10` | Entries per page on the blog index, in the public list route, in the RSS feed and in the admin list. |\n| `cms.rssTitle` | `Blog` | The RSS channel title. |\n| `cms.rssDescription` | `The latest posts.` | The RSS channel description. |\n\nOverride a key in `packages\u002Fconfig\u002Fsrc\u002Fproject.ts`. The module declares no env var. It uses `PUBLIC_API_URL` on `apps\u002Fweb` and the `file-uploads` storage keys on `apps\u002Fapi`.\n\n## Removal\n\n`saasaloy remove cms` deletes the files it wrote and reverses its patches: the collection registration, the config section, the `\u002Fcms` route, the `@repo\u002Fcms` dependencies, the nav rows, the navbar Blog link, the `run_worker_first` entries and the `cms:rerender` script. It leaves these:\n\n- The `cms_entries`, `cms_revisions` and `cms_redirects` tables, and every post in them. Run `pnpm --filter @repo\u002Fdb db:generate`, read the drop migration, then apply it with your driver's command.\n- The uploaded images. They are `file-uploads` rows in `storage_objects` with objects in the bucket, and they stay while `file-uploads` is installed. Delete them from the Files screen if nothing else uses them.\n- A collection file you wrote and its line in the collections array, a nav row you added by hand, and any page you wrote for another collection. Take them out by hand.\n- A renamed blog folder or a changed `basePath` override in `project.ts`.\n\n## Failure modes\n\n| Symptom | Cause |\n|---|---|\n| A published post 404s for up to a minute | The web cache holds the earlier 404. Wait 60 seconds. |\n| An edit is live in the admin but not on the site | The edit is a draft. Publish it. \"Unpublished edits\" in the list marks it. |\n| `\u002Fblog` works in `curl` and 404s in a browser | The `run_worker_first` entries are missing from `apps\u002Fweb\u002Fwrangler.jsonc`. |\n| Blog links point at `\u002Fnotes` and the pages 404 | `basePath` changed and the folder did not. Rename `apps\u002Fweb\u002Fsrc\u002Fpages\u002Fblog\u002F`. |\n| Images on live posts are broken | The file was deleted, or `STORAGE_PUBLIC_URL` changed. Re-upload and publish again, or run a re-render. |\n| The cover picker says the upload is refused | `STORAGE_PUBLIC_URL` is unset on the api, so no public upload can be made. |\n| `409 conflict` on save or publish | Someone saved after you opened the entry. Reload, then apply your change again. |\n| `409 slug_taken` | Another entry uses that slug as its draft or live slug. |\n| `400 invalid_input` with a `data.` message | `data` fails the collection's schema. A message about a node or mark means the renderer does not know a type in the body. |\n| `Collection \"x\" is not registered` | The factory is not in the collections array in `packages\u002Fcms\u002Fsrc\u002Findex.ts`. |\n| `cms:rerender` refuses to run | `NODE_ENV=production` is set. In production, call `POST \u002Fcms\u002Fadmin\u002Frerender`. |\n| `rerender` answers a non-zero `skipped` | A live revision's collection is not registered, or its body holds a node the renderer does not know. |\n| The web client throws about `PUBLIC_API_URL` | `apps\u002Fweb\u002F.env` has no `PUBLIC_API_URL`. Run `pnpm env:setup`. |\n\n## Not in this module\n\nDraft preview links, scheduled publishing, media reference tracking, a cache purge on publish, admin-defined types, author and editor roles, taxonomies, comments, search and i18n. Products belong to a future `ecommerce` module, which reuses the parts in \"Reuse the editor, renderer and media field from another module\".\n\n## Next\n\nRun `saasaloy-admin` to add a staff screen beside the CMS screens, `saasaloy-file-uploads` for the image path and `STORAGE_PUBLIC_URL`, and `saasaloy-database` for the migration that `add` and `remove` leave for you.\n","# cms: collections, drafts, revisions and the public blog\n\nStaff write and publish content in `apps\u002Fadmin`, and `apps\u002Fweb` serves it with no deploy. A developer declares each content type in code as a **collection**. Admins fill entries in, and they cannot create types. The module ships one collection, `blog`.\n\n| File | What it holds |\n|---|---|\n| `packages\u002Fcms\u002F` (`@repo\u002Fcms`) | the registry, the field builders, the form rules, the renderer, the editor (`@repo\u002Fcms\u002Feditor`) and the web client (`@repo\u002Fcms\u002Fclient`) |\n| `packages\u002Fcms\u002Fsrc\u002Fcollections\u002Fblog.ts` | the `blog` collection |\n| `packages\u002Fcms\u002Fscripts\u002Frerender.ts` | `pnpm cms:rerender`, the local re-render |\n| `packages\u002Fdb\u002Fsrc\u002Fschema\u002Fcms.ts` | `cms_entries`, `cms_revisions` and `cms_redirects`, in your driver's dialect |\n| `packages\u002Fdb\u002Fsrc\u002Frepositories\u002Fcms.ts` | publish, restore, pruning, redirects and every other query |\n| `packages\u002Fvalidators\u002Fsrc\u002Fcms.ts` | the request bodies and queries |\n| `packages\u002Fconfig\u002Fsrc\u002Fsections\u002Fcms.ts` | the `cms` config section |\n| `apps\u002Fapi\u002Fsrc\u002Froutes\u002Fcms.ts` | the admin and public routes at `\u002Fcms` |\n| `apps\u002Fadmin\u002Fsrc\u002Froutes\u002Fcms\u002F$collection\u002F` | the list, new-entry and editor screens |\n| `apps\u002Fweb\u002Fsrc\u002Fpages\u002Fblog\u002F` | the index, the post page, `rss.xml` and `sitemap.xml`, all on demand |\n| `apps\u002Fweb\u002Fsrc\u002Flib\u002Fcms.ts` | `cmsClient()`, the blog copy and the prose styles |\n\n## How a post moves\n\n`cms_entries` holds the **working draft**. Typed columns carry `collection`, `slug`, `status`, `title`, `published_at`, `author_id`, `updated_by`, `version` and `published_revision_id`. Every other field lives in the JSON `data` column, and the collection's Zod schema checks it on every write.\n\n- **Save draft** writes the working row only. The live post does not change.\n- **Publish** copies the working row into a new `cms_revisions` row, renders its HTML once, stores it as `html`, and points `published_revision_id` at it. The public site serves that revision.\n- **Unpublish** sets `published_revision_id` to null and the status to `draft`. **Archive** also takes the entry offline and hides it from the default admin list. Publishing an archived entry puts it live again.\n- **Restore** copies a revision into the working draft. The live post changes on the next publish only.\n- **Delete** works on `draft` and `archived` entries only, and it cascades to their revisions and redirects. A published entry answers `409 invalid_state`.\n\nEach entry keeps its newest 50 revisions. A publish prunes older ones and never prunes the live one. `published_at` is set on the first publish only. The post page shows \"Updated\" when the live revision's date falls on a later UTC day.\n\nWhen a publish changes the live slug, the repository writes a `cms_redirects` row. A public read of the old slug answers 301 to the current one. A redirect points at the entry, so a chain of renames ends at the current slug.\n\nEvery write sends the `version` it started from. A stale version answers `409 conflict`, and the body names the last editor and the time (`conflict.updatedByName`, `conflict.updatedAt`). The admin editor shows that in its conflict alert and offers Reload only. Nothing is merged.\n\n## Add a collection\n\nA new collection needs no migration, because every collection shares `cms_entries`. It needs one file, one array entry and one nav row.\n\n1. Write the collection in a file of your own, beside `blog.ts`:\n\n   ```ts\n   \u002F\u002F packages\u002Fcms\u002Fsrc\u002Fcollections\u002Fchangelog.ts\n   import { defineCollection } from \"..\u002Fdefine\";\n   import { richText, slug, text } from \"..\u002Ffields\";\n\n   export function changelogCollection() {\n     return defineCollection({\n       name: \"changelog\",\n       label: \"Changelog\",\n       singular: \"Release\",\n       fields: {\n         title: text({ label: \"Version\", maxLength: 80, required: true }),\n         slug: slug(),\n         body: richText({ label: \"Notes\", required: true }),\n         summary: text({ label: \"Summary\", multiline: true, placement: \"side\" }),\n       },\n     });\n   }\n   ```\n\n2. Register it in the collections array in `packages\u002Fcms\u002Fsrc\u002Findex.ts`:\n\n   ```ts\n   export const cms = defineCms({\n     collections: [blogCollection(), changelogCollection()],\n   });\n   ```\n\n   Keep that line in the shape `export const cms = defineCms({ collections: [...] })`. It is the `plugin-array` patch point. A module that ships a collection registers it the way this module registers `blog`: a `plugin-array` patch on `packages\u002Fcms\u002Fsrc\u002Findex.ts` with `exportName: \"cms\"`, `arrayProp: \"collections\"` and the factory as `call`.\n\n3. Add the nav row by hand in the \"Content\" group of `NAV_AREAS` in `apps\u002Fadmin\u002Fsrc\u002Fcomponents\u002Fnav.ts`: `{ to: \"\u002Fcms\u002Fchangelog\", label: \"Changelog\", icon: ScrollTextIcon }`. A module adds it with a `nav-entry` patch (`area: \"\u002F\"`, `group: \"Content\"`).\n\nThe list and editor screens at `\u002Fcms\u002Fchangelog` then work with no screen code, and the public routes answer at `\u002Fcms\u002Fchangelog\u002Fentries`. No `apps\u002Fweb` page reads the new collection until you write one (see \"Read content on the web\").\n\nThe rules `defineCollection` enforces, each with an error at startup:\n\n- `name` is lower-case kebab. It is stored in `cms_entries.collection` and appears in admin URLs. Avoid `admin`, which reads like the admin route prefix.\n- `title` is built with `text()` and `slug` with `slug()`. Both are typed columns, not keys in `data`.\n- A name registers once. A second registration throws.\n\nDo not edit `blog.ts` to change the blog's fields. The file is the module's, and `saasaloy update` may rewrite it. Copy it into your own file, register your factory, and take `blogCollection()` out of the array.\n\n### The field builders\n\n| Builder | Value in `data` | Default column |\n|---|---|---|\n| `text({ label, required?, maxLength? = 200, multiline?, help?, placement? })` | a string | main |\n| `slug({ label? = \"Slug\", from? = \"title\", help? })` | the `slug` column | main |\n| `richText({ label, required?, help?, placement? })` | a Tiptap JSON document | main |\n| `media({ label, required?, help?, placement? })` | `{ objectId, key, alt? }` or `null` | side |\n| `seo({ label?, help?, placement? })` | `{ metaTitle?, metaDescription?, ogImage? }` | side |\n\n`placement: \"main\" | \"side\"` moves a field to the other editor column. `slug` takes no `placement`.\n\n### How the form is built from the collection\n\nThe editor reads `collection.fields` in declaration order, and `formLayout(collection)` splits them into the main column and the 20rem side column. The side column always starts with the Publishing panel, and it moves below the body under `lg`.\n\n- The `title` field is a large input. While the entry was never published, it drives the slug through `nextSlug`.\n- `slug` shows the URL prefix from `slugPrefix(name, config.cms.basePath)`. The blog uses `basePath`, and any other collection uses `\u002F\u003Cname>\u002F`.\n- `richText` is `@repo\u002Fcms\u002Feditor` with the admin toolbar and image upload.\n- `media` is the media picker: `FileDrop` while empty, then the stored image with Replace and Remove.\n- `seo` is Meta title, Meta description and an Open Graph picker. Its placeholders come from `seoPlaceholders`.\n- `text` is an input, or a textarea when `multiline` is set.\n\nIn the side column each field is a panel, with `label` as its title and `help` under it. In the main column `help` is the line under the control. `emptyValues`, `valuesFromEntry`, `toPayload` and `isDirty` in `packages\u002Fcms\u002Fsrc\u002Fform.ts` build what a save sends. A new field kind needs a new control in `control()` in `apps\u002Fadmin\u002Fsrc\u002Fcomponents\u002Fcms\u002Fentry-editor.tsx`.\n\n### Which fields the public routes read\n\nThe public answer maps fields by kind, not by name:\n\n- the body is the first `richText` field, and it is the only one rendered into `html`,\n- the cover is the first `media` field,\n- the SEO block is the first `seo` field,\n- the excerpt is the field named `excerpt`. An empty one falls back to the first 160 characters of the body text.\n\nMeta title falls back to the title, meta description to the excerpt, and the Open Graph image to the cover. The api resolves every fallback, so the web pages get finished strings. A second `richText` field is stored and edited, but no public answer renders it.\n\n## Render a field\n\nThe api renders once, at publish, with `renderCollectionHtml(collection, data, { imageUrl })`, and stores the string in `cms_revisions.html`. `apps\u002Fweb` serves that string and carries no Tiptap. To render a body yourself, call the renderer on the server side:\n\n```ts\nimport { renderRichText } from \"@repo\u002Fcms\";\nimport { publicImageUrl } from \"..\u002Flib\u002Ffile-uploads\";\n\nconst html = renderRichText(doc, { imageUrl: (key) => publicImageUrl(c.env, key) });\n```\n\nTwo mappings replace Tiptap's own output:\n\n- **Links.** A link keeps only an href that `isSafeHref` accepts: `http`, `https`, `mailto`, `tel`, or a relative URL. A refused link renders its text with no `\u003Ca>`. Protocol-relative (`\u002F\u002Fhost`) and backslash URLs are refused. The editor's Link extension checks the same rule, and the renderer checks it again, so a crafted api write cannot put a `javascript:` URL on the site. An absolute web link gets `rel=\"noopener noreferrer\"`.\n- **Images.** A body image is an `image` node with `storageKey` and `objectId`. The renderer builds its `src` from `storageKey` through `imageUrl`, which the api backs with `publicImageUrl` from `file-uploads`. An image with no buildable URL renders nothing. Uploads are public (`visibility: \"public\"`), and a public image needs `STORAGE_PUBLIC_URL`.\n\n`renderRichText` throws on a node or mark that the extension list does not know. The api maps that throw to `400 invalid_input`, on save and on publish.\n\nThe image URL is baked into the stored HTML at publish. That is why a `STORAGE_PUBLIC_URL` change needs a re-render.\n\n## Re-render live posts\n\nRun a re-render after a Tiptap or renderer upgrade, after a change to `cmsExtensions()` or the renderer's mappings, and after `STORAGE_PUBLIC_URL` or `STORAGE_IMAGE_TRANSFORMS` changes. It rebuilds `html` for every live revision. Drafts and older revisions stay as they are.\n\n- **Local:** `pnpm cms:rerender` from the repo root. It writes to the local database that `vite dev` uses, and it reads `apps\u002Fapi\u002F.env`. Under `database-postgres` that file must carry `DATABASE_URL`. It refuses `NODE_ENV=production`.\n- **A deployed Worker:** `POST \u002Fcms\u002Fadmin\u002Frerender` with an admin session. It runs inside the Worker, with that environment's bindings and `STORAGE_PUBLIC_URL`, and answers `{ rerendered, skipped }`. From the admin app, call it through the typed client, or from the browser console on the admin origin:\n\n  ```ts\n  await fetch(`${API_URL}\u002Fcms\u002Fadmin\u002Frerender`, {\n    method: \"POST\",\n    credentials: \"include\",\n    headers: { \"x-auth-audience\": \"admin\" },\n  }).then((r) => r.json());\n  ```\n\nA revision whose collection is no longer registered, or whose body throws in the renderer, keeps its old `html` and counts in `skipped`. A non-zero `skipped` after an upgrade means a stored node the new renderer does not know.\n\n## Reuse the editor, renderer and media field from another module\n\nA later module, such as `ecommerce` for product descriptions, reuses the CMS building blocks and never imports Tiptap. `packages\u002Fcms` owns every Tiptap dependency (ADR 0020), so add `@repo\u002Fcms: workspace:*` with a `package-json-dependency` patch and import these:\n\n| Need | Import |\n|---|---|\n| a rich-text column and its Zod check | `richText`, `richTextDocument`, `RichTextDocument` from `@repo\u002Fcms` |\n| an image column | `media`, `mediaValue`, `MediaValue` from `@repo\u002Fcms` |\n| HTML from a stored body | `renderRichText` from `@repo\u002Fcms`, on the server |\n| plain text and an excerpt | `plainText`, `excerptOf` from `@repo\u002Fcms` |\n| the link rule | `isSafeHref` from `@repo\u002Fcms` |\n| the editor | `RichTextEditor`, `PickedImage` from `@repo\u002Fcms\u002Feditor` |\n\n`RichTextEditor` takes `value` and `onChange` (Tiptap JSON both ways), and these optional props:\n\n- `onRequestImage` resolves a `PickedImage` (`{ objectId, key, alt?, url? }`) or `null`. Leave it out to hide the image tool.\n- `onRequestLink` asks for a link URL. It defaults to `window.prompt`.\n- `onLinkRefused` receives a URL the link rule refused, so the host can say why.\n- `toolbar` is a render prop that receives the tools as data. `apps\u002Fadmin` draws them with the shell primitives in `apps\u002Fadmin\u002Fsrc\u002Fcomponents\u002Fcms\u002Feditor-toolbar.tsx`. Without it, a plain toolbar of text buttons renders.\n\nReact is a peer dependency, so the host app's React runs. Store the document as JSON in your own table, never as HTML. Render it once when it goes live, and store the HTML beside it, the same way the CMS does.\n\nFor an image field in an admin screen, copy `apps\u002Fadmin\u002Fsrc\u002Fcomponents\u002Fcms\u002Fmedia-picker.tsx` and its upload helper in `apps\u002Fadmin\u002Fsrc\u002Flib\u002Fcms-api.ts`. They use the `file-uploads` three-step upload and add no storage code.\n\n## Read content on the web\n\n`apps\u002Fweb` reads the public routes over `PUBLIC_API_URL` with `@repo\u002Fcms\u002Fclient`, which reaches neither Tiptap nor Zod. There is no service binding.\n\n```ts\nimport { cmsClient } from \"@web\u002Flib\u002Fcms\";\n\nconst result = await cmsClient().entry(\"changelog\", Astro.params.slug ?? \"\");\nif (result.kind === \"missing\") return new Response(null, { status: 404 });\nif (result.kind === \"redirect\") return Astro.redirect(`\u002Fchangelog\u002F${result.slug}`, 301);\nconst { entry } = result; \u002F\u002F title, html, excerpt, cover, seo, authorName, publishedAt, updatedAt\n```\n\n`list(collection, page)` answers one page, newest `publishedAt` first, with `config.cms.pageSize` entries. A page that reads the client must set `export const prerender = false`.\n\n**The cache.** The client keeps an isolate-local `Map` with a 60-second TTL, shared by every client in the isolate and keyed by URL. It caches entries, pages, 404s and redirects. It never caches an error. A publish takes up to 60 seconds to show, and nothing purges the cache on publish. Pass `ttlSeconds: 0` to `createCmsClient` to turn it off. If traffic outgrows one cache per isolate, move it to the `kv` capability.\n\n## Move the blog to another path\n\n`config.cms.basePath` (default `\u002Fblog`) builds every **link** the blog writes: post links, the pager, the RSS and sitemap URLs, and the admin slug prefix. It does not move a route. Astro routes by folder, so the pages answer at `\u002Fblog` whatever the config says. To move the blog to `\u002Fnotes`, change all of these in one edit:\n\n1. Set `cms: { basePath: \"\u002Fnotes\" }` in `packages\u002Fconfig\u002Fsrc\u002Fproject.ts`.\n2. Rename `apps\u002Fweb\u002Fsrc\u002Fpages\u002Fblog\u002F` to `apps\u002Fweb\u002Fsrc\u002Fpages\u002Fnotes\u002F`.\n3. Change the two `assets.run_worker_first` entries in `apps\u002Fweb\u002Fwrangler.jsonc` to `\"\u002Fnotes\"` and `\"\u002Fnotes\u002F*\"`.\n4. Change the Blog row in `pageLinks` in `packages\u002Fui\u002Fsrc\u002Fblocks\u002Fnavbar.tsx` to `href: \"\u002Fnotes\"`.\n\nOld `\u002Fblog` links then answer the site's 404. Add a redirect yourself if they are already shared.\n\n## `run_worker_first`\n\n`apps\u002Fweb\u002Fwrangler.jsonc` carries `assets.run_worker_first: [\"\u002Fblog\", \"\u002Fblog\u002F*\"]`. With `not_found_handling: \"404-page\"`, the assets layer answers a browser navigation that matches no file with the 404 page, and the Worker never runs. `curl` gets 200 and a browser gets 404. The two entries send blog paths to the Worker first. A new on-demand page for another collection needs its own pair.\n\nThe Astro Cloudflare adapter sets the Worker `main` itself once one page is on demand, so `wrangler.jsonc` needs no `main`.\n\n## Deleting a media file breaks live posts\n\n**The CMS does not track which entries use a file.** A cover, an Open Graph image and every body image point at a `storage_objects` row by key. Delete that file from the Files screen, or through `DELETE \u002Ffiles\u002F:id`, and every live post that uses it shows a broken image. Nothing warns first, and a re-render does not fix it. Check the posts before you delete an image, and replace the image in each entry, then publish again.\n\n## Settings\n\n| Key | Default | What it does |\n|---|---|---|\n| `cms.basePath` | `\u002Fblog` | The prefix of every blog link. See \"Move the blog to another path\". |\n| `cms.pageSize` | `10` | Entries per page on the blog index, in the public list route, in the RSS feed and in the admin list. |\n| `cms.rssTitle` | `Blog` | The RSS channel title. |\n| `cms.rssDescription` | `The latest posts.` | The RSS channel description. |\n\nOverride a key in `packages\u002Fconfig\u002Fsrc\u002Fproject.ts`. The module declares no env var. It uses `PUBLIC_API_URL` on `apps\u002Fweb` and the `file-uploads` storage keys on `apps\u002Fapi`.\n\n## Removal\n\n`saasaloy remove cms` deletes the files it wrote and reverses its patches: the collection registration, the config section, the `\u002Fcms` route, the `@repo\u002Fcms` dependencies, the nav rows, the navbar Blog link, the `run_worker_first` entries and the `cms:rerender` script. It leaves these:\n\n- The `cms_entries`, `cms_revisions` and `cms_redirects` tables, and every post in them. Run `pnpm --filter @repo\u002Fdb db:generate`, read the drop migration, then apply it with your driver's command.\n- The uploaded images. They are `file-uploads` rows in `storage_objects` with objects in the bucket, and they stay while `file-uploads` is installed. Delete them from the Files screen if nothing else uses them.\n- A collection file you wrote and its line in the collections array, a nav row you added by hand, and any page you wrote for another collection. Take them out by hand.\n- A renamed blog folder or a changed `basePath` override in `project.ts`.\n\n## Failure modes\n\n| Symptom | Cause |\n|---|---|\n| A published post 404s for up to a minute | The web cache holds the earlier 404. Wait 60 seconds. |\n| An edit is live in the admin but not on the site | The edit is a draft. Publish it. \"Unpublished edits\" in the list marks it. |\n| `\u002Fblog` works in `curl` and 404s in a browser | The `run_worker_first` entries are missing from `apps\u002Fweb\u002Fwrangler.jsonc`. |\n| Blog links point at `\u002Fnotes` and the pages 404 | `basePath` changed and the folder did not. Rename `apps\u002Fweb\u002Fsrc\u002Fpages\u002Fblog\u002F`. |\n| Images on live posts are broken | The file was deleted, or `STORAGE_PUBLIC_URL` changed. Re-upload and publish again, or run a re-render. |\n| The cover picker says the upload is refused | `STORAGE_PUBLIC_URL` is unset on the api, so no public upload can be made. |\n| `409 conflict` on save or publish | Someone saved after you opened the entry. Reload, then apply your change again. |\n| `409 slug_taken` | Another entry uses that slug as its draft or live slug. |\n| `400 invalid_input` with a `data.` message | `data` fails the collection's schema. A message about a node or mark means the renderer does not know a type in the body. |\n| `Collection \"x\" is not registered` | The factory is not in the collections array in `packages\u002Fcms\u002Fsrc\u002Findex.ts`. |\n| `cms:rerender` refuses to run | `NODE_ENV=production` is set. In production, call `POST \u002Fcms\u002Fadmin\u002Frerender`. |\n| `rerender` answers a non-zero `skipped` | A live revision's collection is not registered, or its body holds a node the renderer does not know. |\n| The web client throws about `PUBLIC_API_URL` | `apps\u002Fweb\u002F.env` has no `PUBLIC_API_URL`. Run `pnpm env:setup`. |\n\n## Not in this module\n\nDraft preview links, scheduled publishing, media reference tracking, a cache purge on publish, admin-defined types, author and editor roles, taxonomies, comments, search and i18n. Products belong to a future `ecommerce` module, which reuses the parts in \"Reuse the editor, renderer and media field from another module\".\n\n## Next\n\nRun `saasaloy-admin` to add a staff screen beside the CMS screens, `saasaloy-file-uploads` for the image path and `STORAGE_PUBLIC_URL`, and `saasaloy-database` for the migration that `add` and `remove` leave for you.\n",{"name":5,"description":7},"main","5ecf3d110b216ef678e06a1630f6b63a8e730bb5","modules\u002Fcms\u002Fskills\u002Fsaasaloy-cms",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-cms",{"tool":40,"command":41},"bunx","bunx skills add mimukit\u002Fsaasaloy --skill saasaloy-cms",{"tool":43,"command":44},"pnpm","pnpm dlx skills add mimukit\u002Fsaasaloy --skill saasaloy-cms","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmimukit\u002Fsaasaloy\u002Fblob\u002Fmain\u002Fmodules\u002Fcms\u002Fskills\u002Fsaasaloy-cms\u002FSKILL.md",true,[],[49,56,63,70,76,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},"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":71,"name":72,"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":73,"categories":74,"keywords":75,"publishedAt":19},"01M79GPXV3K8YF3M4VA0KGVE0B","helper","https:\u002F\u002Fgithub.com\u002Fmimukit\u002Fsaasaloy\u002Fblob\u002Fmain\u002Fpackages\u002Fcli\u002Ftest\u002Ffixtures\u002Fregistry-broken\u002Fbad-skill\u002Fhelper\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"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},"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",[],[],{"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},"01M79GPM41WE99AQH1N5NWXPNT","saasaloy-testing","Pick the test a change needs and write it the way this project's testing mode asks. Use when the AGENTS.md testing block says tests-after or tdd, when adding or changing a route, a pure function, a provider, a table or a user-visible flow, when the owner asks \"which test do I write\", \"how do I test this route\", \"turn TDD on\", or when deciding whether a change needs a test at all.","https:\u002F\u002Fgithub.com\u002Fmimukit\u002Fsaasaloy\u002Fblob\u002Fmain\u002Fpackages\u002Fcli\u002Ftemplates\u002Fbase\u002F_agents\u002Fskills\u002Fsaasaloy-testing\u002FSKILL.md",[],[]]