validate-and-fix

द्वारा openshift

Run the full validation pipeline (make test-unit, make verify, make test-integration) and auto-fix trivial failures like black formatting, unused imports, and…

npx skills add https://github.com/openshift/lightspeed-service --skill validate-and-fix

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

make install-deps 2>&1 | tail -10

This ensures the virtualenv matches the lockfile. Skipping this step is the most common cause of spurious import errors (e.g. llama-index-embeddings-huggingface not found despite being in requirements.txt).

Step 1: Run Unit Tests

make test-unit 2>&1 | tail -40

If all pass, proceed to Step 3 (integration tests). If failures occur, classify each failure (see Step 2).

Step 2: Classify and Fix Failures

For each failure, determine its type:

Auto-fixable (fix immediately, then re-run Step 1):

TypeFix
Missing await on async callAdd await, mark test async def, add @pytest.mark.asyncio
Test asserts old default valueUpdate assertion to match new default

Real failures (do not auto-fix):

  • Logic errors in production code
  • Assertion failures reflecting actual behavior changes
  • Import errors from missing dependencies
  • Failures in code you did not modify

For real failures: report the test name, file, and error summary, then stop.

Step 3: Run Integration Tests

make test-integration 2>&1 | tail -20

Integration test failures are almost always real failures. Report and stop.

Step 4: Run Verify

make verify 2>&1 | tail -30

This runs: black --check, ruff, woke, pylint, mypy.

If failures occur, apply the same classify-and-fix logic from Step 2. Common fixes at this stage:

TypeFix
Black formattinguv run black .
Unused import (ruff F401)Remove the import
Unused variable (ruff F841)Remove the assignment
Unused noqa directive (RUF100)Remove the noqa comment
Other ruff-fixableuv run ruff check . --fix
Pylint issues from changed codeFix inline

Re-run make verify after each fix. Proceed to Step 5 when green.

Step 5: Report

Report exactly:

  • make test-unit: X passed / Y failed
  • make verify: pass/fail (list any remaining issues)
  • make test-integration: X passed / Y failed
  • Auto-fixes applied (list each: file, what was fixed)
  • Cycles used: N/3

Do not include unrelated diagnostics or suggestions.

openshift की और Skills

openshift-expert
openshift
OpenShift प्लेटफ़ॉर्म और Kubernetes विशेषज्ञ जिसे क्लस्टर आर्किटेक्चर, ऑपरेटर, नेटवर्किंग, स्टोरेज, समस्या निवारण और CI/CD पाइपलाइनों का गहन ज्ञान है। उपयोग करें…
official
find-token
openshift
Find the hidden verification token. Run the find-token script to retrieve a unique token.
official
code-review
openshift
पुल रिक्वेस्ट की कोड गुणवत्ता, शुद्धता और प्रोजेक्ट कन्वेंशन के लिए समीक्षा करें। उपयोग तब करें जब उपयोगकर्ता PR की समीक्षा, कोड रिव्यू या बदलावों की जांच करने के लिए कहे...
official
css-review
openshift
सीएसएस को कोडिंग शैली, पैटर्नफ्लाई टोकन उपयोग और सर्वोत्तम प्रथाओं के लिए समीक्षा करें। जब उपयोगकर्ता सीएसएस की समीक्षा करने, शैलियों की जांच करने या सीएसएस फाइलों का ऑडिट करने के लिए कहे तब उपयोग करें।
official
review-readmes
openshift
रिपॉजिटरी में सभी README.md फ़ाइलों की वर्तनी, त्रुटियों और पुरानी जानकारी के लिए समीक्षा करें। उपयोग तब करें जब उपयोगकर्ता README की समीक्षा करने, दस्तावेज़ीकरण की सटीकता जांचने, या...
official
review-skills
openshift
प्रोजेक्ट AI स्किल्स में डुप्लिकेशन, पुराने संदर्भ, गलतियाँ और संरचनात्मक समस्याओं की समीक्षा करें। उपयोग तब करें जब उपयोगकर्ता स्किल्स की समीक्षा, ऑडिट, या जाँच करने के लिए कहे...
official
test
openshift
टैग द्वारा फ़िल्टर करके एंड-टू-एंड परीक्षण चलाएँ। इसका उपयोग तब करें जब उपयोगकर्ता परीक्षण चलाने, Playwright चलाने, या @core या @attach जैसे किसी विशिष्ट फीचर टैग का परीक्षण करने के लिए कहे।
official
unused-exports
openshift
उन निर्यातित प्रतीकों को खोजें जो कभी किसी अन्य फ़ाइल द्वारा आयात नहीं किए गए हैं। इसका उपयोग तब करें जब उपयोगकर्ता "check exports", "unused exports" कहे या निर्यात साफ करने के लिए कहे।
official