/infrahub:infrahub-importing-data [csv-file-or-folder] [more-paths...]from infrahub
Converts CSV/TSV files into Infrahub object YAML and loads them onto a fresh branch. Handles single files, folders, explicit paths, and denormalized sheets. Read-only against the schema; fails closed on unmapped columns.
Ships in infrahub. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Expert guidance for turning user-provided CSV or TSV
inputs — a single file, a folder of files, or any
combination — into Infrahub object YAML that
infrahubctl object load accepts. The skill is the
bridge between "I have a spreadsheet" and "the
objects exist on a reviewable branch."
The skill is strictly a consumer of the live
schema. If a CSV column has no schema home, it
stops, lists the offending columns, and routes the
user to infrahub-managing-schemas to make the
schema decision separately. It never proposes
attribute additions, dropdown choices, or any other
schema edit, and it never writes directly to the
default branch.
Before converting anything, look at the project with read-only tools. List at most 10 matches per search, so a large tree does not fill the context:
.yml or .yaml files under a
schemas/ directory, or with schema in the name..yml files under an
objects/ directory..infrahub.yml up to two directory levels
deep..csv and .tsv inputs up to three
directory levels deep.If invoked with arguments (e.g.,
/infrahub:importing-data inventory.csv), treat the
first argument as the input file or folder; treat
remaining arguments as additional paths to include.
Status: Active) and you need to
emit the choice name (e.g., active).eth0..eth47) appear in
sequence and you want range-collapsed emission.infrahubctl dump. Use infrahubctl load; it reads a
different format and is the wrong tool for CSV.
Both are top-level commands; there is no
import or export command group. The skills
disambiguate so you don't conflate them.infrahub-managing-schemas.infrahubctl object get -o csv; a future
companion skill will cover multi-kind export.| Priority | Category | Prefix | Description |
|---|---|---|---|
| CRITICAL | Workflow | workflow- | Schema introspection, profile-sample, fail-closed gate, up-front interview, self-check, pre-flight closure, branch-first, validate-error mapping |
| HIGH | Inputs | inputs- | File / folder / list normalization, CSV dialect detection, same-kind merge |
| CRITICAL | Mapping | mapping- | Column → attribute, value coercion, empty/null handling, dropdown label → name, reference HFID detection |
| HIGH | Decomposition | decomposition- | Splitting a denormalized CSV across kinds |
| MEDIUM | Range | range- | Interface-shape detection and collapse |
| LOW | Lineage | lineage- | Optional source/owner stamping at import time |
| LOW | Outputs | outputs- | File-level shape concerns (provenance comment) |
The skill emits object YAML that conforms to the target schema's actual shape. If the schema is missing a feature the CSV requires, the load fails — which is why the skill checks these upfront and escalates rather than silently working around them.
| If the CSV has... | The schema must... | See |
|---|---|---|
| A reference column pointing to another kind | Define human_friendly_id on the target node; the HFID length determines scalar vs list reference shape | ../infrahub-managing-schemas/rules/display-human-friendly-id.md |
A label-style value for a Dropdown column (Active rather than active) | Declare the dropdown choices as objects with both name and label; the emitter writes the name and reads label from the schema | ../infrahub-managing-schemas/rules/attribute-defaults-and-types.md |
| Repeated parent rows with per-child columns | Pair Component (parent) and Parent (child) relationships with the same identifier, and optional: false on the child side | ../infrahub-managing-schemas/rules/relationship-component-parent.md |
| A column with no obvious schema home | Be extended via infrahub-managing-schemas — this skill fails closed and hands off | ../infrahub-managing-schemas/SKILL.md |
If any of these is missing for the data the user wants to load, that's a schema migration, not an import fix. The skill stops and says so.
Follow these 14 steps in order. The numbering is load-bearing — earlier steps gate later ones.
Normalize input to a flat file list. Accept a
single path, a directory (recursive scan for
*.csv / *.tsv), or a list, and resolve to a
flat list before profiling. For each file, detect
the CSV dialect (delimiter, encoding, BOM, line
endings) before reading rows. Read
rules/inputs-file-folder-list.md
and
rules/inputs-csv-dialect.md.
Discover the schema — read-only. Try sources in priority order and stop at the first one that returns the kinds the CSV needs:
infrahub-analyzing-data uses; sees deployed
state including branch-specific dropdown
choices and HFIDs.infrahubctl schema export --branch <name> —
CLI export against the configured server when
MCP is not connected./api/schema?branch=<name> REST endpoint —
direct HTTP fetch when infrahubctl is
unavailable or pointing at a different server.schemas/*.yml in the repo — last
resort; may lag the deployed state, so the
step 11 server validate is required to catch
divergence.Record which source you used so the user knows how authoritative the mapping is. Never propose a schema edit. Read rules/workflow-introspect-first.md.
Profile each file. Read header + sample rows (default 20; more if needed for dropdown, range, or denormalization detection). Note column data shapes, per-column distinct value counts, sample values, and sequence patterns. Read rules/workflow-profile-sample.md.
Build a mapping draft per file using the heuristics in reference.md:
(GB), (MHz))
— anything past that defers to the interview.
Read rules/mapping-column-to-attribute.md.optional and default_value
declarations. Read
rules/mapping-empty-and-null.md.Fail-closed gate. If any column has no
schema home, stop. Emit a structured report
listing the unmapped columns and the kinds you
checked, point the user at
infrahub-managing-schemas, and exit. No
partial writes. Read
rules/workflow-fail-closed-on-unmapped-columns.md.
Up-front interview. Batch every remaining ambiguity into one round of multi-choice questions before any file is written. Read rules/workflow-up-front-interview.md.
Confirm and lock the mapping. Echo back the complete plan (target files, kinds, column bindings, branch name, lineage opt-in) before the first file is written.
Emit object YAML to a local working
directory (default ./output_dir/). Each file
conforms to the managing-objects envelope:
apiVersion: infrahub.app/v1, kind: Object,
spec.kind, spec.data. Files are numbered for
load order (NN_<kind-plural>.yml). Each file
carries a leading provenance comment naming the
source CSV(s) + sha256 + emission timestamp.
Cross-reference the format rules in
../infrahub-managing-objects/rules/format-structure.md,
the file naming convention in
../infrahub-managing-objects/rules/organization-load-order.md,
and the comment shape in
rules/outputs-provenance-comment.md.
Self-check against managing-objects. Re-read the listed managing-objects rules and walk the emission against each one. Local only — no CLI, no server, no branch. Fix in place before moving on. Read rules/workflow-self-check-against-managing-objects.md.
Pre-flight reference closure. Walk every relationship reference in the emission and verify the target resolves either to a row in an upstream file or to a live object the introspection captured. Orphan references fail closed before any branch is touched. Read rules/workflow-pre-flight-closure.md.
Create the branch. Only after the
self-check and pre-flight closure pass, run
infrahubctl branch create <name> (default
csv-import-YYYYMMDD-HHMM, user-overridable in
the interview). Doing this last keeps
throwaway branches out of the branch list. Read
rules/workflow-branch-before-load.md.
Server validate on the branch:
infrahubctl object validate ./output_dir/ --branch <name>. Catches schema-resolution
errors the local checks can't (kind not in
schema, attribute name miss, reference target
missing). On error, translate the diagnostic
back to the source CSV cell and ask the user
to fix the input — don't hand-edit the emitted
YAML. Read
rules/workflow-validate-error-mapping.md.
Load on the branch: infrahubctl object load ./output_dir/ --branch <name>. Object
load is not transactional across files — if
file 17 of 20 fails, files 1–16 are already on
the branch. The branch-first design means you
discard the branch and re-run with a fresh
branch name; you never clean up partial state
by hand.
Hand off. Tell the user the branch is ready for review, the validate/load commands that were run, and how to open a proposed change in the UI. Don't auto-merge.
source is lineage
only; locking needs owner + is_protected)infrahubctl info before any server-dependent command in the
workflowuv run / poetry run) for all infrahubctl
invocationsdocs.infrahub.app
on a genuine gap (e.g. deleting nodes)examples.md (opens in a new tab)reference.md (opens in a new tab)rules/_sections.md (opens in a new tab)rules/_template.md (opens in a new tab)rules/decomposition-denormalized-csv.md (opens in a new tab)rules/inputs-csv-dialect.md (opens in a new tab)rules/inputs-file-folder-list.md (opens in a new tab)rules/inputs-merge-same-kind.md (opens in a new tab)rules/lineage-on-import.md (opens in a new tab)rules/mapping-column-to-attribute.md (opens in a new tab)rules/mapping-dropdown-label-to-name.md (opens in a new tab)rules/mapping-empty-and-null.md (opens in a new tab)rules/mapping-reference-and-hfid.md (opens in a new tab)rules/mapping-value-coercion.md (opens in a new tab)rules/outputs-provenance-comment.md (opens in a new tab)rules/range-detection.md (opens in a new tab)rules/workflow-branch-before-load.md (opens in a new tab)rules/workflow-fail-closed-on-unmapped-columns.md (opens in a new tab)rules/workflow-introspect-first.md (opens in a new tab)rules/workflow-pre-flight-closure.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
csv-import, tsv-import, infrahub, data-ingestion, yaml-generation
infrahub@opsmill is listed by opsmill/claude-marketplace — review the source before installing
npx claudepluginhub opsmill/claude-marketplace --plugin infrahub18 skills in this plugin
/infrahub-analyzing-dataAnalyzes and correlates live Infrahub data via the MCP server — answers operational questions, detects drift, and investigates impact. TRIGGER when: querying infrastructure data, checking compliance, investigating change impact, producing ad-hoc reports. DO NOT TRIGGER when: writing automated checks, building transforms, designing schemas, populating data files, planning an Infrahub version upgrade (use infrahub-planning-upgrades). ALWAYS pass the user's question verbatim as args — this skill runs in a forked context and cannot see the parent conversation. Invoking without args will fail./infrahub-analyzing-diagnosticsAnalyze an already-collected infrahub-collect diagnostic bundle — traceback and failure triage across service logs, incident correlation, and known-issue matching against opsmill/infrahub GitHub issues. TRIGGER when: the user says they collected a diagnostic bundle, gives you a bundle path, or pastes bundle contents — and asks what's wrong, wants the logs or tracebacks analyzed, asks "what does this bundle say", wants errors triaged/correlated, or asks whether a crash is a known issue. DO NOT TRIGGER when: no bundle exists yet — collect one first (use infrahub-collecting-diagnostics), filing the issue itself (use infrahub-reporting-issues), or querying live data (use infrahub-analyzing-data).Other plugins' skills for the same job