infrahub-analyst
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOverview
概述
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
.
For repeatable scheduled reports exported as
artifacts, see .
../infrahub-check-creator/SKILL.md../infrahub-transform-creator/SKILL.md针对实时Infrahub实例的交互式数据分析专业指南。本技能使用Infrahub MCP服务器按需查询、关联和推理基础设施数据,回答涉及多种节点类型和关联关系的运维问题。
当你有如下形式的问题时可使用本技能:
"Infrahub当前对X有哪些了解,它和Y有什么关联?"
典型问题场景:
- 合规 — "所有设备都遵循命名规范吗?"
- 服务影响 — "这个机架中的设备承载了哪些服务?"
- 维护窗口 — "哪些设备当前处于维护窗口中,哪些资源依赖于这些设备?"
- 漂移检测 — "哪些已部署的设备与其拓扑设计存在差异?"
- 容量 — "哪些机架的使用率超过80%?"
- 变更影响 — "哪些BGP会话、服务和IP依赖于这个前缀?"
- 库存缺口 — "哪些设备没有记录平台或OS版本信息?"
如需自动化、流水线强制的校验来拦截待提交的变更,请查看。如需导出为制品的可重复定时报告,请查看。
../infrahub-check-creator/SKILL.md../infrahub-transform-creator/SKILL.mdWhen 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
Infrahub MCP服务器提供了可让Claude直接查询Infrahub数据的工具。典型工作流:
- 查询 — 使用MCP工具从Infrahub获取当前状态
- 关联 — 结合策略或第二个数据集对数据进行拼接、比对或过滤
- 推理 — 识别缺口、异常或关联关系
- 报告 — 输出带有上下文和修复建议的发现结果
Rule Categories
规则分类
| Priority | Category | Prefix | Description |
|---|---|---|---|
| CRITICAL | MCP Tools | | Available Infrahub MCP tools, invocation patterns, response structure |
| CRITICAL | Query Patterns | | GraphQL structures for fetching, filtering, and traversing relationships |
| HIGH | Correlation | | Joining, diffing, and reasoning over data from multiple queries |
| HIGH | Reporting Output | | Presenting findings: summaries, tables, per-object detail, remediation hints |
| MEDIUM | Approach Selection | | When to use MCP analysis vs InfrahubCheck vs Transform |
| 优先级 | 分类 | 前缀 | 描述 |
|---|---|---|---|
| CRITICAL | MCP工具 | | 可用的Infrahub MCP工具、调用模式、响应结构 |
| CRITICAL | 查询模式 | | 用于获取、过滤和遍历关联关系的GraphQL结构 |
| HIGH | 关联分析 | | 对多个查询返回的数据进行拼接、比对和推理 |
| HIGH | 报告输出 | | 呈现发现结果:摘要、表格、单对象详情、修复建议 |
| MEDIUM | 方案选择 | | 何时使用MCP分析、InfrahubCheck或Transform |
MCP Server Basics
MCP服务器基础
When the Infrahub MCP server is connected, Claude
can call tools such as:
- — Execute a GraphQL query (primary tool)
mcp__infrahub__infrahub_query - — List available node kinds
mcp__infrahub__infrahub_list_schema - — Retrieve a specific object by ID or filters
mcp__infrahub__infrahub_get - — Create an object (remediation, on a branch)
mcp__infrahub__infrahub_create - — Update an object (remediation, on a branch)
mcp__infrahub__infrahub_update
graphql
undefined当连接Infrahub MCP服务器后,Claude可以调用如下工具:
- — 执行GraphQL查询(核心工具)
mcp__infrahub__infrahub_query - — 列出可用的节点类型
mcp__infrahub__infrahub_list_schema - — 通过ID或过滤器检索特定对象
mcp__infrahub__infrahub_get - — 创建对象(修复场景,在分支上操作)
mcp__infrahub__infrahub_create - — 更新对象(修复场景,在分支上操作)
mcp__infrahub__infrahub_update
graphql
undefinedExample: find all devices in an active
Example: find all devices in an active
maintenance window
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 } }
}
}
}
}
}
}
}
}
undefinedquery 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 } }
}
}
}
}
}
}
}
}
undefinedTypical Analysis Workflow
典型分析工作流
text
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__infrahub_query — 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 stepstext
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__infrahub_query — 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 stepsSupporting References
参考资料
- examples.md — Analysis patterns (naming, VLAN, BGP, maintenance, service impact)
- ../infrahub-common/graphql-queries.md — GraphQL query writing reference
- ../infrahub-common/infrahub-yml-reference.md — .infrahub.yml project configuration
- ../infrahub-check-creator/SKILL.md — Automated pipeline checks (for enforcement)
- ../infrahub-transform-creator/SKILL.md — Transforms for scheduled report artifacts
- rules/ — Individual rules organized by category prefix
- examples.md — 分析模式(命名、VLAN、BGP、维护、服务影响)
- ../infrahub-common/graphql-queries.md — GraphQL查询编写参考
- ../infrahub-common/infrahub-yml-reference.md — .infrahub.yml项目配置参考
- ../infrahub-check-creator/SKILL.md — 自动化流水线校验(用于强制管控)
- ../infrahub-transform-creator/SKILL.md — 用于生成定时报告制品的Transform
- rules/ — 按分类前缀组织的独立规则