infrahub-common

Provides shared GraphQL, configuration, and workflow references for Infrahub automation skills.

9|2|Updated Aug 27, 2025
One-click install
npx skills add https://github.com/opsmill/infrahub-solution-ai-dc --skill infrahub-common-opsmill
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: infrahub-common
Source: https://github.com/opsmill/infrahub-solution-ai-dc/tree/main/.agents/skills/infrahub-common
Command: npx skills add https://github.com/opsmill/infrahub-solution-ai-dc --skill infrahub-common-opsmill

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working with Infrahub requires precise knowledge of its GraphQL query conventions, the .infrahub.yml manifest format, value metadata semantics, and cross-cutting operational rules; this Skill centralizes that shared reference material so other Infrahub skills and engineers apply consistent, correct patterns instead of rediscovering them. ## Core Features & Use Cases - GraphQL Query Reference: Documents Infrahub's edges/node pagination pattern, attribute value nesting, relationship traversal, inline fragments for generics, filtering syntax, and the NoUnusedVariables validation rule. - .infrahub.yml Manifest Reference: Explains every section (schemas, queries, checks, transforms, generators, artifact definitions) with required fields, loading order, and a real-world example. - Cross-Cutting Rules: Covers branch-first data CRUD, git repository integration, protocol file regeneration, connectivity checks, display-label caching, partial sync recovery, and the YAML-driven testing framework. - Use Case: When writing a generator or check for Infrahub, consult this Skill to confirm the correct GraphQL query shape, the right .infrahub.yml fields, and the safe branch-based workflow before committing code. ## Quick Start Ask the AI to show the correct GraphQL query structure and .infrahub.yml configuration for a new Infrahub check definition.

Frequently Asked Questions about infrahub-common

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

FAQPage Schema
How do I write a GraphQL query for Infrahub?▼

Infrahub GraphQL queries follow the Relay-style edges/node pattern, with attributes nested under a value key and relationships using node (cardinality one) or edges/node (cardinality many). Store queries as .gql files and register them by name in the queries section of .infrahub.yml.

What is the .infrahub.yml file used for?▼

The .infrahub.yml file is the manifest connecting a git repository to Infrahub, declaring schemas, objects, GraphQL queries, check definitions, Python and Jinja2 transforms, artifact definitions, and generator definitions. Resources load in a fixed order starting with schemas.

Does setting source metadata on Infrahub data restrict who can edit it?▼

No, source is purely a lineage label recording where a value came from and has no access-control effect. To lock a value, set owner to the responsible group together with is_protected: true, which restricts edits to that owner and admins.

Why does my Infrahub query fail with an unused variable error?▼

Infrahub uses graphql-core, which enforces the NoUnusedVariables rule, so a declared variable like $device that is never referenced in the query body is rejected at validation time. Remove the variable declaration when converting a targeted query into a global one.

How do I migrate NetBox queries and data to Infrahub?▼

NetBox field names do not map one-to-one because Infrahub schemas are explicit and project-specific, so introspect the running schema with infrahubctl schema export or the /api/schema endpoint first. Common differences include status dropdowns instead of enabled booleans and hierarchical LocationGeneric instead of Region to Site chains.

Why are my uncommitted generator files invisible to Infrahub?▼

Infrahub clones the committed state of a registered git repository into the task-worker container, so uncommitted files in the working tree are never synced. Commit every referenced file, including .infrahub.yml, generators, checks, transforms, and queries, before registering the repository.