원클릭으로
wpt-gen-cli
Best practices for CLI infrastructure, outputs, subprocess management, and templating in WPT-Gen.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Best practices for CLI infrastructure, outputs, subprocess management, and templating in WPT-Gen.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Evaluate a WPT test file against extracted normative requirements from its governing spec. Use when a spec URL is available and conformance to the spec needs to be judged. Pairs with the wpt-evaluator skill, which checks against WPT documentation guidance rather than spec conformance.
Evaluate the quality of a WPT test file against guidance in the upstream WPT documentation. Use when reviewing a generated or submitted test before merge.
Generate Web Platform Tests (WPT) from minimal XML test suggestions. The agent will autonomously determine the test type and implementation details by analyzing existing repository paradigms. Use when the user asks to generate a Web Platform Test based on a test suggestion.
Instructions to manually test the generate workflow of WPT-Gen to verify system integrity.
Best practices for configuring LLM integrations, concurrent networking, context scraping, and managing prompts in WPT-Gen.
Instructions on managing dependencies, build tools, project architecture rules, and integrating workflows via the Makefile in WPT-Gen.
| 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.