python-code-quality

Analyze Python code with AST-based checks for docstrings, type hints, naming, and anti-patterns.

Updated Jul 22, 2025
One-click install
npx skills add https://github.com/Friend09/copilot_practice_material --skill python-code-quality-friend09
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-code-quality
Source: https://github.com/Friend09/copilot_practice_material/tree/main/practice/advanced/13_agent_skills/exercises/create_skill
Command: npx skills add https://github.com/Friend09/copilot_practice_material --skill python-code-quality-friend09

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill helps developers ensure Python code quality by automatically detecting missing documentation, absent type hints, non-idiomatic naming, and common anti-patterns across codebases.

Core Features & Use Cases

  • Docstring validation for public functions and classes to improve maintainability.
  • Type hint enforcement for parameters and return values to improve type safety.
  • Naming convention checks to promote consistent style across projects.
  • Anti-pattern detection to surface mutable defaults, bare except clauses, and other pitfalls.
  • Use Case: Run as part of CI to fail builds on critical issues or as a pre-commit check to clean code before commits.

Quick Start

Run python check_quality.py <path> to generate a code quality report.

Frequently Asked Questions about python-code-quality

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

FAQPage Schema
How do I check Python code for missing docstrings and type hints?

To check Python code for missing docstrings and type hints, run the static analysis script against your module path. It applies AST-based checks to detect absent documentation and enforce type safety, reporting findings in a structured summary.

What is the best way to automate Python code quality reviews in CI?

Automating Python code quality reviews in CI involves running an analysis script that detects naming convention violations and anti-patterns. You can configure the pipeline to fail builds when the structured summary reports critical severity issues.

Can I use AST-based checks to find mutable default arguments and bare except clauses?

Yes, AST-based checks can find mutable default arguments and bare except clauses. The static analysis detects these common Python anti-patterns by traversing the abstract syntax tree of your modules and flagging them in the report.

Does Python code quality analysis require any external dependencies or linters?

Python code quality analysis using this approach requires no external dependencies or linters. It leverages AST-based checks implemented entirely within an included standalone script to validate your code and generate severity reports.

How do I enforce naming conventions across multiple Python projects?

To enforce naming conventions across multiple Python projects, apply a static analysis script to each project directory. It checks for non-idiomatic naming and outputs a structured summary with severity levels for any violations found.