python-quality-testing

Add type annotations, contract docstrings, Hypothesis tests, and mutmut mutation testing to Python ML code.

17|3|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/jayll1303/AIEKit --skill python-quality-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-quality-testing
Source: https://github.com/jayll1303/AIEKit/tree/main/.kiro/skills/python-quality-testing
Command: npx skills add https://github.com/jayll1303/AIEKit --skill python-quality-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Reduce brittle behavior, silent failures, and insufficient test coverage in Python ML and data-processing code by improving type safety, error handling, and test strength. Provide structured guidance to catch edge cases, surface untested logic, and make error modes actionable before deployment.

Core Features & Use Cases

  • Type annotation checklist and advanced typing patterns to tighten public APIs and preserve type information.
  • Contract docstring templates and exception-audit checklist to document pre/postconditions and harden error handling.
  • Property-based testing patterns and Hypothesis strategy recipes for tensors, DataFrames, and nested configs.
  • Mutation testing with mutmut including configuration, result interpretation, and CI integration to assess test suite strength.
  • Ruff configuration guidance tailored for ML projects and pre-mortem prompts to discover fragility in pipelines.
  • Use Case: Add Hypothesis tests and mutmut to a data-preprocessing pipeline to detect NaNs, shape errors, and logic gaps that unit tests miss.

Quick Start

Add Hypothesis property tests using the provided strategies, run mutmut to collect surviving mutants, and apply the exception audit checklist and contract docstrings to fix the highest-priority gaps.

Frequently Asked Questions about python-quality-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add Hypothesis property-based tests for pandas DataFrames and tensors?

Hypothesis property-based tests use generated data strategies to automatically probe edge cases like shape errors and NaNs. This approach provides custom strategy recipes for tensors, DataFrames, and nested configs to catch silent failures that standard unit tests miss.

What is mutation testing with mutmut and how does it measure test suite strength?

Mutation testing with mutmut deliberately alters code to see if existing tests fail. It measures the mutation kill rate to surface untested logic, providing configuration, result interpretation, and CI integration to assess and improve overall test robustness.

How do I audit try-except blocks and write contract docstrings for Python pipelines?

Auditing try-except blocks requires an exception-audit checklist to harden error handling, while contract docstring templates document preconditions and postconditions. This combination surfaces silent failures and makes error modes actionable before deployment.

Does this Python quality testing approach work for ML and data-processing codebases?

Yes, this approach specifically targets ML and data-processing codebases by applying type annotations, advanced typing patterns, and tailored ruff configuration rules. It addresses pipeline fragility through pre-mortem prompts and structured code quality checks.

What is the best way to tighten public APIs with type annotations in Python?

Tightening public APIs involves applying a type annotation checklist and advanced typing patterns to preserve type information across functions. This reduces brittle behavior by ensuring type safety and clarifying expected inputs and outputs.

Why should I use property-based testing instead of standard unit tests for data preprocessing?

Property-based testing generates hundreds of input variations automatically, detecting edge cases like NaNs and shape errors that manually written unit tests miss. It strengthens test robustness by verifying code properties hold across wide data ranges.