帮助你在使用组件浏览器的项目中高效处理 UI 变更、截图与视觉测试。
该技能材料显示其本质是开源的提示/文档型 UI 开发指导,不要求密钥,也未声明任何远程端点。基于现有材料,整体风险较低;仅需注意 README 示例中包含常规前端代码与可能的项目内网络请求示例,但未见独立外发或越权迹象。
材料明确标注无需密钥或环境变量,未见要求提供 token、API key 或其他敏感凭证的说明,凭证泄露面较小。
未声明任何远程端点;README 中仅出现前端示例代码里的 `fetch('/api/data')`,属于项目内示例而非该技能自身固定外发行为,未见将用户数据发送到第三方服务的描述。
系统检查项已标注为 prompt-only,说明该技能本身是说明性内容而非可执行工具;材料未显示其会在本机启动进程、执行脚本或调用系统级能力。
材料主要描述如何编写 `.fixture.ts/.tsx` 文件及 UI 渲染约束,未声明可读取、写入或枚举本地敏感文件/数据源;对数据访问的描述限于组件容器和项目代码层面。
来源指向 GitHub 上的微软仓库,且标注为开源,可审计性是明显正面因素;但许可证未声明、star 为 0、维护状态未知,仍建议在使用前核验仓库活跃度与实际归属。
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "use-component-explorer" 技能: 1. 下载 https://raw.githubusercontent.com/microsoft/vscode-team-kit/main/component-explorer/skills/use-component-explorer/SKILL.md 2. 保存为 ~/.claude/skills/use-component-explorer/SKILL.md 3. 装好后重载技能,告诉我可以用了
项目使用组件浏览器。我刚新增了一个按钮组件,请告诉我应该如何添加 fixture,用于展示默认态、禁用态和加载态,并给出示例结构。
说明应在组件浏览器中如何新增展示用例,并给出多状态 fixture 的组织方式与示例。
我修改了卡片组件的样式。请根据组件浏览器的工作流,列出我需要更新的截图、视觉测试检查点,以及如何避免遗漏回归问题。
一份围绕截图更新与视觉回归检查的操作清单,帮助完成 UI 变更后的验证。
组件浏览器里的视觉测试失败了,差异出现在弹窗组件。请帮我分析常见原因,并给出按优先级排序的排查步骤。
按优先级整理的排查建议,涵盖环境差异、数据状态、样式变更和截图基线更新等可能原因。
Fixture files end in .fixture.ts or .fixture.tsx and are auto-discovered by the Vite plugin.
Every fixture has a render function that receives a container DOM element and a RenderContext:
import { defineFixture } from '@vscode/component-explorer';
export default defineFixture({
render: (container) => {
// Render your component into container
return { dispose: () => { /* cleanup */ } };
},
});
The second argument to render provides:
signal — AbortSignal for cancellation (check signal.aborted or listen to 'abort')defineFixture({
render: async (container, { signal }) => {
const data = await fetch('/api/data', { signal });
container.textContent = await data.text();
},
});
import { createRoot } from 'react-dom/client';
import { defineFixture } from '@vscode/component-explorer';
import { MyComponent } from './MyComponent';
export default defineFixture({
render: (container) => {
const root = createRoot(container);
root.render(<MyComponent />);
return { dispose: () => root.unmount() };
},
});
Group related fixtures in a single file:
import { defineFixture, defineFixtureGroup } from '@vscode/component-explorer';
export default defineFixtureGroup({
Default: defineFixture({ render: (c) => { /* ... */ } }),
WithError: defineFixture({ render: (c) => { /* ... */ } }),
Disabled: defineFixture({ render: (c) => { /* ... */ } }),
});
Groups can have metadata (path prefix, labels):
export default defineFixtureGroup({ path: 'Forms/', labels: ['forms'] }, {
Primary: defineFixture({ /* ... */ }),
Secondary: defineFixture({ /* ... */ }),
});
For closely related variants rendered side-by-side:
import { defineFixture, defineFixtureGroup, defineFixtureVariants } from '@vscode/component-explorer';
export default defineFixtureGroup({
Sizes: defineFixtureVariants({
Small: defineFixture({ render: (c) => { /* ... */ } }),
Medium: defineFixture({ render: (c) => { /* ... */ } }),
Large: defineFixture({ render: (c) => { /* ... */ } }),
}),
});
Set background: 'dark' for components designed for dark backgrounds:
defineFixture({
background: 'dark',
render: (container) => { /* ... */ },
});
Fixtures must not mutate global state. Each fixture's render function should only modify the provided container element and return a dispose function that fully cleans up. No writes to document.body, global variables, localStorage, shared singletons, or other state outside the container. This ensures fixtures can be rendered in any order, in parallel, and multiple times without interference.
Do not use global CSS selectors like :root, html, body, or *. Every style must be scoped to a class name (e.g. .app-root, .my-component). Components are rendered in isolation inside the explorer — global styles leak across fixtures and break the isolated rendering model.
App-level CSS files (resets, CSS variables on :root, etc.) are fine for the app itself, but they must not be imported by components or fixture files. Keep app-level styles in separate entry points (e.g. index.css imported only by the app's main.ts) so they are never loaded during fixture rendering. If a component needs shared variables or resets, apply them within the fixture's container element or via the project-local wrapper (see below).
defineFixture Directly…
为 GitHub 议题或拉取请求快速添加表情反应,提升协作反馈效率。
汇集多模型独立方案与辩论,辅助实现路径和架构决策
用于创建和管理 AST 禁用规则,阻止特定代码语法或模式出现在编辑中。
帮助 AI 代理读写记忆与规则,并按环境自动选择可用存储方案
帮助用户检测并安装 GitHub CLI,快速完成命令行开发环境准备。
调用多模型交叉审查代码变更、PR与高风险修改,辅助发现缺陷与争议点
帮助开发者创建和维护组件截图测试夹具,并优化组件的可测试性。
帮助你构建、调试并验证各类 Web 应用前端功能与交互问题
帮助你编写和排查 Guigui 框架的 GUI 组件与交互逻辑。
帮助你完整搭建 Component Explorer,配置 CLI、MCP、VS Code 任务与调试环境。
帮助你实现与迭代界面和交互体验,完成前端集成与设计优化。
帮助用户设计并生成高质量、可生产的前端界面与网页组件代码