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-23description: Analyzes 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. 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.4---56## Overview78Expert guidance for interactive data analysis9against a live Infrahub instance. This skill uses10the **Infrahub MCP server** to query, correlate,11and reason over infrastructure data on demand —12answering operational questions that span multiple13node types and relationships.1415Use this skill for any question of the form16*"what does Infrahub currently know about X,17and how does it relate to Y?"*1819Typical question patterns:2021- **Compliance** — "Are all devices following22 the naming convention?"23- **Service impact** — "Which services are hosted24 on devices in this rack?"25- **Maintenance windows** — "Which devices are26 currently in a maintenance window, and what27 depends on them?"28- **Drift detection** — "Which realized devices29 differ from their topology design?"30- **Capacity** — "Which racks are over 80% full?"31- **Change impact** — "What BGP sessions, services,32 and IPs depend on this prefix?"33- **Inventory gaps** — "Which devices have no34 platform or OS version recorded?"3536For **automated, pipeline-enforced** checks that37block proposed changes, see38`../infrahub-managing-checks/SKILL.md`.39For **repeatable scheduled reports** exported as40artifacts, see `../infrahub-managing-transforms/SKILL.md`.4142## Project Context4344This skill runs in a forked subagent context and has no visibility into the45parent conversation. The user's question MUST be passed via arguments.4647- If invoked with arguments (e.g., `/infrahub:analyzing-data Which devices have no platform assigned?`),48 treat the arguments as the question to answer.49- If invoked with **no arguments**, do **not** guess, do **not** use any example50 question from this file, and do **not** proceed. Return immediately with:5152 > **Error:** No question was passed to `infrahub-analyzing-data`. This skill53 > runs in a forked context and requires the user's question as args. Re-invoke54 > with the question, e.g.55 > `Skill(skill="infrahub-analyzing-data", args="<the user's question>")`.5657## When to Use5859- Answering operational questions interactively60 via natural language61- Cross-referencing two or more node types to find62 relationships or gaps63- Investigating the blast radius of a change before64 executing it65- Auditing data quality across the inventory66- Producing one-time or on-demand reports for67 stakeholders68- Exploring schema structure and data before writing69 a generator or check7071## How It Works7273The Infrahub MCP server exposes tools that let74Claude query Infrahub data directly.75The typical workflow:76771. **Query** — use MCP tools to fetch current state78 from Infrahub792. **Correlate** — join, diff, or filter the data80 against a policy or second dataset813. **Reason** — identify gaps, anomalies, or82 relationships834. **Report** — surface findings with context and84 remediation hints8586## Rule Categories8788| Priority | Category | Prefix | Description |89| -------- | -------- | ------ | ----------- |90| CRITICAL | MCP Tools | `mcp-` | Available Infrahub MCP tools, invocation patterns, response structure |91| CRITICAL | Query Patterns | `query-` | GraphQL structures for fetching, filtering, and traversing relationships |92| HIGH | Correlation | `correlation-` | Joining, diffing, and reasoning over data from multiple queries |93| HIGH | Reporting Output | `reporting-` | Presenting findings: summaries, tables, per-object detail, remediation hints |94| MEDIUM | Approach Selection | `approach-` | When to use MCP analysis vs InfrahubCheck vs Transform |9596## MCP Server Basics9798When the Infrahub MCP server (v1.1.7) is connected,99Claude can call these tools.100101**Read:**102103- **`mcp__infrahub__get_nodes`** — List nodes of a104 kind with filtering/pagination (preferred typed105 read)106- **`mcp__infrahub__search_nodes`** — Find nodes of107 a kind by partial substring108- **`mcp__infrahub__get_schema`** — Discover schema109 kinds and their filters110- **`mcp__infrahub__query_graphql`** — Execute a111 read-only GraphQL query112- **`mcp__infrahub__get_session_info`** — Report the113 active session branch and instance address114115**Write** (branch-isolated — land on an auto-created116`mcp/session-*` branch, never the default branch):117118- **`mcp__infrahub__node_upsert`** — Create or update119 an object120- **`mcp__infrahub__node_delete`** — Delete an object121- **`mcp__infrahub__mutate_graphql`** — Run a GraphQL122 mutation for complex writes123- **`mcp__infrahub__propose_changes`** — Open a124 Proposed Change for human review125- **`mcp__infrahub__reset_session_branch`** — Reset or126 switch the active session branch127128Full per-tool signatures (parameters, examples,129response shapes) and the branch model are in130[rules/mcp-tools.md](./rules/mcp-tools.md) — read131that before invoking any of these.132133```graphql134# Example: find all devices in an active135# maintenance window136query MaintenanceDevices {137 MaintenanceWindow(status__value: "active") {138 edges {139 node {140 name { value }141 start_time { value }142 end_time { value }143 devices {144 edges {145 node {146 name { value }147 role { value }148 site {149 node { name { value } }150 }151 }152 }153 }154 }155 }156 }157}158```159160## Typical Analysis Workflow161162```text1631. Understand the question164 → "Which services depend on devices currently165 in a maintenance window?"1661672. Identify the node types involved168 → MaintenanceWindow, DcimDevice, Service169 (or equivalent in your schema)1701713. Query current state172 → mcp__infrahub__get_nodes per kind (typed), or173 mcp__infrahub__query_graphql — one query174 per node type, or combined1751764. Correlate the data177 → Join across node types, filter, count, diff1781795. Report findings180 → Summarize with counts, list affected objects,181 suggest next steps182```183184## Supporting References185186- **[examples.md](./examples.md)** — Analysis187 patterns (naming, VLAN, BGP, maintenance,188 service impact)189- **[../infrahub-common/graphql-queries.md](../infrahub-common/graphql-queries.md)**190 — GraphQL query writing reference191- **[../infrahub-common/infrahub-yml-reference.md](../infrahub-common/infrahub-yml-reference.md)**192 — .infrahub.yml project configuration193- **[../infrahub-managing-checks/SKILL.md](../infrahub-managing-checks/SKILL.md)**194 — Automated pipeline checks (for enforcement)195- **[../infrahub-managing-transforms/SKILL.md](../infrahub-managing-transforms/SKILL.md)**196 — Transforms for scheduled report artifacts197- **[rules/](./rules/)** — Individual rules organized198 by category prefix