npx skills add ...
npx skills add microsoft/hve-core --skill python-foundational
npx skills add microsoft/hve-core --skill python-foundational
Foundational Python best practices, idioms, and code quality fundamentals
Foundational Python excellence that every diff must satisfy. This skill is loaded first for any .py change. All higher-order skills build on it.
This content is a skill rather than an instructions file for three reasons: skills are distributed through the CLI plugin and VS Code extension without requiring consumers to copy files into their repo; new language skills can be added without modifying the review agent itself; and skills are loaded on demand, keeping the context window small when the diff contains no Python.
PascalCase classes, snake_case functions/variables, UPPER_SNAKE_CASE constants, _ private members.with for files, locks, DB connections.dataclass / NamedTuple / Enum for data holders.pathlib over os.path; timezone-aware datetime when relevant.* keyword-only arguments for multi-optional functions.global/nonlocal unless strictly required.TypeVar for generics.Any except in thin wrappers.except: (broad except Exception: only at app boundaries with logging).eval, exec, or pickle on untrusted data.print.| File | Covers | Purpose |
|---|---|---|
| design-principles.md | Section 9 | Rationale and examples for the design principles |
| code-style-patterns.md | Sections 1–5 | Concrete code examples for style, idioms, type safety, class design, and error handling |
| Severity | Definition |
|---|---|
| High | Causes incorrect behavior, data loss, or security exposure at runtime |
| Medium | Degrades maintainability, readability, or violates a project convention with no immediate runtime impact |
| Low | Cosmetic, stylistic, or minor improvement opportunity |
| Symptom | Check |
|---|---|
| Skill not loaded | Confirm the diff contains .py files. The agent selects skills by matching file types in the changed files against skill descriptions. |
| No findings generated | Verify the Skills Loaded footer in the review output lists python-foundational. If listed but no findings appear, the diff may already satisfy the checklist. |
| Severity seems miscalibrated | Compare against the Severity Rubric above. High requires runtime impact; medium is maintainability-only. |
Follow these conventions when extending this skill:
references/ and provide examples or rationale for the covered checklist items. Each reference file covers a contiguous range of sections. Update the References table when adding a new file.async-patterns.md). Include a frontmatter description that states which sections the file supports. Add a row to the References table in SKILL.md.