add-model-field

Add a new field to a NetBox model across persistence, APIs, UI, and validation.

21.3k|3.1k|Updated Feb 29, 2016
One-click install
npx skills add https://github.com/netbox-community/netbox --skill add-model-field
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-model-field
Source: https://github.com/netbox-community/netbox/tree/main/.claude/skills/add-model-field
Command: npx skills add https://github.com/netbox-community/netbox --skill add-model-field

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Adding a new attribute to a NetBox model isn’t a single edit—it requires coordinated changes across the data model, database migrations, UI forms and panels, filtering/search, APIs, GraphQL, tests, and documentation.

Core Features & Use Cases

  • Step-by-step end-to-end checklist for wiring a new model field through the full NetBox stack.
  • Covers common field types and special cases, including FK/M2M patterns, validation via clean(), clone_fields, GenericForeignKey indexing, and serializer nested-write behavior.
  • Ensures consistency across user-facing and programmable interfaces, including Django forms/table/panels, FilterSets, REST serializers, GraphQL filters/types, and test updates.
  • Includes documentation and testing guidance, so the new field is discoverable, verifiable, and maintainable.

Quick Start

Use the add-model-field skill to add a new field named my_field to the existing MyModel in NetBox, ensuring it is fully integrated into models, migrations, serializers, forms, filtersets, tables, panels, search, GraphQL, tests, and docs.

Frequently Asked Questions about add-model-field

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new field to an existing NetBox model end to end?

To add a NetBox model field end to end, you must update the data model, create a Django migration, and wire the attribute through REST serializers, forms, FilterSets, tables, GraphQL, tests, and documentation for full stack integration.

What steps are required to wire a new NetBox model field into the REST API and GraphQL?

Wiring a NetBox model field into APIs requires updating the Django model, generating the migration, updating REST API serializers for nested-write behavior, adding GraphQL filters and types, and modifying FilterSets for search consistency.

Does adding a field to a NetBox model require updates to forms and panels?

Adding a field to a NetBox model requires explicit UI wiring, meaning you must update Django forms, tables, and UI panels to ensure the new attribute is visible, editable, and consistent across all user-facing interfaces.

How do I handle ForeignKey and M2M fields when extending a NetBox data model?

Extending NetBox data models with ForeignKey or M2M fields requires applying specific patterns for serializer nesting and clone_fields, alongside standard migration and FilterSet updates to maintain relationship integrity.

Why is my new NetBox model field not showing up in search results?

A new NetBox model field will not appear in search results unless you explicitly wire it into the FilterSet and search index, ensuring the attribute is properly registered for filtering and querying operations.

Can I use the add-model-field skill for adding fields with GenericForeignKey indexing?

Yes, the add-model-field skill covers special cases including GenericForeignKey indexing and validation via the clean() method, ensuring complex field types are fully integrated into the NetBox application stack.