[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AWR9CESS9DJ3E7284RWT2B":3,"skill-same:01M7AWR9CESS9DJ3E7284RWT2B":53},{"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":6,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M7AWR9CESS9DJ3E7284RWT2B","ask-sonner",null,"Guide to Sonner, the React toast library — install and wire up the Toaster, pick the right toast() call, promise and loading toasts, updating, dismissing and persisting toasts, styling, theming and icons, positioning and multiple toasters. Use when working with Sonner or troubleshooting it — toasts that don't appear, appear twice, lose their styles, ignore Tailwind classes, sit behind a modal, or don't follow dark mode.","wangmiaozero\u002Fpi-harness","wangmiaozero","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F45121589?v=4","01M7AWPWCP23VHFH4433FG7SV8","seedling","01M7AWPWDBEBWBMPCA6VSEFJBB",385,"AGPL-3.0","https:\u002F\u002Fgithub.com\u002Fwangmiaozero\u002Fpi-harness\u002Fblob\u002Fmain\u002Fresources\u002Fbuiltin-skills\u002Femilkowalski\u002Fskills\u002Fengineering\u002Fask-sonner\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: ask-sonner\ndescription: Guide to Sonner, the React toast library — install and wire up the Toaster, pick the right toast() call, promise and loading toasts, updating, dismissing and persisting toasts, styling, theming and icons, positioning and multiple toasters. Use when working with Sonner or troubleshooting it — toasts that don't appear, appear twice, lose their styles, ignore Tailwind classes, sit behind a modal, or don't follow dark mode.\n---\n\n# Working With Sonner\n\n## Initial Response\n\nWhen this skill is first invoked without a specific question, respond only with:\n\n> I'm ready to help you set up, style, and troubleshoot Sonner, my knowledge comes from its author, Emil Kowalski.\n\nDo not provide any other information until the user asks a question.\n\nA guide skill for [Sonner](https:\u002F\u002Fsonner.emilkowal.ski), the toast library. When a task involves Sonner — wiring it up, rendering toasts, styling them, or fixing them — answer from this file first. Full prop tables for `\u003CToaster \u002F>` and `toast()` live in [API.md](API.md); read it when you need an exact prop name, type, or default.\n\n## Setup\n\nTwo pieces, and only two:\n\n1. **One `\u003CToaster \u002F>`, mounted once**, as close to the root as possible (in Next.js: `layout.tsx` — it works inside server components). Never render it per-page or conditionally; a second mounted Toaster duplicates every toast.\n2. **`toast()` called from client code** — event handlers, effects, callbacks. It's a plain function, no hook or provider needed, but it does nothing on the server: in a server action, return the result and call `toast()` in the client code that receives it.\n\n```jsx\nimport { Toaster } from 'sonner'; \u002F\u002F once, in layout\nimport { toast } from 'sonner';   \u002F\u002F anywhere client-side\n```\n\n## Picking the right call\n\n| You want | Call |\n| --- | --- |\n| Plain message | `toast('Title')` — add `{ description }` for a second line |\n| Success \u002F error \u002F info \u002F warning icon | `toast.success('…')`, `toast.error('…')`, etc. |\n| Spinner while you manage state yourself | `toast.loading('…')`, then update it by id |\n| Loading → success\u002Ferror tied to a promise | `toast.promise(promise, { loading, success, error })` — success\u002Ferror accept functions receiving the resolved value\u002Ferror |\n| Button that does something | `{ action: { label, onClick } }` — closes the toast unless `onClick` calls `event.preventDefault()`; `cancel` is the secondary variant |\n| Custom JSX, default toast shell | `toast(\u003Cjsx \u002F>)` |\n| Custom JSX, no styles at all | `toast.custom((t) => \u003Cjsx \u002F>)` — headless, `t` gives you the id to dismiss |\n\n## Recipes\n\n**Update a toast** — call `toast()` again with the same `id`; only the props you pass change. Switching to `toast.success(…, { id })` changes the type. This is how loading → success flows work without `toast.promise`:\n\n```jsx\nconst id = toast.loading('Uploading…');\ntoast.success('Uploaded', { id });\n```\n\n**Persist** — `{ duration: Infinity }`. **Dismiss** — `toast.dismiss(id)`, or `toast.dismiss()` for all. **Read active toasts** — `useSonner()` in React, `toast.getActiveToasts()` outside it.\n\n**Links or components in the text** — pass a function for the title or description: `toast(() => \u003Ca href=\"…\">View\u003C\u002Fa>)`.\n\n**Multiple toasters** — give each an `id` and target with `toast('…', { toasterId: 'canvas' })`. Without `toasterId`, every toaster renders the toast.\n\n**Close callbacks** — `onDismiss` fires on close button or swipe; `onAutoClose` fires on timeout. They are separate; there is no single \"closed\" callback.\n\n## Styling — the escalation ladder\n\nClimb only as far as the change requires; jumping to the top rung too early is fine (it's the recommended end state), lingering in the middle is not.\n\n1. **Defaults** — plus `richColors` on the Toaster for colorful success\u002Ferror, `invert` to flip against the theme.\n2. **Inline tweaks** — `toastOptions={{ style: {…} }}` on the Toaster for all toasts, or `style` per `toast()` call.\n3. **Classes on parts** — `toastOptions={{ classNames: { toast, title, description, actionButton, cancelButton, closeButton } }}`. Sonner's injected styles win the cascade, so every class needs `!important` (Tailwind: `!text-red-900`). If you're marking more than a few things important, stop — go headless.\n4. **Headless** — `toast.custom()` with your own JSX, keeping Sonner's positioning, stacking, and swipe. The recommended approach for a design-system toast: wrap it in your own `toast()` abstraction. (`unstyled: true` exists as a halfway house, but headless gives more control for the same effort.)\n\n**Icons** — swap defaults per-type with the Toaster's `icons` prop, per-toast with `icon`, remove with `null`.\n\n**Theme** — `theme` defaults to `'light'` and does not track the OS. Pass `theme=\"system\"`, or wire your theme provider: `\u003CToaster theme={resolvedTheme} \u002F>` from `next-themes`.\n\n## Troubleshooting\n\n| Symptom | Cause → fix |\n| --- | --- |\n| Toast never appears | No `\u003CToaster \u002F>` mounted, or it unmounted (conditional render, per-page placement). Mount one at the root. If calling from a server action: `toast()` is client-only — call it with the action's result on the client. |\n| Same toast appears twice | Two Toasters mounted (layout **and** page) — keep one. Or `toast()` fired in an effect under React StrictMode's dev double-invoke — fire from the event handler instead, or pass a stable `id` so the second call updates rather than duplicates. |\n| Tailwind\u002FCSS classes have no effect | Default styles override them. Mark them `!important`, or use `unstyled` \u002F headless (see the ladder above). |\n| Toasts render completely unstyled (common in Astro, view transitions) | Sonner's injected stylesheet was lost — import it explicitly in a layout: `import 'sonner\u002Fdist\u002Fstyles.css'`. |\n| Unstyled inside Shadow DOM | Styles land in `document.head`, not the shadow root. Copy the style tag whose text includes `[data-sonner-toaster]` into the shadow root. |\n| Toast behind a modal\u002Foverlay, or clipped | An ancestor creates a stacking context (`transform`, `filter`, `overflow`) or the overlay out-z-indexes the toaster. Move `\u003CToaster \u002F>` to the document root, outside any dialog\u002Fportal container. |\n| Dark mode ignored | `theme` defaults to `'light'` — set `theme=\"system\"` or pass the resolved theme (see Theme above). |\n| Success\u002Ferror look gray, not green\u002Fred | That's the default. Add `richColors` to the Toaster. |\n| Toast never closes | `duration: Infinity`, `dismissible: false`, or a `toast.promise` whose promise never settles — the loading toast waits forever. |\n| `toast.promise` stuck on loading | It needs a promise (or a function returning one) as its first argument, and the promise must actually resolve\u002Freject. |\n| Swipe-to-dismiss goes the wrong way \u002F doesn't work | Directions derive from `position`. Override with `swipeDirections` on the Toaster. |\n| Toast shows up in every toaster | Multiple toasters need targeting: give each Toaster an `id` and pass `toasterId` in the `toast()` call. |\n| Toasts too close to the screen edge on mobile | `offset` (desktop, default 32px) and `mobileOffset` (\u003C600px, default 16px) — numbers, CSS strings, or per-side objects. |\n","# Working With Sonner\n\n## Initial Response\n\nWhen this skill is first invoked without a specific question, respond only with:\n\n> I'm ready to help you set up, style, and troubleshoot Sonner, my knowledge comes from its author, Emil Kowalski.\n\nDo not provide any other information until the user asks a question.\n\nA guide skill for [Sonner](https:\u002F\u002Fsonner.emilkowal.ski), the toast library. When a task involves Sonner — wiring it up, rendering toasts, styling them, or fixing them — answer from this file first. Full prop tables for `\u003CToaster \u002F>` and `toast()` live in [API.md](API.md); read it when you need an exact prop name, type, or default.\n\n## Setup\n\nTwo pieces, and only two:\n\n1. **One `\u003CToaster \u002F>`, mounted once**, as close to the root as possible (in Next.js: `layout.tsx` — it works inside server components). Never render it per-page or conditionally; a second mounted Toaster duplicates every toast.\n2. **`toast()` called from client code** — event handlers, effects, callbacks. It's a plain function, no hook or provider needed, but it does nothing on the server: in a server action, return the result and call `toast()` in the client code that receives it.\n\n```jsx\nimport { Toaster } from 'sonner'; \u002F\u002F once, in layout\nimport { toast } from 'sonner';   \u002F\u002F anywhere client-side\n```\n\n## Picking the right call\n\n| You want | Call |\n| --- | --- |\n| Plain message | `toast('Title')` — add `{ description }` for a second line |\n| Success \u002F error \u002F info \u002F warning icon | `toast.success('…')`, `toast.error('…')`, etc. |\n| Spinner while you manage state yourself | `toast.loading('…')`, then update it by id |\n| Loading → success\u002Ferror tied to a promise | `toast.promise(promise, { loading, success, error })` — success\u002Ferror accept functions receiving the resolved value\u002Ferror |\n| Button that does something | `{ action: { label, onClick } }` — closes the toast unless `onClick` calls `event.preventDefault()`; `cancel` is the secondary variant |\n| Custom JSX, default toast shell | `toast(\u003Cjsx \u002F>)` |\n| Custom JSX, no styles at all | `toast.custom((t) => \u003Cjsx \u002F>)` — headless, `t` gives you the id to dismiss |\n\n## Recipes\n\n**Update a toast** — call `toast()` again with the same `id`; only the props you pass change. Switching to `toast.success(…, { id })` changes the type. This is how loading → success flows work without `toast.promise`:\n\n```jsx\nconst id = toast.loading('Uploading…');\ntoast.success('Uploaded', { id });\n```\n\n**Persist** — `{ duration: Infinity }`. **Dismiss** — `toast.dismiss(id)`, or `toast.dismiss()` for all. **Read active toasts** — `useSonner()` in React, `toast.getActiveToasts()` outside it.\n\n**Links or components in the text** — pass a function for the title or description: `toast(() => \u003Ca href=\"…\">View\u003C\u002Fa>)`.\n\n**Multiple toasters** — give each an `id` and target with `toast('…', { toasterId: 'canvas' })`. Without `toasterId`, every toaster renders the toast.\n\n**Close callbacks** — `onDismiss` fires on close button or swipe; `onAutoClose` fires on timeout. They are separate; there is no single \"closed\" callback.\n\n## Styling — the escalation ladder\n\nClimb only as far as the change requires; jumping to the top rung too early is fine (it's the recommended end state), lingering in the middle is not.\n\n1. **Defaults** — plus `richColors` on the Toaster for colorful success\u002Ferror, `invert` to flip against the theme.\n2. **Inline tweaks** — `toastOptions={{ style: {…} }}` on the Toaster for all toasts, or `style` per `toast()` call.\n3. **Classes on parts** — `toastOptions={{ classNames: { toast, title, description, actionButton, cancelButton, closeButton } }}`. Sonner's injected styles win the cascade, so every class needs `!important` (Tailwind: `!text-red-900`). If you're marking more than a few things important, stop — go headless.\n4. **Headless** — `toast.custom()` with your own JSX, keeping Sonner's positioning, stacking, and swipe. The recommended approach for a design-system toast: wrap it in your own `toast()` abstraction. (`unstyled: true` exists as a halfway house, but headless gives more control for the same effort.)\n\n**Icons** — swap defaults per-type with the Toaster's `icons` prop, per-toast with `icon`, remove with `null`.\n\n**Theme** — `theme` defaults to `'light'` and does not track the OS. Pass `theme=\"system\"`, or wire your theme provider: `\u003CToaster theme={resolvedTheme} \u002F>` from `next-themes`.\n\n## Troubleshooting\n\n| Symptom | Cause → fix |\n| --- | --- |\n| Toast never appears | No `\u003CToaster \u002F>` mounted, or it unmounted (conditional render, per-page placement). Mount one at the root. If calling from a server action: `toast()` is client-only — call it with the action's result on the client. |\n| Same toast appears twice | Two Toasters mounted (layout **and** page) — keep one. Or `toast()` fired in an effect under React StrictMode's dev double-invoke — fire from the event handler instead, or pass a stable `id` so the second call updates rather than duplicates. |\n| Tailwind\u002FCSS classes have no effect | Default styles override them. Mark them `!important`, or use `unstyled` \u002F headless (see the ladder above). |\n| Toasts render completely unstyled (common in Astro, view transitions) | Sonner's injected stylesheet was lost — import it explicitly in a layout: `import 'sonner\u002Fdist\u002Fstyles.css'`. |\n| Unstyled inside Shadow DOM | Styles land in `document.head`, not the shadow root. Copy the style tag whose text includes `[data-sonner-toaster]` into the shadow root. |\n| Toast behind a modal\u002Foverlay, or clipped | An ancestor creates a stacking context (`transform`, `filter`, `overflow`) or the overlay out-z-indexes the toaster. Move `\u003CToaster \u002F>` to the document root, outside any dialog\u002Fportal container. |\n| Dark mode ignored | `theme` defaults to `'light'` — set `theme=\"system\"` or pass the resolved theme (see Theme above). |\n| Success\u002Ferror look gray, not green\u002Fred | That's the default. Add `richColors` to the Toaster. |\n| Toast never closes | `duration: Infinity`, `dismissible: false`, or a `toast.promise` whose promise never settles — the loading toast waits forever. |\n| `toast.promise` stuck on loading | It needs a promise (or a function returning one) as its first argument, and the promise must actually resolve\u002Freject. |\n| Swipe-to-dismiss goes the wrong way \u002F doesn't work | Directions derive from `position`. Override with `swipeDirections` on the Toaster. |\n| Toast shows up in every toaster | Multiple toasters need targeting: give each Toaster an `id` and pass `toasterId` in the `toast()` call. |\n| Toasts too close to the screen edge on mobile | `offset` (desktop, default 32px) and `mobileOffset` (\u003C600px, default 16px) — numbers, CSS strings, or per-side objects. |\n",{"name":5,"description":7},"main","ab32e788f56afdb9367c3a1a6b33a19e5d0058cd","resources\u002Fbuiltin-skills\u002Femilkowalski\u002Fskills\u002Fengineering\u002Fask-sonner",26,"https:\u002F\u002Fgithub.com\u002Fwangmiaozero\u002Fpi-harness","https:\u002F\u002Fwangmiaozero.github.io\u002Fpi-harness-website\u002F","https:\u002F\u002Fgithub.com\u002Fwangmiaozero","Sometimes you need to applaud yourself!\r\n有时候我们需要为自己鼓掌","2026-11-15 00:08:20",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add wangmiaozero\u002Fpi-harness --skill ask-sonner",{"tool":39,"command":40},"bunx","bunx skills add wangmiaozero\u002Fpi-harness --skill ask-sonner",{"tool":42,"command":43},"pnpm","pnpm dlx skills add wangmiaozero\u002Fpi-harness --skill ask-sonner","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fwangmiaozero\u002Fpi-harness\u002Fblob\u002Fmain\u002Fresources\u002Fbuiltin-skills\u002Femilkowalski\u002Fskills\u002Fengineering\u002Fask-sonner\u002FSKILL.md",true,[47],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"API.md","REFERENCE","参考文档",4545,"https:\u002F\u002Fgithub.com\u002Fwangmiaozero\u002Fpi-harness\u002Fblob\u002Fmain\u002Fresources\u002Fbuiltin-skills\u002Femilkowalski\u002Fskills\u002Fengineering\u002Fask-sonner\u002FAPI.md",[54,61,68,75,82,89],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M7AWWZY5GKH53CCVBRWM189E","writing-for-agents","Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.","https:\u002F\u002Fgithub.com\u002Fwangmiaozero\u002Fpi-harness\u002Fblob\u002Fmain\u002Fresources\u002Fbuiltin-skills\u002Fmattpocock\u002Fskills\u002Fproductivity\u002Fwriting-for-agents\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M7AWWX17A9H17BRHCHHN0PYQ","wait-what","Stop. That last message did not land: re-pitch it.","https:\u002F\u002Fgithub.com\u002Fwangmiaozero\u002Fpi-harness\u002Fblob\u002Fmain\u002Fresources\u002Fbuiltin-skills\u002Fmattpocock\u002Fskills\u002Fproductivity\u002Fwait-what\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M7AWWTJXPFBG1WB5ASW1C9XF","to-questionnaire","Turn a decision you can't fully answer into a questionnaire for someone else to fill in.","https:\u002F\u002Fgithub.com\u002Fwangmiaozero\u002Fpi-harness\u002Fblob\u002Fmain\u002Fresources\u002Fbuiltin-skills\u002Fmattpocock\u002Fskills\u002Fproductivity\u002Fto-questionnaire\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7AWWR5NW24TGSN342CMHJ5P","teach","Teach the user a new skill or concept, within this workspace.","https:\u002F\u002Fgithub.com\u002Fwangmiaozero\u002Fpi-harness\u002Fblob\u002Fmain\u002Fresources\u002Fbuiltin-skills\u002Fmattpocock\u002Fskills\u002Fproductivity\u002Fteach\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M7AWWNYR6NZ1J9BA059WWGZ4","handoff","Compact the current conversation into a handoff document for another agent to pick up.","https:\u002F\u002Fgithub.com\u002Fwangmiaozero\u002Fpi-harness\u002Fblob\u002Fmain\u002Fresources\u002Fbuiltin-skills\u002Fmattpocock\u002Fskills\u002Fproductivity\u002Fhandoff\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M7AWWKJKST2EVB9N4QH9DVGT","grilling","Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.","https:\u002F\u002Fgithub.com\u002Fwangmiaozero\u002Fpi-harness\u002Fblob\u002Fmain\u002Fresources\u002Fbuiltin-skills\u002Fmattpocock\u002Fskills\u002Fproductivity\u002Fgrilling\u002FSKILL.md",[],[]]