infrahub-importing-data

Converts CSV and TSV files into Infrahub object YAML and loads them onto a review branch.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Spreadsheet exports rarely match the shape of an infrastructure source of truth: columns mix multiple object kinds, dropdown cells carry display labels instead of choice names, and reference columns need to match the target schema's human-friendly ID. This Skill turns raw CSV/TSV inputs into schema-conformant Infrahub object YAML and loads them onto a fresh branch, failing closed whenever a column has no schema home instead of silently dropping data. ## Core Features & Use Cases - Schema-driven column mapping: Introspects the live Infrahub schema (via MCP, infrahubctl, REST, or local files) and maps columns to attributes using a strict heuristic ladder, translating dropdown labels to choice names and coercing Boolean, Number, DateTime, and JSON values. - Denormalized sheet decomposition: Splits one big spreadsheet conflating devices, sites, and manufacturers into numbered per-kind files with correct load order, or nests repeated child rows as inline component children. - Branch-first safe loading: Emits files with provenance comments, self-checks against object format rules, verifies reference closure, then creates a branch, validates, and loads — never writing to the default branch. - Use Case: A network engineer receives an inventory.csv listing devices with their sites and manufacturers. The Skill splits it into 01_manufacturers.yml, 02_sites.yml, and 03_devices.yml, resolves dropdown labels like "Active" to "active", and loads everything onto a csv-import branch ready for review. ## Quick Start Import the attached inventory.csv into Infrahub by converting it to object YAML and loading it onto a new branch.

Frequently Asked Questions about infrahub-importing-data

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

FAQPage Schema
How do I import a CSV file into Infrahub?▼

Provide the CSV path and the skill profiles the file, maps columns to schema attributes, emits numbered object YAML files, then runs infrahubctl object validate and object load on a new branch. The branch is left for you to review and merge through a proposed change.

How to import a denormalized spreadsheet with multiple object types into Infrahub?▼

The skill detects columns that are constant per row group and splits the sheet into separate numbered files per kind, so referenced kinds like manufacturers and sites load before devices. You confirm the split in an up-front interview before any file is written.

What happens when a CSV column has no matching Infrahub schema attribute?▼

The import stops with a fail-closed report listing the unmapped columns and the kinds checked, and no files are written. You either mark the column as skipped or extend the schema with the infrahub-managing-schemas skill first.

Does the CSV import support JSON or XLSX files?▼

No, version 1 covers CSV and TSV inputs only. JSON, XLSX, and Parquet inputs are rejected with a clear message, and LDJSON dumps from infrahubctl export should be loaded with infrahubctl import load instead.

Why does my Infrahub object load fail with an invalid dropdown choice error?▼

The loader accepts only the dropdown choice name, not its display label, so a cell like "Active" is rejected when the choice name is "active". The skill builds a label-to-name lookup from the schema and translates each cell before emission.

Is the CSV import into Infrahub transactional across files?▼

No, object load is not transactional across files, so a failure on file 17 of 20 leaves files 1-16 loaded on the branch. The branch-first design means you discard the branch and re-run with a fresh branch name rather than cleaning up partial state.