From infrahub
Creates Infrahub check definitions with Python validation classes and GraphQL queries for proposed change pipelines. Useful for data quality guards and validation logic.
npx claudepluginhub opsmill/claude-marketplace --plugin infrahubThis skill is limited to using the following tools:
Expert guidance for creating Infrahub checks. Checks are
Audits Infrahub repositories against best practices and rules, validating project structure, schemas, objects, Python components, checks, generators, transforms, menus, and .infrahub.yml config. Use for compliance reviews, onboarding, pre-deployment checks.
Integrates GraphQL Inspector into GitHub Actions, GitLab CI, and pipelines for automated schema diffing, operation validation, breaking change detection, and PR comments.
Generates pre-deployment checklists for code quality, security, performance, infrastructure, database migrations, and produces go/no-go readiness report.
Share bugs, ideas, or general feedback.
Expert guidance for creating Infrahub checks. Checks are user-defined validation logic (Python + GraphQL) that run as part of a proposed change pipeline. If a check logs any errors, the proposed change cannot be merged.
Infrahub config:
!cat .infrahub.yml 2>/dev/null || echo "No .infrahub.yml found"
Existing checks:
!find . -name "*.py" -path "*/checks/*" 2>/dev/null | head -20
Existing queries:
!find . -name "*.gql" -path "*/queries/*" 2>/dev/null | head -20
| Priority | Category | Prefix | Description |
|---|---|---|---|
| CRITICAL | Architecture | architecture- | Three components, global vs targeted, execution flow |
| CRITICAL | Python Class | python- | InfrahubCheck base class, validate(), log_error/log_info |
| HIGH | API Reference | api- | Class attributes, instance properties, methods, lifecycle |
| HIGH | Registration | registration- | .infrahub.yml config, query name matching, parameters |
| MEDIUM | Patterns | patterns- | Error collection, shared utilities, scoped validation |
| LOW | Testing | testing- | infrahubctl check commands, branch testing |
Every check has three components:
.gql file) -- fetches the data to
validateInfrahubCheck,
implements validate().infrahub.yml under
check_definitionsfrom infrahub_sdk.checks import InfrahubCheck
class MyCheck(InfrahubCheck):
query = "my_query" # Must match query name
def validate(self, data: dict) -> None:
# Validation logic here
if something_is_wrong:
self.log_error(
message="Problem description"
)
Follow these steps when creating a check:
.gql file
that fetches the data to validate. Read
../infrahub-common/graphql-queries.md
for query patterns.InfrahubCheck, implement validate(). Read
rules/python-validate.md
for the class pattern and
rules/api-reference.md
for available methods.check_definitions. The query name must match the
Python class query attribute. See
rules/registration-config.md.infrahubctl check to validate. See
rules/testing-commands.md.