v2.1/skills/v2.1-generate-pytest/SKILL.md
# Skill: /v2.1-generate-pytest **Purpose**: Generate executable pytest code from Software Test Description (STD) using repository context ## Input - **Required**: Path to STD markdown file - **Prerequisite**: Repository context should be explored using `/v2.1-explore-test-context` first - **Optional**: `--output-dir` - target directory (default: infer from repository conventions) ## Output - **File**: `test_<feature_name>.py` - **Location**: Determined by repository conventions (e.g., `tests/
npx skillsauth add ruclo/thesis v2.1/skills/v2.1-generate-pytestInstall 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: Generate executable pytest code from Software Test Description (STD) using repository context
/v2.1-explore-test-context first--output-dir - target directory (default: infer from repository conventions)test_<feature_name>.pytests/<domain>/<feature>/)Act as a Senior SDET. You will translate a Software Test Description (STD) into an executable Python test file using pytest.
You are currently in the root of the openshift-virtualization-tests repository.
You must follow this strict two-phase workflow:
Note: This assumes repository context has been explored via /v2.1-explore-test-context
Read STD file:
Map scenarios to test functions:
Identify required fixtures:
Plan imports:
Generate a single .py file implementing the scenarios from the STD.
# -*- coding: utf-8 -*-
"""
{feature_name} Tests
{brief_description}
Based on: {std_file}
"""
import logging
import pytest
# Imports from repository exploration
{discovered_imports}
LOGGER = logging.getLogger(__name__)
{fixture_definitions_if_needed}
@pytest.mark.polarion("{polarion_id}")
@pytest.mark.{tier}
def test_{scenario_name}({fixtures}):
"""
{scenario_description}
Steps:
{test_steps}
Expected:
{expected_outcome}
"""
LOGGER.info(f"Starting test: {scenario_name}")
# Preconditions
{precondition_code}
# Test execution
{test_code}
# Validation
{assertion_code}
# Cleanup (if needed)
{cleanup_code}
/v2.1-explore-test-context# Standard usage
/v2.1-generate-pytest std_vm_reset.md
# Custom output directory
/v2.1-generate-pytest std_feature.md --output-dir tests/custom/
# Output: tests/virt/lifecycle/test_vm_reset.py
If STD is malformed:
ERROR: Could not parse STD file
HINT: Ensure STD follows expected structure
If utility is missing from repository:
WARNING: Utility 'FooHelper' not found in repository
ACTION: Implementing locally using base Kubernetes client
Medium - Can be used for generating pytest tests from any STD in this repository
development
# 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