원클릭으로
infrahub-generator-creator
// Create and manage Infrahub Generators. Use when building design-driven automation that creates infrastructure objects from templates, topology definitions, or any design-to-implementation workflow in Infrahub.
// Create and manage Infrahub Generators. Use when building design-driven automation that creates infrastructure objects from templates, topology definitions, or any design-to-implementation workflow in Infrahub.
Shared references and cross-cutting rules used by all Infrahub skills. Contains GraphQL query syntax, .infrahub.yml configuration format, and common rules for git integration, display label caching, and Python environment setup. DO NOT TRIGGER directly — loaded automatically by other Infrahub skills when they need shared references.
Audit an Infrahub repository against all best practices and rules. Use when reviewing a project for compliance, onboarding to an existing repo, or before deployment to catch issues early.
Analyze and correlate Infrahub data using the MCP server. Use when querying live infrastructure data to answer operational questions, detect drift, correlate node types, investigate service impact, check maintenance windows, or produce ad-hoc reports — without writing pipeline code.
Create and manage Infrahub check definitions. Use when writing validation logic, creating Python checks that run in proposed change pipelines, or building data quality guards for Infrahub.
Create and manage Infrahub custom menus. Use when designing navigation menus, organizing node types in the UI, or customizing the Infrahub web interface sidebar.
Create and manage Infrahub object data files. Use when populating infrastructure data, creating device instances, locations, organizations, module installations, or any other data objects for an Infrahub repository.
| name | infrahub-generator-creator |
| description | Create and manage Infrahub Generators. Use when building design-driven automation that creates infrastructure objects from templates, topology definitions, or any design-to-implementation workflow in Infrahub. |
| metadata | {"version":"1.1.0","author":"OpsMill"} |
Expert guidance for creating Infrahub Generators. Generators query data from Infrahub via GraphQL and create new nodes and relationships based on the result -- enabling design-driven automation where a "design" object automatically creates downstream infrastructure.
| Priority | Category | Prefix | Description |
|---|---|---|---|
| CRITICAL | Architecture | architecture- | Components, groups |
| CRITICAL | Python Class | python- | Generator, generate() |
| HIGH | Tracking | tracking- | Upsert, idempotent |
| HIGH | API Ref | api- | Constructor, props |
| HIGH | Registration | registration- | .infrahub.yml config |
| MEDIUM | Patterns | patterns- | Cleaning, batch, store |
| LOW | Testing | testing- | infrahubctl commands |
Every generator has three components:
.gql file) -- fetches the design dataInfrahubGenerator,
implements generate()from infrahub_sdk.generator import InfrahubGenerator
class MyGenerator(InfrahubGenerator):
async def generate(self, data: dict) -> None:
obj = await self.client.create(
kind="DcimDevice",
data={"name": "spine-01"},
)
await obj.save(allow_upsert=True)