opsmill/infrahub-skills

infrahub-analyzing-data

Analyzes and correlates live Infrahub data via the MCP server — answers operational questions, detects drift, and investigates impact.

ソースを見る

使い方

  1. インストールコマンドをコピーし、自分の環境へ導入する前にソースを確認します。
  2. 必要なツール、認証情報、対応環境を原文で確認します。
  3. 入力と成果物を指定し、出力を資料と照合します。
npx skills add https://github.com/opsmill/infrahub-skills --skill infrahub-analyzing-data

開始前の確認

  • 導入にはモデル契約、API枠、ファイルへのアクセス許可は含まれません。
  • スター数や導入数は活動の指標であり、独立した品質・安全性試験ではありません。
リポジトリの原文

見出し、例、コード、表、リンク、参照画像を含む原文を表示しています。

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:

  1. Query — use MCP tools to fetch current state

from Infrahub

  1. Correlate — join, diff, or filter the data

against a policy or second dataset

  1. Reason — identify gaps, anomalies, or

relationships

  1. Report — surface findings with context and

remediation hints

Rule Categories

PriorityCategoryPrefixDescription
CRITICALMCP Toolsmcp-Available Infrahub MCP tools, invocation patterns, response structure
CRITICALQuery Patternsquery-GraphQL structures for fetching, filtering, and traversing relationships
HIGHCorrelationcorrelation-Joining, diffing, and reasoning over data from multiple queries
HIGHReporting Outputreporting-Presenting findings: summaries, tables, per-object detail, remediation hints
MEDIUMApproach Selectionapproach-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.

graphql
# 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

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__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

  • [examples.md](./examples.md) — Analysis

patterns (naming, VLAN, BGP, maintenance, service impact)

  • [../infrahub-common/graphql-queries.md](../infrahub-common/graphql-queries.md)

— GraphQL query writing reference

  • [../infrahub-common/infrahub-yml-reference.md](../infrahub-common/infrahub-yml-reference.md)

— .infrahub.yml project configuration

  • [../infrahub-managing-checks/SKILL.md](../infrahub-managing-checks/SKILL.md)

— Automated pipeline checks (for enforcement)

  • [../infrahub-managing-transforms/SKILL.md](../infrahub-managing-transforms/SKILL.md)

— Transforms for scheduled report artifacts

  • [../infrahub-common/rules/workflow-information-priority.md](../infrahub-common/rules/workflow-information-priority.md)

-- Skill content first; how to consult docs.infrahub.app on a genuine gap (e.g. deleting nodes)

  • [rules/](./rules/) — Individual rules organized

by category prefix

同じリポジトリから

関連する Skills

すべての Skills
opsmill
コミュニティ

infrahub-analyzing-diagnostics

Analyze 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 TR

1時間の導入数
2
GitHub Stars
27
更新日
11月9日
opsmill
コミュニティ

infrahub-auditing-repo

Audits an Infrahub repository against best practices and rules, producing a structured compliance report. TRIGGER when: reviewing repo for compliance, onboarding to existing project, pre-deployment validation, catching issues. DO NOT TRIGGER when: creating schemas, writing checks/generators, querying live data, populating objects, planning an Infrahub version upgrade (use infrahub-planning-upgrades).

1時間の導入数
3
GitHub Stars
27
更新日
11月9日
opsmill
コミュニティ

infrahub-collecting-diagnostics

Collect a redacted local diagnostic bundle (logs, config, version, state) for an OpsMill expert hand-off. TRIGGER when: Infrahub is broken/failing/erroring, the user asks for help debugging, wants to collect logs/diagnostics, prepares a hand-off for OpsMill support, or reports a crash/timeout/connection issue (upgrade failure, stuck branch, container CrashLoopBackOff, 500s, OOM). DO NOT TRIGGER when: debugging a check, transform, generator, menu, or schema in the repository (use the infrahub-man

1時間の導入数
3
GitHub Stars
27
更新日
11月9日
opsmill
コミュニティ

infrahub-common

Shared references and cross-cutting rules for all Infrahub skills — GraphQL syntax, .infrahub.yml format, and common patterns. DO NOT TRIGGER directly — loaded automatically by other Infrahub skills when they need shared references.

1時間の導入数
3
GitHub Stars
27
更新日
11月9日