openspec-validate-code

Validates Python codebase quality and Home Assistant schema compliance using flake8, mypy, py_compile, and hass-config-check commands.

Updated May 29, 2026
One-click install
npx skills add https://github.com/yun-s-oh/ha-anker-solix-f2000 --skill openspec-validate-code
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: openspec-validate-code
Source: https://github.com/yun-s-oh/ha-anker-solix-f2000/tree/main/.agent/skills/openspec-validate-code
Command: npx skills add https://github.com/yun-s-oh/ha-anker-solix-f2000 --skill openspec-validate-code

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires flake8, mypy, py_compile, hass-config-check, and includes scripts (resource) components.

What problem does it solve?

This Skill automates the process of validating codebase quality, formatting, syntax, and type compliance, saving developers time and reducing the risk of deployment issues.

Core Features & Use Cases

  • PEP 8 Linting: Ensures code adheres to PEP 8 style guidelines.
  • Type Checking: Uses mypy to check for type errors.
  • Syntax Compilation: Validates Python code syntax.
  • Home Assistant Schema Validation: Checks custom component configuration.
  • Use Case: Ideal for running as a final step before committing code changes to ensure compliance with coding standards and integration requirements.

Quick Start

Run the code validation for the custom component directory 'custom_components/anker_solix_f2000'.

Frequently Asked Questions about openspec-validate-code

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

FAQPage Schema
How do I automate Python code quality validation for Home Assistant custom components?

Automate Python code quality validation by running flake8, mypy, py_compile, and hass-config-check together. This ensures your Home Assistant custom components adhere to PEP 8, maintain type safety, and pass schema validity checks before deployment.

How do I check PEP 8 compliance and type safety in a Python codebase?

Check PEP 8 compliance and type safety by executing flake8 for linting and mypy for type checking. This validates Python syntax and ensures adherence to coding standards without manual review.

Can I use hass-config-check to validate custom component configuration schemas?

Yes, you can use hass-config-check to validate Home Assistant custom component configuration schemas. It runs alongside flake8 and mypy to verify formatting, type compliance, and schema validity.

What is the best way to run pre-commit checks for Home Assistant Python development?

The best way to run pre-commit checks is executing a validation script that combines flake8, mypy, py_compile, and hass-config-check. This catches syntax errors, type issues, and schema problems before committing code changes.

Why does my Python custom component fail Home Assistant schema validation?

Python custom component schema validation fails when configurations do not meet integration requirements. Running hass-config-check identifies schema validity issues, while py_compile catches underlying syntax errors in the codebase.

Does mypy work with flake8 for validating Python code formatting and types?

Yes, mypy works with flake8 to validate Python code. mypy checks for type errors while flake8 enforces PEP 8 style guidelines, together ensuring comprehensive codebase quality and compliance.