[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7881XC5MXE9BQYF3DEDSDT4":3,"skill-same:01M7881XC5MXE9BQYF3DEDSDT4":47},{"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":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M7881XC5MXE9BQYF3DEDSDT4","vscode-visual-regression",null,"Write Storybook stories and visual regression tests for the Kilo VS Code extension webview UI","preetbiswas12\u002FBlitz","preetbiswas12","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F183638463?v=4","01M75JMVJJFGZ24MXTDF029W3A","Preet Biswas","01M7881E46B88TNBSCYERXSPVR",0,"MIT","https:\u002F\u002Fgithub.com\u002Fpreetbiswas12\u002FBlitz\u002Fblob\u002Fmain\u002F.kilocode\u002Fskills\u002Fvscode-visual-regression\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: vscode-visual-regression\ndescription: Write Storybook stories and visual regression tests for the Kilo VS Code extension webview UI\n---\n\nUse this skill when the user asks you to add visual regression tests, screenshot tests, or Storybook stories for components in `packages\u002Fkilo-vscode\u002F`.\n\n# Architecture\n\nThe VS Code extension uses **Storybook + Playwright** for visual regression testing:\n\n1. **Storybook stories** define UI scenarios using SolidJS components with mock contexts\n2. **Playwright** auto-discovers all stories, renders each in headless Chromium, and compares screenshots against baseline PNGs using `toHaveScreenshot()`\n3. **Baselines** are Linux-only Chromium PNGs stored in `tests\u002Fvisual-regression.spec.ts-snapshots\u002F` (tracked via Git LFS)\n\nThe test runner at `tests\u002Fvisual-regression.spec.ts` is fully automatic — it fetches ALL stories from the Storybook index and creates one Playwright test per story. You do NOT write Playwright test code. You only write stories.\n\n# How to add a visual regression test\n\n## Step 1: Decide which story file to use\n\nStories live in `packages\u002Fkilo-vscode\u002Fwebview-ui\u002Fsrc\u002Fstories\u002F`. Existing files and their scope:\n\n| File | Components covered |\n|---|---|\n| `agent-manager.stories.tsx` | FileTree, DiffPanel, FullScreenDiffView, WorktreeItem |\n| `chat.stories.tsx` | ChatView, QuestionDock |\n| `composite.stories.tsx` | AssistantMessage with tool cards, permissions, questions |\n| `prompt-input.stories.tsx` | PromptInput (sidebar prompt bar) |\n| `settings.stories.tsx` | Settings panel, ProvidersTab |\n| `history.stories.tsx` | SessionList |\n| `shared.stories.tsx` | ModelSelector and shared controls |\n\nAdd to an existing file if the component fits. Create a new file only for a genuinely new component area.\n\n## Step 2: Write the story\n\nEvery story file follows this exact structure:\n\n```tsx\n\u002F** @jsxImportSource solid-js *\u002F\n\u002F**\n * Stories for [ComponentName].\n *\u002F\n\nimport type { Meta, StoryObj } from \"storybook-solidjs-vite\"\nimport { StoryProviders } from \".\u002FStoryProviders\"\n\u002F\u002F Import the component(s) under test\nimport { MyComponent } from \"..\u002Fcomponents\u002Fpath\u002FMyComponent\"\n\nconst meta: Meta = {\n  title: \"MyCategory\", \u002F\u002F Becomes the snapshot subdirectory name (lowercased)\n  parameters: { layout: \"padded\" }, \u002F\u002F or \"fullscreen\"\n}\nexport default meta\ntype Story = StoryObj\n\nexport const MyStoryName: Story = {\n  name: \"MyComponent — description of variant\",\n  render: () => (\n    \u003CStoryProviders>\n      \u003Cdiv style={{ \"max-height\": \"400px\", overflow: \"auto\" }}>\n        \u003CMyComponent someProp=\"value\" \u002F>\n      \u003C\u002Fdiv>\n    \u003C\u002FStoryProviders>\n  ),\n}\n```\n\n### Key rules\n\n- **Always start with `\u002F** @jsxImportSource solid-js \\*\u002F`\\*\\* — required for SolidJS JSX compilation.\n- **Always wrap in `\u003CStoryProviders>`** — provides all required contexts (VSCode, Server, Config, Provider, Session, I18n, Dialog, Marked, Data, Diff, Code). Without it, components that call `useVSCode()`, `useSession()`, etc. will throw.\n- **Do NOT set an explicit `width` on the wrapper div.** The Playwright viewport is already 420px wide (or 200px for narrow stories). Setting `width: \"420px\"` leaves no room for a vertical scrollbar and causes right-side cropping in screenshots. Let the viewport control the width.\n- **Use `max-height` not `height` for the wrapper div** when you need to constrain vertical size. A fixed `height` forces a scrollbar even when content is short; `max-height` avoids unnecessary scrollbars that would eat into the available horizontal space.\n- **Meta `title`** determines the snapshot subdirectory. Use PascalCase or slash-notation (e.g., `\"Composite\u002FWebview\"`). Playwright transforms it: `\"Composite\u002FWebview\"` becomes `composite-webview\u002F` in the snapshots folder.\n- **Export name** determines the story ID. The Storybook ID is `{lowercase-title}--{kebab-export-name}`. For example, `title: \"Chat\"` + `export const ChatViewIdle` produces ID `chat--chat-view-idle`.\n- **Snapshot path** is derived automatically: `tests\u002Fvisual-regression.spec.ts-snapshots\u002F{title-slug}\u002F{variant-slug}.png`. Example: `chat\u002Fchat-view-idle-chromium-linux.png`.\n\n### StoryProviders props\n\n```tsx\ninterface StoryProvidersProps {\n  data?: any \u002F\u002F Override mock data (messages, parts, permissions, etc.)\n  permissions?: PermissionRequest[] \u002F\u002F Active permission requests\n  questions?: QuestionRequest[] \u002F\u002F Active question requests\n  status?: string \u002F\u002F Session status: \"idle\" | \"busy\"\n  sessionID?: string \u002F\u002F Custom session ID\n  noPadding?: boolean \u002F\u002F Skip the default 12px padding wrapper\n}\n```\n\n### Overriding session state\n\nFor stories that need custom session behavior (messages, agents, model overrides), use `mockSessionValue()` and override the `SessionContext`:\n\n```tsx\nimport { mockSessionValue } from \".\u002FStoryProviders\"\nimport { SessionContext } from \"..\u002Fcontext\u002Fsession\"\n\nexport const MyCustomStory: Story = {\n  name: \"Component — custom state\",\n  render: () => {\n    const session = {\n      ...mockSessionValue({ id: \"my-session\", status: \"idle\" }),\n      messages: () => [{ id: \"msg-001\" }] as any[],\n      totalCost: () => 0.0023,\n    }\n    return (\n      \u003CStoryProviders sessionID=\"my-session\" status=\"idle\" noPadding>\n        \u003CSessionContext.Provider value={session as any}>\n          \u003CMyComponent \u002F>\n        \u003C\u002FSessionContext.Provider>\n      \u003C\u002FStoryProviders>\n    )\n  },\n}\n```\n\n### Overriding data context (messages, parts, permissions)\n\nFor stories showing assistant messages with tool parts or permissions, build a custom `data` object:\n\n```tsx\nimport { defaultMockData } from \".\u002FStoryProviders\"\n\nconst SESSION_ID = \"story-session-001\"\nconst ASST_MSG_ID = \"asst-msg-001\"\n\n\u002F\u002F Build mock message + parts\nconst baseMessage = {\n  id: ASST_MSG_ID,\n  sessionID: SESSION_ID,\n  role: \"assistant\",\n  \u002F\u002F ... see composite.stories.tsx for full shape\n}\n\nconst myPart = {\n  id: \"part-001\",\n  sessionID: SESSION_ID,\n  messageID: ASST_MSG_ID,\n  type: \"tool\",\n  tool: \"read\",\n  \u002F\u002F ... see composite.stories.tsx for full ToolPart shape\n}\n\nfunction dataWith(parts: any[], permissions?: PermissionRequest[]) {\n  return {\n    ...defaultMockData,\n    message: { [SESSION_ID]: [baseMessage] },\n    part: { [ASST_MSG_ID]: parts },\n    permission: permissions ? { [SESSION_ID]: permissions } : {},\n  }\n}\n\nexport const MyToolStory: Story = {\n  name: \"Tool — with custom parts\",\n  render: () => (\n    \u003CStoryProviders data={dataWith([myPart])} sessionID={SESSION_ID}>\n      \u003CAssistantMessage message={baseMessage} \u002F>\n    \u003C\u002FStoryProviders>\n  ),\n}\n```\n\n## Step 3: Handle narrow viewports\n\nFor components that should be tested at multiple widths, create separate stories. Stories whose Storybook ID ends in `-200` are automatically rendered at 200px width by the test runner:\n\n```tsx\nexport const Default420: Story = {\n  name: \"Default — 420px\",\n  render: () => (\n    \u003CStoryProviders>\n      \u003CMyComponent \u002F>\n    \u003C\u002FStoryProviders>\n  ),\n}\n\nexport const Default200: Story = {\n  name: \"Default — 200px\", \u002F\u002F Storybook ID will end in -200\n  render: () => (\n    \u003CStoryProviders>\n      \u003CMyComponent \u002F>\n    \u003C\u002FStoryProviders>\n  ),\n}\n```\n\nThe naming convention with `-200` suffix on the **export name** (e.g., `Default200`) produces the ID `mycategory--default-200`, which the test runner detects and uses a 200px viewport for.\n\n## Step 4: Handle animations \u002F non-deterministic content\n\nThe test runner injects CSS to disable all animations and transitions. If a story still produces non-deterministic frames (e.g., a spinner captured at a random rotation), add the story ID to the `SKIP` set in `tests\u002Fvisual-regression.spec.ts`:\n\n```ts\nconst SKIP = new Set\u003Cstring>([\"agentmanager--worktree-item-busy\"])\n```\n\nOnly skip stories as a last resort. Prefer making the story deterministic (e.g., use a static state instead of an animated one).\n\n## Step 5: Generate baseline images\n\nBaselines are generated on **Linux CI only** (font rendering differs on macOS). The CI workflow at `.github\u002Fworkflows\u002Fvisual-regression.yml` auto-runs `bun run test:visual:update` and commits new baselines to the PR branch.\n\n**You do NOT need to generate baseline PNGs locally.** Just write the story, push, and CI handles the rest.\n\nTo preview stories locally:\n\n```bash\n# From packages\u002Fkilo-vscode\u002F\nbun run storybook\n# Opens at http:\u002F\u002Flocalhost:6007\n```\n\n# Reference: snapshot directory structure\n\nSnapshots live at `packages\u002Fkilo-vscode\u002Ftests\u002Fvisual-regression.spec.ts-snapshots\u002F`:\n\n```\ntests\u002Fvisual-regression.spec.ts-snapshots\u002F\n  {title-slug}\u002F\n    {variant-slug}-chromium-linux.png\n```\n\nThe title-slug is derived from the meta `title` (lowercased, slashes become hyphens). The variant-slug is derived from the story export name (kebab-cased). Chromium and Linux suffixes are appended by Playwright.\n\nExample mapping:\n\n| Meta title | Export name | Snapshot path |\n|---|---|---|\n| `\"Chat\"` | `ChatViewIdle` | `chat\u002Fchat-view-idle-chromium-linux.png` |\n| `\"Composite\u002FWebview\"` | `GlobWithPermission` | `composite-webview\u002Fglob-with-permission-chromium-linux.png` |\n| `\"Prompt Input\"` | `Default200` | `prompt-input\u002Fdefault-200-chromium-linux.png` |\n| `\"AgentManager\"` | `WorktreeItemActive` | `agentmanager\u002Fworktree-item-active-chromium-linux.png` |\n\n# Reference: Playwright config\n\nKey settings in `packages\u002Fkilo-vscode\u002Fplaywright.config.ts`:\n\n- Default viewport: **420x720** (VS Code sidebar dimensions)\n- Narrow stories (ID ending `-200`): **200x720**\n- Max pixel diff ratio: **0.01** (1% tolerance)\n- Browser: **Chromium only**\n- Storybook: built and served statically on port **6007**\n- Animations: forced off via `reducedMotion: \"reduce\"` + injected CSS\n\n# Reference: CI pipeline\n\nThe `visual-regression.yml` workflow triggers on PRs when these paths change:\n\n- `packages\u002Fkilo-ui\u002F**`\n- `packages\u002Fui\u002F**`\n- `packages\u002Futil\u002F**`\n- `packages\u002Fsdk\u002Fjs\u002F**`\n- `packages\u002Fkilo-vscode\u002Fwebview-ui\u002F**`\n- `packages\u002Fkilo-vscode\u002F.storybook\u002F**`\n- `packages\u002Fkilo-vscode\u002Ftests\u002Fvisual-regression*`\n- `.github\u002Fworkflows\u002Fvisual-regression.yml`\n\nCI auto-commits new baselines via Git LFS and fails if screenshots changed, requiring developer review.\n\n# Reference: import paths\n\nSidebar webview components live in `webview-ui\u002Fsrc\u002Fcomponents\u002F` and are imported relative to the stories directory:\n\n```tsx\nimport { ChatView } from \"..\u002Fcomponents\u002Fchat\u002FChatView\"\nimport { PromptInput } from \"..\u002Fcomponents\u002Fchat\u002FPromptInput\"\nimport { AssistantMessage } from \"..\u002Fcomponents\u002Fchat\u002FAssistantMessage\"\n```\n\nAgent Manager components live in `webview-ui\u002Fagent-manager\u002F` (one level up from the stories dir):\n\n```tsx\nimport { FileTree } from \"..\u002F..\u002Fagent-manager\u002FFileTree\"\nimport { DiffPanel } from \"..\u002F..\u002Fagent-manager\u002FDiffPanel\"\nimport { WorktreeItem } from \"..\u002F..\u002Fagent-manager\u002FWorktreeItem\"\nimport \"..\u002F..\u002Fagent-manager\u002Fagent-manager.css\" \u002F\u002F Required for AM component styles\n```\n\nkilo-ui components are imported via deep subpaths:\n\n```tsx\nimport { Part } from \"@blitxcode\u002Fkilo-ui\u002Fmessage-part\"\nimport { BasicTool } from \"@blitxcode\u002Fkilo-ui\u002Fbasic-tool\"\nimport { Button } from \"@blitxcode\u002Fkilo-ui\u002Fbutton\"\n```\n\nSDK types for mock data:\n\n```tsx\nimport type { AssistantMessage as SDKAssistantMessage, TextPart, ToolPart } from \"@blitxcode\u002Fsdk\u002Fv2\"\nimport type { PermissionRequest, QuestionRequest } from \"..\u002Ftypes\u002Fmessages\"\n```\n\n# Reference: Storybook theme globals\n\nThe test runner renders every story with dark theme globals:\n\n```\nglobals=colorScheme:dark;theme:kilo-vscode;vscodeTheme:dark-modern\n```\n\nThe `.storybook\u002Fpreview.tsx` applies these via a decorator that calls `applyVscodeTheme()` \u002F `applyKiloTheme()` from kilo-ui. Stories do NOT need to handle theming — it happens automatically.\n\n# Reference: tool override registration\n\nIf your story renders `AssistantMessage` with tool parts, you may need to register VS Code tool overrides at the top of the file (outside any story), as done in `composite.stories.tsx`:\n\n```tsx\nimport { registerVscodeToolOverrides } from \"..\u002Fcomponents\u002Fchat\u002FVscodeToolOverrides\"\nregisterVscodeToolOverrides()\n```\n\nThis ensures tool cards like `bash` render with their VS Code-specific expanded\u002Fcollapsed behavior.\n\n# Checklist for adding a new visual regression test\n\n1. Identify or create the story file in `webview-ui\u002Fsrc\u002Fstories\u002F`\n2. Import the component and `StoryProviders` (and optionally `mockSessionValue`, `defaultMockData`)\n3. Write the story with explicit dimensions and mock data\n4. Wrap in `\u003CStoryProviders>` with appropriate props\n5. If testing multiple widths, create separate exports with the `-200` suffix convention\n6. If the component has animated states, prefer a static variant or add to the SKIP set\n7. Push to PR — CI generates baseline PNGs automatically\n8. Review the auto-committed baseline images in the PR diff\n","Use this skill when the user asks you to add visual regression tests, screenshot tests, or Storybook stories for components in `packages\u002Fkilo-vscode\u002F`.\n\n# Architecture\n\nThe VS Code extension uses **Storybook + Playwright** for visual regression testing:\n\n1. **Storybook stories** define UI scenarios using SolidJS components with mock contexts\n2. **Playwright** auto-discovers all stories, renders each in headless Chromium, and compares screenshots against baseline PNGs using `toHaveScreenshot()`\n3. **Baselines** are Linux-only Chromium PNGs stored in `tests\u002Fvisual-regression.spec.ts-snapshots\u002F` (tracked via Git LFS)\n\nThe test runner at `tests\u002Fvisual-regression.spec.ts` is fully automatic — it fetches ALL stories from the Storybook index and creates one Playwright test per story. You do NOT write Playwright test code. You only write stories.\n\n# How to add a visual regression test\n\n## Step 1: Decide which story file to use\n\nStories live in `packages\u002Fkilo-vscode\u002Fwebview-ui\u002Fsrc\u002Fstories\u002F`. Existing files and their scope:\n\n| File | Components covered |\n|---|---|\n| `agent-manager.stories.tsx` | FileTree, DiffPanel, FullScreenDiffView, WorktreeItem |\n| `chat.stories.tsx` | ChatView, QuestionDock |\n| `composite.stories.tsx` | AssistantMessage with tool cards, permissions, questions |\n| `prompt-input.stories.tsx` | PromptInput (sidebar prompt bar) |\n| `settings.stories.tsx` | Settings panel, ProvidersTab |\n| `history.stories.tsx` | SessionList |\n| `shared.stories.tsx` | ModelSelector and shared controls |\n\nAdd to an existing file if the component fits. Create a new file only for a genuinely new component area.\n\n## Step 2: Write the story\n\nEvery story file follows this exact structure:\n\n```tsx\n\u002F** @jsxImportSource solid-js *\u002F\n\u002F**\n * Stories for [ComponentName].\n *\u002F\n\nimport type { Meta, StoryObj } from \"storybook-solidjs-vite\"\nimport { StoryProviders } from \".\u002FStoryProviders\"\n\u002F\u002F Import the component(s) under test\nimport { MyComponent } from \"..\u002Fcomponents\u002Fpath\u002FMyComponent\"\n\nconst meta: Meta = {\n  title: \"MyCategory\", \u002F\u002F Becomes the snapshot subdirectory name (lowercased)\n  parameters: { layout: \"padded\" }, \u002F\u002F or \"fullscreen\"\n}\nexport default meta\ntype Story = StoryObj\n\nexport const MyStoryName: Story = {\n  name: \"MyComponent — description of variant\",\n  render: () => (\n    \u003CStoryProviders>\n      \u003Cdiv style={{ \"max-height\": \"400px\", overflow: \"auto\" }}>\n        \u003CMyComponent someProp=\"value\" \u002F>\n      \u003C\u002Fdiv>\n    \u003C\u002FStoryProviders>\n  ),\n}\n```\n\n### Key rules\n\n- **Always start with `\u002F** @jsxImportSource solid-js \\*\u002F`\\*\\* — required for SolidJS JSX compilation.\n- **Always wrap in `\u003CStoryProviders>`** — provides all required contexts (VSCode, Server, Config, Provider, Session, I18n, Dialog, Marked, Data, Diff, Code). Without it, components that call `useVSCode()`, `useSession()`, etc. will throw.\n- **Do NOT set an explicit `width` on the wrapper div.** The Playwright viewport is already 420px wide (or 200px for narrow stories). Setting `width: \"420px\"` leaves no room for a vertical scrollbar and causes right-side cropping in screenshots. Let the viewport control the width.\n- **Use `max-height` not `height` for the wrapper div** when you need to constrain vertical size. A fixed `height` forces a scrollbar even when content is short; `max-height` avoids unnecessary scrollbars that would eat into the available horizontal space.\n- **Meta `title`** determines the snapshot subdirectory. Use PascalCase or slash-notation (e.g., `\"Composite\u002FWebview\"`). Playwright transforms it: `\"Composite\u002FWebview\"` becomes `composite-webview\u002F` in the snapshots folder.\n- **Export name** determines the story ID. The Storybook ID is `{lowercase-title}--{kebab-export-name}`. For example, `title: \"Chat\"` + `export const ChatViewIdle` produces ID `chat--chat-view-idle`.\n- **Snapshot path** is derived automatically: `tests\u002Fvisual-regression.spec.ts-snapshots\u002F{title-slug}\u002F{variant-slug}.png`. Example: `chat\u002Fchat-view-idle-chromium-linux.png`.\n\n### StoryProviders props\n\n```tsx\ninterface StoryProvidersProps {\n  data?: any \u002F\u002F Override mock data (messages, parts, permissions, etc.)\n  permissions?: PermissionRequest[] \u002F\u002F Active permission requests\n  questions?: QuestionRequest[] \u002F\u002F Active question requests\n  status?: string \u002F\u002F Session status: \"idle\" | \"busy\"\n  sessionID?: string \u002F\u002F Custom session ID\n  noPadding?: boolean \u002F\u002F Skip the default 12px padding wrapper\n}\n```\n\n### Overriding session state\n\nFor stories that need custom session behavior (messages, agents, model overrides), use `mockSessionValue()` and override the `SessionContext`:\n\n```tsx\nimport { mockSessionValue } from \".\u002FStoryProviders\"\nimport { SessionContext } from \"..\u002Fcontext\u002Fsession\"\n\nexport const MyCustomStory: Story = {\n  name: \"Component — custom state\",\n  render: () => {\n    const session = {\n      ...mockSessionValue({ id: \"my-session\", status: \"idle\" }),\n      messages: () => [{ id: \"msg-001\" }] as any[],\n      totalCost: () => 0.0023,\n    }\n    return (\n      \u003CStoryProviders sessionID=\"my-session\" status=\"idle\" noPadding>\n        \u003CSessionContext.Provider value={session as any}>\n          \u003CMyComponent \u002F>\n        \u003C\u002FSessionContext.Provider>\n      \u003C\u002FStoryProviders>\n    )\n  },\n}\n```\n\n### Overriding data context (messages, parts, permissions)\n\nFor stories showing assistant messages with tool parts or permissions, build a custom `data` object:\n\n```tsx\nimport { defaultMockData } from \".\u002FStoryProviders\"\n\nconst SESSION_ID = \"story-session-001\"\nconst ASST_MSG_ID = \"asst-msg-001\"\n\n\u002F\u002F Build mock message + parts\nconst baseMessage = {\n  id: ASST_MSG_ID,\n  sessionID: SESSION_ID,\n  role: \"assistant\",\n  \u002F\u002F ... see composite.stories.tsx for full shape\n}\n\nconst myPart = {\n  id: \"part-001\",\n  sessionID: SESSION_ID,\n  messageID: ASST_MSG_ID,\n  type: \"tool\",\n  tool: \"read\",\n  \u002F\u002F ... see composite.stories.tsx for full ToolPart shape\n}\n\nfunction dataWith(parts: any[], permissions?: PermissionRequest[]) {\n  return {\n    ...defaultMockData,\n    message: { [SESSION_ID]: [baseMessage] },\n    part: { [ASST_MSG_ID]: parts },\n    permission: permissions ? { [SESSION_ID]: permissions } : {},\n  }\n}\n\nexport const MyToolStory: Story = {\n  name: \"Tool — with custom parts\",\n  render: () => (\n    \u003CStoryProviders data={dataWith([myPart])} sessionID={SESSION_ID}>\n      \u003CAssistantMessage message={baseMessage} \u002F>\n    \u003C\u002FStoryProviders>\n  ),\n}\n```\n\n## Step 3: Handle narrow viewports\n\nFor components that should be tested at multiple widths, create separate stories. Stories whose Storybook ID ends in `-200` are automatically rendered at 200px width by the test runner:\n\n```tsx\nexport const Default420: Story = {\n  name: \"Default — 420px\",\n  render: () => (\n    \u003CStoryProviders>\n      \u003CMyComponent \u002F>\n    \u003C\u002FStoryProviders>\n  ),\n}\n\nexport const Default200: Story = {\n  name: \"Default — 200px\", \u002F\u002F Storybook ID will end in -200\n  render: () => (\n    \u003CStoryProviders>\n      \u003CMyComponent \u002F>\n    \u003C\u002FStoryProviders>\n  ),\n}\n```\n\nThe naming convention with `-200` suffix on the **export name** (e.g., `Default200`) produces the ID `mycategory--default-200`, which the test runner detects and uses a 200px viewport for.\n\n## Step 4: Handle animations \u002F non-deterministic content\n\nThe test runner injects CSS to disable all animations and transitions. If a story still produces non-deterministic frames (e.g., a spinner captured at a random rotation), add the story ID to the `SKIP` set in `tests\u002Fvisual-regression.spec.ts`:\n\n```ts\nconst SKIP = new Set\u003Cstring>([\"agentmanager--worktree-item-busy\"])\n```\n\nOnly skip stories as a last resort. Prefer making the story deterministic (e.g., use a static state instead of an animated one).\n\n## Step 5: Generate baseline images\n\nBaselines are generated on **Linux CI only** (font rendering differs on macOS). The CI workflow at `.github\u002Fworkflows\u002Fvisual-regression.yml` auto-runs `bun run test:visual:update` and commits new baselines to the PR branch.\n\n**You do NOT need to generate baseline PNGs locally.** Just write the story, push, and CI handles the rest.\n\nTo preview stories locally:\n\n```bash\n# From packages\u002Fkilo-vscode\u002F\nbun run storybook\n# Opens at http:\u002F\u002Flocalhost:6007\n```\n\n# Reference: snapshot directory structure\n\nSnapshots live at `packages\u002Fkilo-vscode\u002Ftests\u002Fvisual-regression.spec.ts-snapshots\u002F`:\n\n```\ntests\u002Fvisual-regression.spec.ts-snapshots\u002F\n  {title-slug}\u002F\n    {variant-slug}-chromium-linux.png\n```\n\nThe title-slug is derived from the meta `title` (lowercased, slashes become hyphens). The variant-slug is derived from the story export name (kebab-cased). Chromium and Linux suffixes are appended by Playwright.\n\nExample mapping:\n\n| Meta title | Export name | Snapshot path |\n|---|---|---|\n| `\"Chat\"` | `ChatViewIdle` | `chat\u002Fchat-view-idle-chromium-linux.png` |\n| `\"Composite\u002FWebview\"` | `GlobWithPermission` | `composite-webview\u002Fglob-with-permission-chromium-linux.png` |\n| `\"Prompt Input\"` | `Default200` | `prompt-input\u002Fdefault-200-chromium-linux.png` |\n| `\"AgentManager\"` | `WorktreeItemActive` | `agentmanager\u002Fworktree-item-active-chromium-linux.png` |\n\n# Reference: Playwright config\n\nKey settings in `packages\u002Fkilo-vscode\u002Fplaywright.config.ts`:\n\n- Default viewport: **420x720** (VS Code sidebar dimensions)\n- Narrow stories (ID ending `-200`): **200x720**\n- Max pixel diff ratio: **0.01** (1% tolerance)\n- Browser: **Chromium only**\n- Storybook: built and served statically on port **6007**\n- Animations: forced off via `reducedMotion: \"reduce\"` + injected CSS\n\n# Reference: CI pipeline\n\nThe `visual-regression.yml` workflow triggers on PRs when these paths change:\n\n- `packages\u002Fkilo-ui\u002F**`\n- `packages\u002Fui\u002F**`\n- `packages\u002Futil\u002F**`\n- `packages\u002Fsdk\u002Fjs\u002F**`\n- `packages\u002Fkilo-vscode\u002Fwebview-ui\u002F**`\n- `packages\u002Fkilo-vscode\u002F.storybook\u002F**`\n- `packages\u002Fkilo-vscode\u002Ftests\u002Fvisual-regression*`\n- `.github\u002Fworkflows\u002Fvisual-regression.yml`\n\nCI auto-commits new baselines via Git LFS and fails if screenshots changed, requiring developer review.\n\n# Reference: import paths\n\nSidebar webview components live in `webview-ui\u002Fsrc\u002Fcomponents\u002F` and are imported relative to the stories directory:\n\n```tsx\nimport { ChatView } from \"..\u002Fcomponents\u002Fchat\u002FChatView\"\nimport { PromptInput } from \"..\u002Fcomponents\u002Fchat\u002FPromptInput\"\nimport { AssistantMessage } from \"..\u002Fcomponents\u002Fchat\u002FAssistantMessage\"\n```\n\nAgent Manager components live in `webview-ui\u002Fagent-manager\u002F` (one level up from the stories dir):\n\n```tsx\nimport { FileTree } from \"..\u002F..\u002Fagent-manager\u002FFileTree\"\nimport { DiffPanel } from \"..\u002F..\u002Fagent-manager\u002FDiffPanel\"\nimport { WorktreeItem } from \"..\u002F..\u002Fagent-manager\u002FWorktreeItem\"\nimport \"..\u002F..\u002Fagent-manager\u002Fagent-manager.css\" \u002F\u002F Required for AM component styles\n```\n\nkilo-ui components are imported via deep subpaths:\n\n```tsx\nimport { Part } from \"@blitxcode\u002Fkilo-ui\u002Fmessage-part\"\nimport { BasicTool } from \"@blitxcode\u002Fkilo-ui\u002Fbasic-tool\"\nimport { Button } from \"@blitxcode\u002Fkilo-ui\u002Fbutton\"\n```\n\nSDK types for mock data:\n\n```tsx\nimport type { AssistantMessage as SDKAssistantMessage, TextPart, ToolPart } from \"@blitxcode\u002Fsdk\u002Fv2\"\nimport type { PermissionRequest, QuestionRequest } from \"..\u002Ftypes\u002Fmessages\"\n```\n\n# Reference: Storybook theme globals\n\nThe test runner renders every story with dark theme globals:\n\n```\nglobals=colorScheme:dark;theme:kilo-vscode;vscodeTheme:dark-modern\n```\n\nThe `.storybook\u002Fpreview.tsx` applies these via a decorator that calls `applyVscodeTheme()` \u002F `applyKiloTheme()` from kilo-ui. Stories do NOT need to handle theming — it happens automatically.\n\n# Reference: tool override registration\n\nIf your story renders `AssistantMessage` with tool parts, you may need to register VS Code tool overrides at the top of the file (outside any story), as done in `composite.stories.tsx`:\n\n```tsx\nimport { registerVscodeToolOverrides } from \"..\u002Fcomponents\u002Fchat\u002FVscodeToolOverrides\"\nregisterVscodeToolOverrides()\n```\n\nThis ensures tool cards like `bash` render with their VS Code-specific expanded\u002Fcollapsed behavior.\n\n# Checklist for adding a new visual regression test\n\n1. Identify or create the story file in `webview-ui\u002Fsrc\u002Fstories\u002F`\n2. Import the component and `StoryProviders` (and optionally `mockSessionValue`, `defaultMockData`)\n3. Write the story with explicit dimensions and mock data\n4. Wrap in `\u003CStoryProviders>` with appropriate props\n5. If testing multiple widths, create separate exports with the `-200` suffix convention\n6. If the component has animated states, prefer a static variant or add to the SKIP set\n7. Push to PR — CI generates baseline PNGs automatically\n8. Review the auto-committed baseline images in the PR diff\n",{"name":5,"description":7},"main","342e9dd5d9b9f0e74269a7628faebb54d7ef2900",".kilocode\u002Fskills\u002Fvscode-visual-regression","https:\u002F\u002Fgithub.com\u002Fpreetbiswas12\u002FBlitz","https:\u002F\u002Fpreetbiswas12.github.io\u002FBlitz\u002F","https:\u002F\u002Fgithub.com\u002Fpreetbiswas12","https:\u002F\u002Fpreet-biswas.vercel.app","Building code blocks","2026-11-11 13:49:49",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add preetbiswas12\u002FBlitz --skill vscode-visual-regression",{"tool":39,"command":40},"bunx","bunx skills add preetbiswas12\u002FBlitz --skill vscode-visual-regression",{"tool":42,"command":43},"pnpm","pnpm dlx skills add preetbiswas12\u002FBlitz --skill vscode-visual-regression","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fpreetbiswas12\u002FBlitz\u002Fblob\u002Fmain\u002F.kilocode\u002Fskills\u002Fvscode-visual-regression\u002FSKILL.md",true,[],[48,55,62,70,77,84],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M7882EZ55JE258GCKN0N41XG","cloudflare","Comprehensive Cloudflare platform skill covering Workers, Pages, storage (KV, D1, R2), AI (Workers AI, Vectorize, Agents SDK), networking (Tunnel, Spectrum), security (WAF, DDoS), and infrastructure-as-code (Terraform, Pulumi). Use for any Cloudflare development task.","https:\u002F\u002Fgithub.com\u002Fpreetbiswas12\u002FBlitz\u002Fblob\u002Fmain\u002Fpackages\u002Fopencode\u002Ftest\u002Ffixture\u002Fskills\u002Fcloudflare\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M7882BKAMZ23N24JCPVK3F41","agents-sdk","Build AI agents on Cloudflare Workers using the Agents SDK. Load when creating stateful agents, durable workflows, real-time WebSocket apps, scheduled tasks, MCP servers, or chat applications. Covers Agent class, state management, callable RPC, Workflows integration, and React hooks.","https:\u002F\u002Fgithub.com\u002Fpreetbiswas12\u002FBlitz\u002Fblob\u002Fmain\u002Fpackages\u002Fopencode\u002Ftest\u002Ffixture\u002Fskills\u002Fagents-sdk\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":66,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M78824V4TE9CJ31HBV3HTZ0V","humanizer","Rewrite AI-sounding text so it reads naturally without changing what it says.\nUse when editing or reviewing prose for inflated claims,\nsales language, vague sources, repetitive structure, stock AI words, passive\nvoice, filler, or chatbot artifacts. Based on Wikipedia's \"Signs of AI writing.\"","https:\u002F\u002Fgithub.com\u002Fpreetbiswas12\u002FBlitz\u002Fblob\u002Fmain\u002Fhumanizer-main\u002Fhumanizer-main\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fpreetbiswas12\u002FBlitz\u002Fblob\u002Fmain\u002Fhumanizer-main\u002Fhumanizer-main\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},"01M78822DXTMFBKTJCET1B4WHZ","effect","Work with Effect v4 \u002F effect-smol TypeScript code in this repo","https:\u002F\u002Fgithub.com\u002Fpreetbiswas12\u002FBlitz\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Feffect\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7881RWCG22482CWGN226RMM","release-jetbrains","Use when releasing the Kilo JetBrains plugin -- resolve a version (\"next rc\" or explicit), run the prepare workflow, edit and commit a filtered human-readable changelog on the release PR, then watch publish to completion.","https:\u002F\u002Fgithub.com\u002Fpreetbiswas12\u002FBlitz\u002Fblob\u002Fmain\u002F.kilo\u002Fskills\u002Frelease-jetbrains\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7881NBDBBMXG6ZSZ6A4N8WN","kilocode-merge-minimizer","Use when changing shared upstream-owned files to add Kilo-specific behavior, editing `kilocode_change` markers in shared code, or moving additive behavior out of shared code to reduce upstream merge conflicts. Do not use for changes confined to Kilo-owned paths such as `packages\u002Fkilo-vscode\u002F` or `packages\u002Fkilo-ui\u002F`.","https:\u002F\u002Fgithub.com\u002Fpreetbiswas12\u002FBlitz\u002Fblob\u002Fmain\u002F.kilo\u002Fskills\u002Fkilocode-merge-minimizer\u002FSKILL.md",[],[]]