/infrahub:infrahub-auditing-repo [focus-area]from infrahub
Audits an Infrahub repository against best practices and rules, producing a structured compliance report covering schemas, objects, checks, generators, transforms, menus, and deployment readiness.
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.
Comprehensive audit of an Infrahub repository against
all rules and best practices from the infrahub-skills
plugin. Produces a structured report covering schemas,
objects, checks, generators, transforms, menus,
.infrahub.yml configuration, and deployment readiness.
The audit is read-only. The one file it writes is
its own report, AUDIT_REPORT.md. Nothing else in the
working tree or the index is touched, and no
destructive git command is run against them, including
to undo the audit's own side effect. An audit is most
useful on a tree that holds uncommitted work, which is
exactly the tree where a write cannot be undone.
rules/audit-is-read-only.md
holds the canonical lists: which git commands are
forbidden and which read another revision without
touching the tree. Read it, and Phase 0 of the
procedure, before Phase 1. The Bash tool is granted
for read-only inspection, not for changing state;
Write is granted for the report file only.
Before auditing, look at the project with read-only tools:
.yml, .yaml, .py, .gql, and .j2
files in the project root and the directories directly
below it, at most 40 paths..infrahub.yml if it exists. If it does not,
note that in the report.When invoked, the auditor:
.infrahub.yml, schemas, objects, checks,
generators, transforms, menus).infrahub.yml)The phased procedure that ties these steps together lives in audit-procedure.md — read that file when running an audit. It opens with Phase 0, the read-only constraint every other phase runs under, then defines the nine phases (project structure → schema → objects → Python components → cross-references → registration → best practices → deployment → YAGNI / cost-to-fix) and the per-finding severity levels used in the final report.
Before emitting the first finding, read
rules/audit-cites-all-reference-sites.md
and
rules/audit-verifies-proposed-syntax.md.
A finding states how it was verified, or says in
verified_against that it could not be — never by
lowering its severity, which belongs to the rule. It
enumerates every reference site it wants changed, and it
resolves any filter, field or config key it proposes
against the version under audit rather than against the
published docs. Both apply to every phase, and both add
a field to the finding shape.
When Phase 7 reaches .infrahub.yml, read
rules/practices-watch-dependencies.md
before judging a watch block: a missing key, an
incomplete list, and an entry naming an untracked file
each fail silently, and the key has to be confirmed
against the version under audit before it is proposed.
| Priority | Category | What It Checks |
|---|---|---|
| CRITICAL | Conduct | The audit writes nothing but its report, and every finding discloses the evidence behind it; constrains the auditor, not the repo |
| CRITICAL | Project Structure | .infrahub.yml exists, paths valid |
| CRITICAL | Schema Validation | Naming, relationships, deprecated fields |
| CRITICAL | Object Validation | YAML structure, value types, refs |
| CRITICAL | Python Components | Class inheritance, required methods |
| HIGH | Cross-References | Query names match, target groups |
| HIGH | Relationships | Bidirectional IDs, cardinality |
| HIGH | Registration | All files registered, no orphans |
| MEDIUM | Best Practices | human_friendly_id, display_label, watch deps |
| MEDIUM–LOW | YAGNI / Cost-to-Fix | Python doing what schema, GraphQL, Jinja2, or built-in IPAM/VLAN can do; denormalized data; un-extracted duplicate shapes; a whole domain hand-rolled when the marketplace ships it. Severity tracks the cost-to-fix ladder: steps 1–3 MEDIUM, steps 4–7 LOW |
| MEDIUM | Deployment | Git status, bootstrap placement |
| LOW | Patterns & Style | Code organization, naming |
Tell Claude: "Audit this Infrahub repo" or "Run the Infrahub repo auditor"
The auditor will scan the current working directory, walk the phases defined in audit-procedure.md, and produce the report described below.
The report is written to AUDIT_REPORT.md in the project root with this structure:
# Infrahub Repository Audit Report
## Summary
- Total findings: N
- Critical: N | High: N | Medium: N | Low: N | Info: N
- Working tree at audit time: clean | N uncommitted files
- Tree modified by this audit: no | yes, listing paths
(the report file itself does not count)
## Project Structure
...
## Schema Audit
...
## Object Data Audit
...
## Checks Audit
...
## Generators Audit
...
## Transforms Audit
...
## Menus Audit
...
## Cross-Reference Integrity
...
## Deployment Readiness
...
## YAGNI / Cost-to-Fix Findings
Findings sorted by `ladder_step` ascending (cheapest
fix first), then by file path. Each entry names the
rule, the ladder step, the file:line, and the
suggested replacement (schema feature, GraphQL query,
Jinja2 template, `Builtin*`/`Ipam*` inheritance, or
inverse relationship declaration).
A finding also renders the evidence it carries: a
**Sites** line listing every reference the fix must
touch, a **Verified against** line naming what the
proposed syntax was resolved against, and, on a
generic-extraction finding, a **Feasibility** verdict.
...
The auditor checks rules from all skills:
.infrahub.yml reference, GraphQLdocs.infrahub.app
on a genuine gap (e.g. deleting nodes)audit-procedure.md (opens in a new tab)examples.md (opens in a new tab)rules/_sections.md (opens in a new tab)rules/_template.md (opens in a new tab)rules/artifact-target-inheritance.md (opens in a new tab)rules/audit-cites-all-reference-sites.md (opens in a new tab)rules/audit-is-read-only.md (opens in a new tab)rules/audit-verifies-proposed-syntax.md (opens in a new tab)rules/deployment-readiness.md (opens in a new tab)rules/objects-format.md (opens in a new tab)rules/practices-schema.md (opens in a new tab)rules/practices-watch-dependencies.md (opens in a new tab)rules/python-classes.md (opens in a new tab)rules/registration-completeness.md (opens in a new tab)rules/schema-display-labels-deprecated.md (opens in a new tab)rules/schema-file-object-misuse.md (opens in a new tab)rules/schema-naming.md (opens in a new tab)rules/schema-relationships.md (opens in a new tab)rules/structure-infrahub-yml.md (opens in a new tab)rules/xref-query-names.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
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)./infrahub-collecting-diagnosticsCollect 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-managing-* skills), a bundle has already been collected and the user wants it analyzed (use infrahub-analyzing-diagnostics), filing a public GitHub issue (use infrahub-reporting-issues), running operational queries (use infrahub-analyzing-data), or planning an upgrade that has not run yet (use infrahub-planning-upgrades)./infrahub-commonShared 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./infrahub-converting-netbox-device-typesConverts NetBox device-type and module-type definitions (the netbox-community devicetype-library format, also published via the NetBox Data Exchange / NDX) into Infrahub object templates as Infrahub object YAML, using a bundled Python converter driven by a schema mapping profile. TRIGGER when: importing NetBox device types or module types, exporting device types from a running NetBox instance, building object templates from vendor device models, converting line cards / PSUs / transceivers from NetBox module types into Template* objects, re-running a conversion after changing the mapping profile, debugging a wrong or failed conversion. DO NOT TRIGGER when: importing CSV/TSV data (use infrahub-importing-data), authoring schemas from scratch (use infrahub-managing-schemas), writing ordinary object data files (use infrahub-managing-objects), or setting up continuous two-way replication with a live NetBox (that is infrahub-sync, a separate product; a one-off export of device types is in scope here)./infrahub-designing-modelsDesigns an Infrahub data model before any schema YAML exists. TRIGGER when: someone has an idea or a problem but no agreed model, asks "what should I model" or "help me design my data model", wants diagrams, spreadsheets or exports turned into a design, has a scope too big for one feature and needs it split, or is updating, extending or fixing an existing design brief. DO NOT TRIGGER when: a design or model sketch already exists and the user wants schema YAML (use infrahub-managing-schemas), wants to load data (use infrahub-managing-objects or infrahub-importing-data), or wants to learn concepts (use infrahub-teaching-concepts).Other plugins' skills for the same job