From infrahub
Creates Infrahub Generators that query GraphQL for design data and automate infrastructure object creation with Python classes. For design-to-implementation workflows and topology-driven generation.
npx claudepluginhub opsmill/claude-marketplace --plugin infrahubThis skill is limited to using the following tools:
Expert guidance for creating Infrahub Generators. Generators
Creates and manages Infrahub YAML files for infrastructure objects like devices, locations, organizations, and modules. Use when populating data instances or defining hierarchies, not schemas or queries.
Generates GraphQL schema generator operations, configurations, and code for API development. Auto-activates on 'graphql schema generator' phrases or related queries.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Share bugs, ideas, or general feedback.
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.
Infrahub config:
!cat .infrahub.yml 2>/dev/null || echo "No .infrahub.yml found"
Existing generators:
!find . -name "*.py" -path "*/generators/*" 2>/dev/null | head -20
| 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)
Follow these steps when creating a generator:
.gql file
that fetches the design data. Read
../infrahub-common/graphql-queries.md
for query patterns.InfrahubGenerator, implement generate(). Read
rules/python-generate.md
for the class pattern and
rules/api-reference.md
for available methods.allow_upsert=True so
re-running creates or updates without duplicates.
See rules/tracking-idempotent.md.generator_definitions with the target group. See
rules/registration-config.md.infrahubctl generator to validate.
See rules/testing-commands.md.