一键导入
wpt-gen-maintenance
// Instructions on managing dependencies, build tools, project architecture rules, and integrating workflows via the Makefile in WPT-Gen.
// Instructions on managing dependencies, build tools, project architecture rules, and integrating workflows via the Makefile in WPT-Gen.
Instructions to manually test the generate workflow of WPT-Gen to verify system integrity.
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.
Best practices for CLI infrastructure, outputs, subprocess management, and templating in WPT-Gen.
Best practices for configuring LLM integrations, concurrent networking, context scraping, and managing prompts in WPT-Gen.
Guidelines for Python testing using pytest, including coverage constraints, mock migrations, type safety (mypy), and style linting (ruff) in WPT-Gen.
Guidelines for finalizing changes, running presubmit checks, and preparing for submission in WPT-Gen.
| name | wpt-gen-maintenance |
| description | Instructions on managing dependencies, build tools, project architecture rules, and integrating workflows via the Makefile in WPT-Gen. |
This document outlines standard maintenance procedures, core architectural constraints, and development workflow instructions for the wpt-gen repository.
WPT-Gen uses standard Python packaging tools managed via pyproject.toml.
google-genai, typer) are listed under [project.dependencies].pytest, ruff, mypy) are listed under [project.optional-dependencies].pip install -e ".[dev]". This is conveniently wrapped in make install.The Makefile serves as the primary entry point for all development tasks, ensuring consistency across environments.
make lint-fix: Runs ruff to automatically format code and apply safe fixes. You should run this frequently while coding.make typecheck: Runs mypy against the main package and the tests folder. Ensure zero errors remain.make test: Executes the pytest suite.make check: Run this to quickly execute linting, typechecking, and testing in sequence locally.Before pushing any code or opening a pull request, you MUST run:
make presubmit
This command runs lint-fix, typecheck, and test. If this pipeline fails, your code will fail Continuous Integration.
When authoring or reviewing structural code for WPT-Gen, you MUST strictly adhere to these foundational constraints:
'chrome', 'canary', 'gemini') for business logic routing or configurations. You must define explicit Python Enum classes. For grouping configurations, prefer the use of explicit @dataclass objects over sprawling dictionaries or tuples.# type: ignore comments is strictly banned without an accompanying inline comment providing technical justification for the upstream stub failure.wpt_root or output_dir). You must strictly validate paths before execution using path.resolve().relative_to(wpt_root) to prevent catastrophic ../ traversal sandbox escapes. Reviewers must actively search for read_text or write_text calls that lack preceding .relative_to() constraints.Every file containing source code must include the standard Apache 2.0 copyright and license information header.
Copyright 2026 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Ensure this is present at the top of any newly created .py, .js, .html, or .yml files.
To avoid stale cache issues (especially with pytest or mypy):
make clean: Deletes .pytest_cache, .mypy_cache, .ruff_cache, and all __pycache__ directories. Use this if you encounter strange behavior after branch switches or dependency updates.