帮助开发者创建和维护组件截图测试夹具,并优化组件的可测试性。
该技能材料显示其为开源仓库中的纯文档/提示型组件夹具说明,不要求密钥、未声明远程端点,也未显示自身具备独立执行或数据外发能力。整体风险较低,主要需留意其描述中提到的外部工具调用仅属工作流提示,实际安全性仍取决于相关工具本身。
材料明确写明“无”密钥/环境变量需求;README 也未要求登录、token 或外部服务认证,未见凭证收集、存储或滥用迹象。
系统检查项与材料均未声明远程端点;内容主要说明本地组件 explorer/截图工作流,未显示将用户数据发送到外部网络的行为。
该技能被标记为 prompt-only,材料本身是关于 fixture 编写与本地任务操作的说明文档,不是可执行安装脚本,也未显示此技能自身具有启动进程或执行系统命令的能力。
文档仅描述 fixture 文件位置、命名规范与渲染辅助函数,未声明额外文件系统、数据库或敏感资源访问权限;未见过度授权请求。
来源指向 GitHub 上的 Microsoft/vscode 开源仓库,源码可审计,这是明显的降风险因素。虽 star/维护状态字段在本材料中不完整,但未见闭源、不明下载源或可疑安装链路等红旗。
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "component-fixtures" 技能: 1. 下载 https://raw.githubusercontent.com/microsoft/vscode/main/.github/skills/component-fixtures/SKILL.md 2. 保存为 ~/.claude/skills/component-fixtures/SKILL.md 3. 装好后重载技能,告诉我可以用了
请为这个 React 组件设计适合截图测试的 fixture 方案,包含文件结构、主题切换、模拟服务数据、异步渲染处理,以及需要避免的常见问题。
一套清晰的 fixture 组织方案,说明如何稳定渲染组件并用于截图测试。
请检查这个 UI 组件为什么难以做 fixture,并给出改造建议,重点关注样式作用域、外部服务依赖、默认状态和异步加载流程。
可执行的改造建议,帮助组件更容易被隔离、复现和稳定截图。
我的组件截图测试经常失败,请帮我分析 fixture 中可能导致不稳定的因素,例如主题注入、网络 mock、时间相关渲染和延迟加载,并提供修复建议。
对不稳定原因的排查清单和修复方案,用于提升截图测试的一致性。
Component fixtures render isolated UI components for visual screenshot testing via the component explorer. Fixtures live in src/vs/workbench/test/browser/componentFixtures/ and are auto-discovered by the Vite dev server using the glob src/**/*.fixture.ts.
Use tools mcp_component-exp_* to list and screenshot fixtures. If you cannot see these tools, inform the user to them on.
mcp_component-exp_list_fixtures tool to see all available fixtures and their URLsmcp_component-exp_screenshot tool to capture screenshots programmaticallyEach fixture file exports a default defineThemedFixtureGroup(...). The file must end with .fixture.ts.
src/vs/workbench/test/browser/componentFixtures/
fixtureUtils.ts # Shared helpers (DO NOT import @vscode/component-explorer elsewhere)
myComponent.fixture.ts # Your fixture file
import { ComponentFixtureContext, createEditorServices, defineComponentFixture, defineThemedFixtureGroup } from './fixtureUtils.js';
export default defineThemedFixtureGroup({ path: 'myFeature/' }, {
Default: defineComponentFixture({ render: renderMyComponent }),
AnotherVariant: defineComponentFixture({ render: renderMyComponent }),
});
function renderMyComponent({ container, disposableStore, theme }: ComponentFixtureContext): void {
container.style.width = '400px';
const instantiationService = createEditorServices(disposableStore, {
colorTheme: theme,
additionalServices: (reg) => {
// Register additional services the component needs
reg.define(IMyService, MyServiceImpl);
reg.defineInstance(IMockService, mockInstance);
},
});
const widget = disposableStore.add(
instantiationService.createInstance(MyWidget, /* constructor args */)
);
container.appendChild(widget.domNode);
}
Key points:
defineThemedFixtureGroup automatically creates Dark and Light variants for each fixturedefineComponentFixture wraps your render function with theme setup and shadow DOM isolationcreateEditorServices provides a TestInstantiationService with base editor services pre-registereddisposableStore.add(...) to prevent leakscolorTheme: theme to createEditorServices so theme colors render correctly| Export | Purpose |
|---|---|
defineComponentFixture | Creates Dark/Light themed fixture variants from a render function |
defineThemedFixtureGroup | Groups multiple themed fixtures into a named fixture group |
createEditorServices | Creates TestInstantiationService with all base editor services |
registerWorkbenchServices | Registers additional workbench services (context menu, label, etc.) |
createTextModel | Creates a text model via ModelService for editor fixtures |
setupTheme | Applies theme CSS to a container (called automatically by defineComponentFixture) |
darkTheme / lightTheme | Pre-loaded ColorThemeData instances |
Important: Only fixtureUtils.ts may import from @vscode/component-explorer. All fixture files must go through the helpers in fixtureUtils.ts.
Fixtures render inside shadow DOM. The component-explorer automatically adopts the global VS Code stylesheets and theme CSS.
Many VS Code components have CSS rules scoped to deep ancestor selectors (e.g., .interactive-session .interactive-input-part > .widget-container .my-element). In fixtures, you must recreate the required ancestor DOM structure for these selectors to match:
function render({ container }: ComponentFixtureContext): void {
container.classList.add('interactive-session');
…
帮助开发者验证 Azure DevOps 流水线改动,快速排查构建与 YAML 配置问题。
帮助开发者升级 Anthropic SDK、迁移版本并解决相关依赖与类型问题。
为 AI 编码助手生成或更新聊天定制配置文件,统一协作与开发体验
帮助开发者定位并读取 Code OSS 开发构建日志,快速排查运行与扩展问题。
将当前会话分支的修改合并回基础分支,便于整合开发成果。
在隔离环境启动 VS Code OSS,便于联动自动化操作与多进程调试。
帮助你在使用组件浏览器的项目中高效处理 UI 变更、截图与视觉测试。
从最新 CI 运行下载并提交截图基线,快速更新组件视觉测试结果。
帮助你为 React 组件、Hook 与页面编写、修复并优化测试方案。
帮助开发者构建可复用的 Convex 组件,封装独立表结构与对外后端 API。
通过截图捕获屏幕上下文,帮助 AI 更准确理解当前界面与问题。
帮助你完整搭建 Component Explorer,配置 CLI、MCP、VS Code 任务与调试环境。