Build your schema with AI
Describe a schema change in plain language and your assistant produces the schema YAML for it, using the same top-level keys and conventions covered in Create and load schema — nodes, generics, attributes, relationships, hierarchies.
Working from the Schema Manager skill, your assistant searches the Marketplace for a published schema you can reuse or adapt before modeling anything from scratch, and runs infrahubctl schema check against the result before handing it back. For a change to a schema you already have, it also plans the migration — see Schema migration for the attribute-level sequencing it applies: safe addition, removal via state: absent, two-step renames, and type changes.
Use this for direct, well-scoped changes — adding or modifying nodes, attributes, and relationships. Designing a whole new schema domain is a larger job: describe the domain and have your assistant produce a plan you review before it writes any files. Build your first schema builds one by hand, which is the quickest way to learn the modeling decisions your assistant is making on your behalf.
Example prompts​
Add a status attribute to the Device node.
Model a campus network with sites, buildings, and floors.
Worked example​
1. Describe the change​
Add a status attribute to the Device node, with choices
active, maintenance, and decommissioned.
2. Review the generated schema​
Your assistant searches the Marketplace for a DCIM schema covering Device, finds none that matches the request, and writes the attribute directly:
---
version: "1.0"
nodes:
- name: Device
namespace: Network
attributes:
- name: status
kind: Dropdown
choices:
- name: active
label: Active
- name: maintenance
label: Maintenance
- name: decommissioned
label: Decommissioned
Before handing the file back, your assistant runs infrahubctl schema check against it and fixes anything the check flags. What you review here has already passed validation, so read it for intent rather than for structure — see Review what your assistant produces.
3. Load it on a branch​
infrahubctl branch create add-device-status
infrahubctl schema load schemas/device.yml --branch add-device-status
4. Review the diff and open a Proposed Change​
Review the schema diff in the web interface, then open a Proposed Change to merge add-device-status into main. See Proposed Changes for the review workflow.
Related​
- Create and load schema — Write and load schema YAML by hand
- Marketplace — Published schemas to search before modeling from scratch
- Schema migration — The sequencing rules for changing a schema you already have
- Set up your AI assistant — Install the Infrahub Skills and connect the MCP server
- Schema Manager skill reference — Full behavior