用途:该技能用于将某个 Python recipe 的 pyproject.toml(以及在描述不一致时的 manifest.yaml description)对齐到仓库标准。适用范围仅限 pyproject.toml;独立的 ruff.toml 由 CI 检查,不在本技能范围。不处理 ADK 主版本升级问题。
主要能力:运行 scripts/align_pyproject.py,按八条规则检查:no-local-ruff-config(禁止 recipe 内 [tool.ruff*])、python-version-floor(requires-python 必须精确接受 Python 3.11)、project-name-matches-folder(项目名须匹配目录或 skills 下的 <vertical>-<solution>)、description-matches-manifest(描述需与 manifest 一致)、build-system-present(需有 requires 与 build-backend)、default-pypi-index(需配置默认公共 PyPI 索引)、stale-python-version-refs(检查低于 3.11 的 Python 版本引用)、runnability-test-in-testpaths(testpaths 须包含 tests/test_runnability.py)。前四条可自动修复,build-system 与部分索引、版本引用、testpaths 仅报告。
使用方式:先以 --dry-run 只读报告,确认后省略该参数执行应用;描述冲突时用 --description-source={pyproject,manifest,delete} 解决。命令示例:uv run --no-project --with tomlkit --with 'ruamel.yaml' --with packaging python .agents/skills/align-recipe-pyproject/scripts/align_pyproject.py --recipe-dir <RECIPE_DIR> --dry-run。
限制:不得手工编辑,须用脚本;编辑经 tomlkit/ruamel.yaml 保留注释;仅修改 recipe 目录内文件;构建后端选择、非 PyPI 默认索引、过期版本引用需人工确认;不自动提交变更。