infrahub-managing-menus
Creates, modifies and debugs Infrahub custom navigation menus for the web UI sidebar, organizing node types into logical groups. TRIGGER when: designing sidebar menus, grouping node types in UI, customizing Infrahub web interface navigation, modifying or extending an existing menu, changing the order, nesting, or icons inside a menu file, debugging why a menu item does not appear or lands in the wrong group. DO NOT TRIGGER when: designing or modifying schemas, including setting menu_placement, icon, or order_weight on a schema node (use infrahub-managing-schemas), writing checks or transforms, populating data objects.
How do I install this agent skill?
npx skills add https://github.com/opsmill/infrahub-skills --skill infrahub-managing-menusIs this agent skill safe to install?
- Gen Agent Trust Hubpass
This skill is safe for use. It provides comprehensive rules and examples for creating and managing navigation menus in Infrahub. The skill uses shell commands at load time to discover relevant configuration files in the workspace, which is a standard feature used here for legitimate context gathering.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
- ZeroLeakspass
Score: 93/100 · 2 sections analyzed
What does this agent skill do?
Infrahub Menu Creator
Overview
Expert guidance for creating Infrahub custom menus. Menus control the left-side navigation in the web interface, organizing schema node types into a custom hierarchy.
Project Context
Existing menu files:
!find . -name "*.yml" -path "*/menus/*" 2>/dev/null | head -10
Schema files (to identify available node types):
!find . -name "*.yml" -path "*/schemas/*" -o -name "*schema*" -name "*.yml" 2>/dev/null | head -10
When to Use
- Designing navigation menus for the Infrahub web UI
- Organizing node types into logical groups and hierarchies
- Adding icons and labels to menu items
- Setting up group headers (non-clickable) with nested children
- Configuring schema nodes to use custom menus instead of auto-generated ones
- Reordering, renaming, or regrouping an existing menu file
- Debugging why a menu item does not appear, or lands in the wrong group
Rule Categories
| Priority | Category | Prefix | Description |
|---|---|---|---|
| CRITICAL | Format | format- | apiVersion, kind, spec |
| CRITICAL | Properties | item- | name, namespace, label, kind |
| HIGH | Hierarchy | hierarchy- | Nesting, group headers, data |
| HIGH | Icons | icons- | MDI icon reference, choices |
| MEDIUM | Schema | schema- | include_in_menu, kind links |
| LOW | Patterns | patterns- | Flat menu, comments, links |
Schema Features This Skill Depends On
A custom menu doesn't replace the auto-menu — it augments it. Schemas need cooperating settings to avoid duplicates and stay UI-stable.
Duplicates come from two places, and only one of them
is the schema's. Nodes the auto-menu also emits are
settled below with include_in_menu: false; sections
Infrahub itself ships are settled in the menu file
with parent:, covered in
rules/hierarchy-nesting.md.
| If the menu item... | The schema must... | See |
|---|---|---|
Links to a schema node's list view via kind: | Define that node (or generic) so the URL resolves — and set include_in_menu: false on it to suppress the duplicate auto-menu entry | rules/schema-integration.md |
| Shows all subtypes under one entry via a generic kind | Have the generic defined, with all the relevant nodes inherit_from it | ../infrahub-managing-schemas/rules/hierarchy-setup.md |
| Should appear at a specific position when auto-menu is in play | Set order_weight on the schema node (auto-menu uses it; custom menu ignores it) | ../infrahub-managing-schemas/rules/display-order-weight.md |
| Groups subtypes under a parent node entry | Set menu_placement: <FullKind> on each subtype so the auto-menu side groups consistently with the custom menu | ../infrahub-managing-schemas/rules/display-menu-placement.md |
Audit include_in_menu on every node you reference
from the menu file — the sidebar duplicates that
this prevents look to users like the custom menu is
"broken", but the fix is on the schema side.
Menu File Basics
---
apiVersion: infrahub.app/v1
kind: Menu
spec:
data:
- namespace: Dcim
name: DeviceMenu
label: "Devices"
icon: "mdi:server"
kind: DcimDevice # Links to schema node list view
apiVersion, kind: Menu, and spec.data are always
required. Each menu item needs name and namespace.
Workflow
Follow these steps when creating a menu:
-
Gather requirements — Ask what schema nodes exist, how they should be grouped, and whether the user wants flat or hierarchical navigation.
-
Read relevant rules — Read
rules/format-structure.mdfor the required YAML structure,rules/item-properties.mdfor item fields, andrules/icons-reference.mdto pick appropriate MDI icons. Readrules/hierarchy-nesting.mdbefore placing any item, flat menus included: Infrahub already ships IPAM, Object Management, Branches and others, and anything belonging in one of those attaches withparent:rather than being declared again. -
Generate the menu YAML — Start with the
$schemacomment andapiVersion/kind/specstructure. Apply rules from step 2. -
Add registration and schema guidance — Every menu file output must include:
- A YAML comment block showing how to register
the file in
.infrahub.ymlunder themenus:key (seerules/format-structure.md) - A YAML comment block advising to set
include_in_menu: falseon every schema node that appears in the custom menu, to prevent duplicate sidebar entries (seerules/schema-integration.md)
Include these as comments at the top of the file, before the
---document separator. This ensures the user sees the guidance alongside the menu definition. - A YAML comment block showing how to register
the file in
Supporting References
- examples.md -- Four worked menu hierarchies (flat, grouped, generic-linked, full multi-domain) ready to copy and adapt
- infrahub-yml-reference.md -- .infrahub.yml project configuration
- common/rules/ -- Shared rules (git integration, caching gotchas) that apply across all skills
- ../infrahub-common/rules/workflow-information-priority.md
-- Skill content first; how to consult
docs.infrahub.appon a genuine gap (e.g. deleting nodes) - managing-schemas -- Schema node kinds that menus link to
- rules/ -- Individual rules organized by category prefix
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/opsmill/infrahub-skills/infrahub-managing-menus">View infrahub-managing-menus on skillZs</a>