Introduction to Infrahub Skills
Relevant source files
The following files were used as context for generating this wiki page:
Infrahub Skills provide domain-specific knowledge to AI coding assistants for developing with the Infrahub platform. These skills act as a Claude Code plugin, offering rules, examples, and references to automate infrastructure data management tasks such as schema design, object population, and validation.
Sources: README.md:1-5, dev/knowledges/architecture.md:5-9, dev/guides/getting-started.md:5-9
The system automates Infrahub conventions—including naming, relationship patterns, and .infrahub.yml registration—allowing users to focus on infrastructure requirements rather than manual implementation details. It supports both direct task execution and spec-driven development workflows.
Sources: README.md:51-55, README.md:92-100
Core Architecture
The Infrahub Skills repository functions as a collection of Markdown-based guidance. The system relies on a Progressive Disclosure Model to manage AI context windows efficiently.
Sources: dev/knowledges/architecture.md:8-11, dev/knowledges/architecture.md:43-45
Progressive Disclosure Model
The model loads information in three tiers based on the current AI requirement:
| Tier | Component | Description |
|---|---|---|
| Level 1 | Metadata | Always visible (~100 words). Contains the name and description used for skill triggering. |
| Level 2 | SKILL.md Body | Loaded upon activation (<500 lines). Provides the workflow overview and links to rules. |
| Level 3 | Supporting Files | Loaded on demand. Contains modular rules, detailed examples, and format references. |
Sources: dev/guides/adding-a-skill.md:19-33, dev/knowledges/architecture.md:47-58
Architectural Diagram
This diagram illustrates how the plugin triggers and exposes its components to the AI assistant.
The diagram shows the transition from project detection to the specific loading of rules and examples during task execution.
Sources: dev/knowledges/architecture.md:15-39, dev/knowledges/architecture.md:90-95
Skill Components and Structure
Each skill lives in a dedicated directory under skills/ and follows a strict internal anatomy to ensure consistency and modularity.
Sources: dev/guides/adding-a-skill.md:3-7, dev/knowledges/architecture.md:15-28
Skill Anatomy
SKILL.md: The required entry point containing YAML frontmatter for triggering and the primary workflow.rules/: A directory containing modular best practices, categorized by prefixes (e.g.,naming-,format-).examples.md: Ready-to-use patterns that the AI adapts for specific tasks.reference.md: Property and format reference tables for API parameters or YAML fields.infrahub-common/: Shared references for cross-cutting concerns like GraphQL queries and.infrahub.ymlformats.
Sources: dev/guides/adding-a-skill.md:9-17, dev/knowledges/architecture.md:21-39
Available Skill Domains
| Skill Name | Purpose |
|---|---|
managing-schemas | Designing nodes, generics, and relationships. |
managing-objects | Creating YAML data for infrastructure instances. |
managing-checks | Writing Python validation checks (InfrahubCheck). |
managing-generators | Building design-driven automation logic. |
managing-transforms | Creating data transforms (Python/Jinja2) for reports. |
analyzing-data | Querying live Infrahub data via MCP. |
auditing-repo | Checking repositories against Infrahub best practices. |
Sources: README.md:139-165, AGENTS.md:108-124
Workflow Strategies
The skills support two primary ways of working: Direct Mode for simple changes and Spec-Driven Development (SDD) for complex designs.
Sources: README.md:57-60
Direct Mode
Users provide a specific request, and the AI invokes the relevant skill immediately. This is optimal for:
- Adding attributes to existing nodes.
- Writing individual validation checks.
- Creating new menu sections.
Sources: README.md:62-79, README.md:112-117
Spec-Driven Development (SDD)
For multi-part tasks (e.g., standing up a new domain), the agent follows a plan-then-build cycle to ensure consistency across schema, objects, and automation.
The SDD workflow forces reasoning before implementation, catching design issues such as incorrect relationship cardinality early.
Sources: README.md:81-90, README.md:92-109
Installation and Environment
Infrahub skills can be installed globally or per project. The npx skills CLI is the recommended method as it auto-detects configured AI tools.
Sources: README.md:7-15, dev/guides/getting-started.md:20-25
Prerequisite Checklist
- AI Tool: Claude Code, GitHub Copilot, Cursor, or Windsurf.
- CLI Tools:
infrahubctlfor loading resources. - Context Files: Presence of
.infrahub.yml,infrahub.toml, or schema files for auto-detection. - Analyst Support: Infrahub MCP server (required for
analyzing-data).
Sources: README.md:169-176, dev/knowledges/architecture.md:90-95
Installation Commands
# Install via npx
npx skills add opsmill/infrahub-skills
# Install via Claude Code Marketplace
/plugin marketplace add opsmill/claude-marketplace
/plugin install infrahub@opsmill
Sources: README.md:7-12, README.md:188-192
Summary
Introduction to Infrahub Skills provides a framework for AI-assisted infrastructure management. By organizing Infrahub expertise into modular, triggerable Markdown skills, the project enables developers to build, validate, and audit infrastructure as code with high precision. The system ensures that Infrahub-specific conventions—like bidirectional relationship identifiers and branch-first loading—are enforced automatically across the development lifecycle.
Sources: README.md:51-55, dev/knowledges/architecture.md:105-110, dev/knowledges/infrahub-concepts.md:15-20