Infrahub Repo Auditor
Overview
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.
When to Use
- Before deploying a repository to Infrahub
- When onboarding to an existing Infrahub project
- After significant refactoring to catch regressions
- As a periodic quality gate in development workflows
- When troubleshooting schema loading, object sync,
or pipeline failures
How It Works
When invoked, the auditor:
- Discovers the project structure
(
.infrahub.yml, schemas, objects, checks,
generators, transforms, menus)
- Validates each component against the rules
defined in the infrahub-skills plugin
- Cross-references between components (e.g.,
query names match between Python files and
.infrahub.yml)
- Generates a markdown report with findings organized by severity
Audit Categories
| Priority |
Category |
What It Checks |
| 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 |
| MEDIUM |
Deployment |
Git status, bootstrap placement |
| LOW |
Patterns & Style |
Code organization, naming |
Running the Audit
Tell Claude: "Audit this Infrahub repo" or "Run the Infrahub repo auditor"
The auditor will scan the current working directory and produce a report.
Report Format
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
## Project Structure
...
## Schema Audit
...
## Object Data Audit
...
## Checks Audit
...
## Generators Audit
...
## Transforms Audit
...
## Menus Audit
...
## Cross-Reference Integrity
...
## Deployment Readiness
...
Audit Rules Reference
The auditor checks rules from all skills:
- ../infrahub-schema-creator/ -- Naming,
relationships, attributes, hierarchy, display,
extensions, uniqueness, migration
- ../infrahub-object-creator/ -- Format,
values, children, ranges, organization
- ../infrahub-check-creator/ --
Architecture, Python class, API, registration
- ../infrahub-generator-creator/ --
Architecture, Python class, tracking, API
- ../infrahub-transform-creator/ --
Types, Python/Jinja2, hybrid, artifacts, API
- ../infrahub-menu-creator/ -- Format,
item properties, hierarchy, icons
- ../infrahub-common/ -- Git integration,
caching,
.infrahub.yml reference, GraphQL
Rules
See rules/ for detailed audit rule definitions.
1---2name: infrahub-repo-auditor3description: Audit an Infrahub repository against all best practices and rules. Use when reviewing a project for compliance, onboarding to an existing repo, or before deployment to catch issues early.4---56# Infrahub Repo Auditor78## Overview910Comprehensive audit of an Infrahub repository against11all rules and best practices from the infrahub-skills12plugin. Produces a structured report covering schemas,13objects, checks, generators, transforms, menus,14`.infrahub.yml` configuration, and deployment readiness.1516## When to Use1718- Before deploying a repository to Infrahub19- When onboarding to an existing Infrahub project20- After significant refactoring to catch regressions21- As a periodic quality gate in development workflows22- When troubleshooting schema loading, object sync,23 or pipeline failures2425## How It Works2627When invoked, the auditor:28291. **Discovers** the project structure30 (`.infrahub.yml`, schemas, objects, checks,31 generators, transforms, menus)322. **Validates** each component against the rules33 defined in the infrahub-skills plugin343. **Cross-references** between components (e.g.,35 query names match between Python files and36 `.infrahub.yml`)374. **Generates** a markdown report with findings organized by severity3839## Audit Categories4041| Priority | Category | What It Checks |42| -------- | -------- | -------------- |43| CRITICAL | Project Structure | `.infrahub.yml` exists, paths valid |44| CRITICAL | Schema Validation | Naming, relationships, deprecated fields |45| CRITICAL | Object Validation | YAML structure, value types, refs |46| CRITICAL | Python Components | Class inheritance, required methods |47| HIGH | Cross-References | Query names match, target groups |48| HIGH | Relationships | Bidirectional IDs, cardinality |49| HIGH | Registration | All files registered, no orphans |50| MEDIUM | Best Practices | human_friendly_id, display_label |51| MEDIUM | Deployment | Git status, bootstrap placement |52| LOW | Patterns & Style | Code organization, naming |5354## Running the Audit5556Tell Claude: **"Audit this Infrahub repo"** or **"Run the Infrahub repo auditor"**5758The auditor will scan the current working directory and produce a report.5960## Report Format6162The report is written to `AUDIT_REPORT.md` in the project root with this structure:6364```markdown65# Infrahub Repository Audit Report6667## Summary6869- Total findings: N70- Critical: N | High: N | Medium: N | Low: N | Info: N7172## Project Structure7374...7576## Schema Audit7778...7980## Object Data Audit8182...8384## Checks Audit8586...8788## Generators Audit8990...9192## Transforms Audit9394...9596## Menus Audit9798...99100## Cross-Reference Integrity101102...103104## Deployment Readiness105106...107```108109## Audit Rules Reference110111The auditor checks rules from all skills:112113- **[../infrahub-schema-creator/](../infrahub-schema-creator/)** -- Naming,114 relationships, attributes, hierarchy, display,115 extensions, uniqueness, migration116- **[../infrahub-object-creator/](../infrahub-object-creator/)** -- Format,117 values, children, ranges, organization118- **[../infrahub-check-creator/](../infrahub-check-creator/)** --119 Architecture, Python class, API, registration120- **[../infrahub-generator-creator/](../infrahub-generator-creator/)** --121 Architecture, Python class, tracking, API122- **[../infrahub-transform-creator/](../infrahub-transform-creator/)** --123 Types, Python/Jinja2, hybrid, artifacts, API124- **[../infrahub-menu-creator/](../infrahub-menu-creator/)** -- Format,125 item properties, hierarchy, icons126- **[../infrahub-common/](../infrahub-common/)** -- Git integration,127 caching, `.infrahub.yml` reference, GraphQL128129## Rules130131See [rules/](./rules/) for detailed audit rule definitions.