python-foundational

Reviews Python diffs against foundational coding standards, idioms, and design principles.

1.4k|284|Updated Nov 2, 2025
One-click install
npx skills add https://github.com/microsoft/hve-core --skill python-foundational
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-foundational
Source: https://github.com/microsoft/hve-core/tree/main/.github/skills/coding-standards/python-foundational
Command: npx skills add https://github.com/microsoft/hve-core --skill python-foundational

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Python code reviews often miss foundational issues like mutable defaults, bare except clauses, missing type hints, and duplicated logic. This Skill gives an AI reviewer a consistent, actionable checklist so every Python diff is evaluated against the same baseline of readability, type safety, error handling, and design principles.

Core Features & Use Cases

  • Nine-section review checklist: Covers naming and style, Pythonic idioms, function and class design, type safety, error handling, anti-patterns, maintainability, architectural fit, and design principles.
  • Severity rubric: Classifies findings as High, Medium, or Low based on runtime impact versus maintainability concerns, keeping review feedback calibrated.
  • Reference examples: Provides before/after code patterns for keyword-only arguments, dataclasses, docstrings, custom exception hierarchies, DRY refactors, and proportionate design.
  • Use Case: When a pull request modifies .py files, the review agent loads this Skill to flag issues such as a bare except: block, a missing return type hint, or duplicated validation logic, each with a severity rating.

Quick Start

Ask the review agent to review the Python changes in this pull request using the foundational coding standards checklist.

Frequently Asked Questions about python-foundational

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

FAQPage Schema
How do I enforce Python coding standards in automated code reviews?

Load a checklist-based skill that the review agent applies to every Python diff. This Skill provides nine sections covering naming, idioms, type hints, error handling, and design principles, each with single actionable checks a reviewer or agent can apply.

What Python anti-patterns should code reviews catch?

Key anti-patterns include mutable default arguments, bare except clauses, eval or exec on untrusted data, hard-coded secrets, and print-based logging. Reviews should also flag missing type hints on public APIs and duplicated logic that should be extracted into shared helpers.

When is this Python standards skill loaded during a review?

The agent loads it only when the diff contains .py files, matching changed file types against skill descriptions. This keeps the context window small when a change contains no Python code.

Why does the review produce no findings for my Python diff?

First confirm the Skills Loaded footer lists python-foundational. If it is listed but no findings appear, the diff likely already satisfies the checklist; if it is missing, verify the change actually includes .py files.

How are severity levels assigned to Python review findings?

Severity follows a rubric: High means runtime impact such as incorrect behavior or security exposure, Medium means maintainability or convention violations without runtime impact, and Low means cosmetic or minor improvements.