Overview
Expert guidance for interactive data analysis
against a live Infrahub instance. This skill uses
the Infrahub MCP server to query, correlate,
and reason over infrastructure data on demand —
answering operational questions that span multiple
node types and relationships.
Use this skill for any question of the form
"what does Infrahub currently know about X,
and how does it relate to Y?"
Typical question patterns:
- Compliance — "Are all devices following
the naming convention?"
- Service impact — "Which services are hosted
on devices in this rack?"
- Maintenance windows — "Which devices are
currently in a maintenance window, and what
depends on them?"
- Drift detection — "Which realized devices
differ from their topology design?"
- Capacity — "Which racks are over 80% full?"
- Change impact — "What BGP sessions, services,
and IPs depend on this prefix?"
- Inventory gaps — "Which devices have no
platform or OS version recorded?"
For automated, pipeline-enforced checks that
block proposed changes, see
../infrahub-managing-checks/SKILL.md.
For repeatable scheduled reports exported as
artifacts, see ../infrahub-managing-transforms/SKILL.md.
Project Context
This skill runs in a forked subagent context and has no visibility into the
parent conversation. The user's question MUST be passed via arguments.
If invoked with arguments (e.g., /infrahub:analyzing-data Which devices have no platform assigned?),
treat the arguments as the question to answer.
If invoked with no arguments, do not guess, do not use any example
question from this file, and do not proceed. Return immediately with:
Error: No question was passed to infrahub-analyzing-data. This skill
runs in a forked context and requires the user's question as args. Re-invoke
with the question, e.g.
Skill(skill="infrahub-analyzing-data", args="<the user's question>").
When to Use
- Answering operational questions interactively
via natural language
- Cross-referencing two or more node types to find
relationships or gaps
- Investigating the blast radius of a change before
executing it
- Auditing data quality across the inventory
- Producing one-time or on-demand reports for
stakeholders
- Exploring schema structure and data before writing
a generator or check
How It Works
The Infrahub MCP server exposes tools that let
Claude query Infrahub data directly.
The typical workflow:
- Query — use MCP tools to fetch current state
from Infrahub
- Correlate — join, diff, or filter the data
against a policy or second dataset
- Reason — identify gaps, anomalies, or
relationships
- Report — surface findings with context and
remediation hints
Rule Categories
| Priority |
Category |
Prefix |
Description |
| CRITICAL |
MCP Tools |
mcp- |
Available Infrahub MCP tools, invocation patterns, response structure |
| CRITICAL |
Query Patterns |
query- |
GraphQL structures for fetching, filtering, and traversing relationships |
| HIGH |
Correlation |
correlation- |
Joining, diffing, and reasoning over data from multiple queries |
| HIGH |
Reporting Output |
reporting- |
Presenting findings: summaries, tables, per-object detail, remediation hints |
| MEDIUM |
Approach Selection |
approach- |
When to use MCP analysis vs InfrahubCheck vs Transform |
MCP Server Basics
When the Infrahub MCP server (v1.1.7) is connected,
Claude can call these tools.
Read:
mcp__infrahub__get_nodes — List nodes of a
kind with filtering/pagination (preferred typed
read)
mcp__infrahub__search_nodes — Find nodes of
a kind by partial substring
mcp__infrahub__get_schema — Discover schema
kinds and their filters
mcp__infrahub__query_graphql — Execute a
read-only GraphQL query
mcp__infrahub__get_session_info — Report the
active session branch and instance address
Write (branch-isolated — land on an auto-created
mcp/session-* branch, never the default branch):
mcp__infrahub__node_upsert — Create or update
an object
mcp__infrahub__node_delete — Delete an object
mcp__infrahub__mutate_graphql — Run a GraphQL
mutation for complex writes
mcp__infrahub__propose_changes — Open a
Proposed Change for human review
mcp__infrahub__reset_session_branch — Reset or
switch the active session branch
Full per-tool signatures (parameters, examples,
response shapes) and the branch model are in
rules/mcp-tools.md — read
that before invoking any of these.
# Example: find all devices in an active
# maintenance window
query MaintenanceDevices {
MaintenanceWindow(status__value: "active") {
edges {
node {
name { value }
start_time { value }
end_time { value }
devices {
edges {
node {
name { value }
role { value }
site {
node { name { value } }
}
}
}
}
}
}
}
}
Typical Analysis Workflow
1. Understand the question
→ "Which services depend on devices currently
in a maintenance window?"
2. Identify the node types involved
→ MaintenanceWindow, DcimDevice, Service
(or equivalent in your schema)
3. Query current state
→ mcp__infrahub__get_nodes per kind (typed), or
mcp__infrahub__query_graphql — one query
per node type, or combined
4. Correlate the data
→ Join across node types, filter, count, diff
5. Report findings
→ Summarize with counts, list affected objects,
suggest next steps
Supporting References
1---2name: infrahub-analyzing-data-33description: >-4 Analyzes and correlates live Infrahub data via the MCP server — answers operational questions, detects drift, and investigates impact.5 TRIGGER when: querying infrastructure data, checking compliance, investigating change impact, producing ad-hoc reports.6 DO NOT TRIGGER when: writing automated checks, building transforms, designing schemas, populating data files.7 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.8context: fork9allowed-tools:10 - Read11 - Bash12argument-hint: "[question about infrastructure data]"13metadata:14 source: https://skillmd.com/skills/opsmill/infrahub-analyzing-data-315 version: 1.2.816 author: OpsMill17---1819## Overview2021Expert guidance for interactive data analysis22against a live Infrahub instance. This skill uses23the **Infrahub MCP server** to query, correlate,24and reason over infrastructure data on demand —25answering operational questions that span multiple26node types and relationships.2728Use this skill for any question of the form29*"what does Infrahub currently know about X,30and how does it relate to Y?"*3132Typical question patterns:3334- **Compliance** — "Are all devices following35 the naming convention?"36- **Service impact** — "Which services are hosted37 on devices in this rack?"38- **Maintenance windows** — "Which devices are39 currently in a maintenance window, and what40 depends on them?"41- **Drift detection** — "Which realized devices42 differ from their topology design?"43- **Capacity** — "Which racks are over 80% full?"44- **Change impact** — "What BGP sessions, services,45 and IPs depend on this prefix?"46- **Inventory gaps** — "Which devices have no47 platform or OS version recorded?"4849For **automated, pipeline-enforced** checks that50block proposed changes, see51`../infrahub-managing-checks/SKILL.md`.52For **repeatable scheduled reports** exported as53artifacts, see `../infrahub-managing-transforms/SKILL.md`.5455## Project Context5657This skill runs in a forked subagent context and has no visibility into the58parent conversation. The user's question MUST be passed via arguments.5960- If invoked with arguments (e.g., `/infrahub:analyzing-data Which devices have no platform assigned?`),61 treat the arguments as the question to answer.62- If invoked with **no arguments**, do **not** guess, do **not** use any example63 question from this file, and do **not** proceed. Return immediately with:6465 > **Error:** No question was passed to `infrahub-analyzing-data`. This skill66 > runs in a forked context and requires the user's question as args. Re-invoke67 > with the question, e.g.68 > `Skill(skill="infrahub-analyzing-data", args="<the user's question>")`.6970## When to Use7172- Answering operational questions interactively73 via natural language74- Cross-referencing two or more node types to find75 relationships or gaps76- Investigating the blast radius of a change before77 executing it78- Auditing data quality across the inventory79- Producing one-time or on-demand reports for80 stakeholders81- Exploring schema structure and data before writing82 a generator or check8384## How It Works8586The Infrahub MCP server exposes tools that let87Claude query Infrahub data directly.88The typical workflow:89901. **Query** — use MCP tools to fetch current state91 from Infrahub922. **Correlate** — join, diff, or filter the data93 against a policy or second dataset943. **Reason** — identify gaps, anomalies, or95 relationships964. **Report** — surface findings with context and97 remediation hints9899## Rule Categories100101| Priority | Category | Prefix | Description |102| -------- | -------- | ------ | ----------- |103| CRITICAL | MCP Tools | `mcp-` | Available Infrahub MCP tools, invocation patterns, response structure |104| CRITICAL | Query Patterns | `query-` | GraphQL structures for fetching, filtering, and traversing relationships |105| HIGH | Correlation | `correlation-` | Joining, diffing, and reasoning over data from multiple queries |106| HIGH | Reporting Output | `reporting-` | Presenting findings: summaries, tables, per-object detail, remediation hints |107| MEDIUM | Approach Selection | `approach-` | When to use MCP analysis vs InfrahubCheck vs Transform |108109## MCP Server Basics110111When the Infrahub MCP server (v1.1.7) is connected,112Claude can call these tools.113114**Read:**115116- **`mcp__infrahub__get_nodes`** — List nodes of a117 kind with filtering/pagination (preferred typed118 read)119- **`mcp__infrahub__search_nodes`** — Find nodes of120 a kind by partial substring121- **`mcp__infrahub__get_schema`** — Discover schema122 kinds and their filters123- **`mcp__infrahub__query_graphql`** — Execute a124 read-only GraphQL query125- **`mcp__infrahub__get_session_info`** — Report the126 active session branch and instance address127128**Write** (branch-isolated — land on an auto-created129`mcp/session-*` branch, never the default branch):130131- **`mcp__infrahub__node_upsert`** — Create or update132 an object133- **`mcp__infrahub__node_delete`** — Delete an object134- **`mcp__infrahub__mutate_graphql`** — Run a GraphQL135 mutation for complex writes136- **`mcp__infrahub__propose_changes`** — Open a137 Proposed Change for human review138- **`mcp__infrahub__reset_session_branch`** — Reset or139 switch the active session branch140141Full per-tool signatures (parameters, examples,142response shapes) and the branch model are in143[rules/mcp-tools.md](./rules/mcp-tools.md) — read144that before invoking any of these.145146```graphql147# Example: find all devices in an active148# maintenance window149query MaintenanceDevices {150 MaintenanceWindow(status__value: "active") {151 edges {152 node {153 name { value }154 start_time { value }155 end_time { value }156 devices {157 edges {158 node {159 name { value }160 role { value }161 site {162 node { name { value } }163 }164 }165 }166 }167 }168 }169 }170}171```172173## Typical Analysis Workflow174175```text1761. Understand the question177 → "Which services depend on devices currently178 in a maintenance window?"1791802. Identify the node types involved181 → MaintenanceWindow, DcimDevice, Service182 (or equivalent in your schema)1831843. Query current state185 → mcp__infrahub__get_nodes per kind (typed), or186 mcp__infrahub__query_graphql — one query187 per node type, or combined1881894. Correlate the data190 → Join across node types, filter, count, diff1911925. Report findings193 → Summarize with counts, list affected objects,194 suggest next steps195```196197## Supporting References198199- **[examples.md](./examples.md)** — Analysis200 patterns (naming, VLAN, BGP, maintenance,201 service impact)202- **[../infrahub-common/graphql-queries.md](../infrahub-common/graphql-queries.md)**203 — GraphQL query writing reference204- **[../infrahub-common/infrahub-yml-reference.md](../infrahub-common/infrahub-yml-reference.md)**205 — .infrahub.yml project configuration206- **[../infrahub-managing-checks/SKILL.md](../infrahub-managing-checks/SKILL.md)**207 — Automated pipeline checks (for enforcement)208- **[../infrahub-managing-transforms/SKILL.md](../infrahub-managing-transforms/SKILL.md)**209 — Transforms for scheduled report artifacts210- **[../infrahub-common/rules/workflow-information-priority.md](../infrahub-common/rules/workflow-information-priority.md)**211 -- Skill content first; how to consult `docs.infrahub.app`212 on a genuine gap (e.g. deleting nodes)213- **[rules/](./rules/)** — Individual rules organized214 by category prefix