v2.1/skills/v2.1-pyright-heal/SKILL.md
# Skill: /v2.1-pyright-heal **Purpose**: Universal Python type checker and self-healing fixer for ANY Python file ## Input - **Required**: Path to Python file (`.py` or `.ipynb`) - **Optional**: `--max-iterations N` - Maximum fix attempts (default: 10) - **Optional**: `--strict` - Use strict type checking mode ## Output - **Modified File**: Same file, edited in-place - **Exit Code**: 0 if clean, 1 if max iterations reached with errors - **Log**: Summary of fixes applied ## Implementation ##
npx skillsauth add ruclo/thesis v2.1/skills/v2.1-pyright-healInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Purpose: Universal Python type checker and self-healing fixer for ANY Python file
.py or .ipynb)--max-iterations N - Maximum fix attempts (default: 10)--strict - Use strict type checking mode1. RUN pyright on file
2. IF pyright returns 0 errors:
RETURN success
3. ELSE:
a. PARSE error output
b. FOR each error:
- READ source file at error location
- ANALYZE root cause
- DETERMINE fix strategy
- APPLY fix via Edit tool
c. INCREMENT iteration counter
d. IF iteration > max_iterations:
RETURN failure with error report
e. GOTO step 1 (re-run pyright)
Error: "VirtualMachine" has no attribute "reset"
Fix Strategy:
1. READ actual class definition
2. FIND correct attribute name
3. UPDATE code to use correct attribute
Error: Cannot find module "ocp_resources.vm"
Fix Strategy:
1. SEARCH for correct module path
2. UPDATE import statement
3. If not found, REMOVE import and find alternative
Error: Expected "str", got "int"
Fix Strategy:
1. ANALYZE context
2. ADD type conversion OR
3. UPDATE type annotation
Error: "foo" is not defined
Fix Strategy:
1. SEARCH for variable definition
2. ADD missing import OR
3. DEFINE variable locally
Error: Too many arguments for "method"
Fix Strategy:
1. READ actual method signature
2. ADJUST arguments to match
3. UPDATE keyword args if needed
iteration = 0
max_iterations = args.max_iterations ?? 10
while iteration < max_iterations:
# Run pyright
result = bash(f"uv run pyright {file_path}")
if "0 errors" in result:
log(f"✓ Pyright clean after {iteration} iterations")
return SUCCESS
# Parse errors
errors = parse_pyright_output(result)
for error in errors:
# Read context around error
file_content = read_file(file_path,
offset=error.line - 5,
limit=10)
# Determine fix
fix = analyze_and_generate_fix(error, file_content)
# Apply fix
edit_file(file_path,
old_string=error.context,
new_string=fix.new_code)
log(f" Fix {iteration}.{error.id}: {fix.description}")
iteration++
log(f"✗ Failed to heal after {max_iterations} iterations")
return FAILURE
# type: ignore commentsAny types unless necessary# Standard usage
/v2.1-pyright-heal tests/test_new_feature.py
# With max iterations limit
/v2.1-pyright-heal utilities/helper.py --max-iterations 5
# Strict mode
/v2.1-pyright-heal conftest.py --strict
# Works on ANY Python file!
/v2.1-pyright-heal scripts/automation.py
/v2.1-pyright-heal fixtures/base_fixtures.py
/v2.1-pyright-heal utilities/custom_helper.py
VERY HIGH - Universal Python fixer:
.py in the repositoryThis skill is completely generic and useful beyond just test generation!
uv run pyright must be available in environmentdevelopment
# Skill: /v3-test-heal **Purpose**: Self-healing loop that runs the generated test against a real cluster, analyzes failures from logs, consults documentation and repository code to fix issues, and records lessons learned in GRAVEYARD.md ## Input - **Required**: Path to the generated test file (e.g., `tests/virt/cluster/test_vnc_screenshot.py`) - **Optional**: `--max-iterations N` - Maximum heal attempts (default: 3) ## Output - **Modified File**: Test file edited in-place with fixes applied
development
# Skill: /v3-pyright-heal **Purpose**: Universal Python type checker and self-healing fixer for ANY Python file ## Input - **Required**: Path to Python file (`.py` or `.ipynb`) - **Optional**: `--max-iterations N` - Maximum fix attempts (default: 10) - **Optional**: `--strict` - Use strict type checking mode ## Output - **Modified File**: Same file, edited in-place - **Exit Code**: 0 if clean, 1 if max iterations reached with errors - **Log**: Summary of fixes applied ## Implementation ###
development
# Skill: /v3-graveyard-verify **Purpose**: Post-generation verification that cross-references the generated test code against GRAVEYARD.md to catch known mistakes before runtime ## Input - **Required**: Path to the generated test file ## Output - **Modified File**: Test file edited in-place with fixes for any GRAVEYARD violations found - **Report**: Summary of violations found and fixes applied (conversational output) ## Role You are a **code reviewer specializing in catching known mistakes*
development
# Skill: /v3-generate-std > _This document was created with the assistance of Claude (Anthropic)._ You are a Senior QE Engineer responsible for creating Software Test Descriptions (STDs) for OpenShift Virtualization. Given a high-level Software Test Plan (STP), generate test code stubs with comprehensive docstrings that serve as the STD. **Important:** The generated test code should follow the structure and patterns from the [openshift-virtualization-tests](https://github.com/RedHatQE/openshi