用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/GoogleChromeLabs/wpt-gen --skill wpt-gen-cli命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | wpt-gen-cli |
| description | Best practices for CLI infrastructure, outputs, subprocess management, and templating in WPT-Gen. |
This document outlines the best practices for working with the CLI infrastructure in the wpt-gen repository.
WPT-Gen uses Typer for building its command-line interface.
@app.command() decorators.generate) support a standard set of flags:
--provider (-p): Override the LLM provider (gemini, openai, anthropic).--wpt-dir (-w): Override the local web-platform-tests repository path.--config (-c): Path to a custom wpt-gen.yml.--show-responses (-s): Display raw LLM-generated responses.--use-lightweight / --use-reasoning: Force a specific model category.For displaying information to the user, WPT-Gen utilizes Rich.
print() function. You must route all outputs through the injected UIProvider dependency (e.g. ui.print, ui.warning, ui.error).rich.print (via UIProvider) for colored and formatted output.rich.panel.Panel to encapsulate related information (like summarizing test plans) and rich.table.Table for structured data, rather than dumping raw JSON or concatenated strings to the CLI.ui.status() wrappers to provide visual rich.progress spinners to the user so they know the command has not hung.WPT-Gen heavily relies on executing native binaries (wpt lint, grep) to empower LLM agents.
subprocess.run(), you must always provide explicit timeout=... constraints, otherwise a rogue blocking command will freeze the AI forever.env={**os.environ, "CUSTOM": "VAL"} mappings, rather than lazily mutating the global os.environ which bleeds state across Python threads. Reviewers must actively catch environment leaking.git grep or grep), scrutinize custom arguments for shell injection vulnerabilities. Force the use of the -- argument separator to securely separate binary options from user-generated patterns.WPT-Gen uses Jinja2 to template both prompts to the LLM and the final generated output (HTML/JS files).
wptgen/templates/ directory.{{ variable_name }}) to inject context retrieved via trafilatura or derived from local scans.{% if %} and {% for %} loops to dynamically construct test structures based on the suggested test footprint. Ensure large, nullable dependencies are robustly guarded behind {% if %} conditions to avoid causing context bloat.