Skip to main content

validate-and-fix

Run install sync, unit tests, and make verify; auto-fix trivial failures (ruff format/fix, obvious test expectation updates). Use when the user asks to validate, run tests, check the pipeline, or verify changes are clean.

来源信息

仓库
openshift/lightspeed-agentic-sandbox
最近来源活动
2026年5月19日 11:24
检测到的 SKILL.md 语言
英语
星标
5
Forks
23

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
validate-and-fix
description
Run install sync, unit tests, and make verify; auto-fix trivial failures (ruff format/fix, obvious test expectation updates). Use when the user asks to validate, run tests, check the pipeline, or verify changes are clean.
disable-model-invocation
true
# Validate & Auto-Fix Run the project validation pipeline, auto-fix trivial issues, and re-run until green or a real failure is found. ## Rules - Never modify production logic to fix a test. Only fix test expectations, imports, formatting, and lint. - Never skip or delete a failing test. - Stop after 3 auto-fix cycles to avoid loops. - Report real failures clearly; do not attempt speculative fixes. ## Step 0: Ensure Dependencies Are Installed ```bash make install-all ``` Use `make install` if the user only needs dev tooling without all provider extras. For most agent code paths, `install-all` matches CI-like coverage. ## Step 1: Run Unit Tests ```bash make test ``` If all pass, proceed to Step 3. If failures occur, classify each failure (see Step 2). ## Step 2: Classify and Fix Failures **Auto-fixable** (fix immediately, then re-run Step 1): | Type | Fix | |------|-----| | Missing `await` on async call | Add `await`, mark test `async def`, add `@pytest.mark.asyncio` | | Test asserts old default value | Update assertion to match new default | | Ruff format | `make format` | **Real failures** (do not auto-fix without user): - Logic errors in production code - Assertion failures reflecting unclear behavior changes - Import errors from missing optional extras (install with `make install-all`) ## Step 3: Run Verify ```bash make verify ``` This runs: `ruff format --check`, `ruff check`, `mypy` on `src/lightspeed_agentic`. If failures occur: | Type | Fix | |------|-----| | Format | `make format` | | Unused import (F401) | Remove the import | | Other ruff-fixable | `make format` (includes `ruff check --fix`) | Re-run `make verify` after each fix. ## Step 4: Report Report exactly: - `make test`: pass/fail (counts if useful) - `make verify`: pass/fail - Auto-fixes applied (file + what changed) - Cycles used: N/3 Do not include unrelated diagnostics.
在 GitHub 查看