agentsclimarketplace

Netbox review integration

Skill netboxlabs/skills/skills/netbox-review-integration

Review and audit NetBox integration code for correctness, performance, and reliability. Use when reviewing scripts or applications that interact with NetBox APIs, checking for pagination bugs, authentication issues, performance anti-patterns, error handling gaps, and SDK misuse.From its SKILL.md

Install
npx -y skills add netboxlabs/skills --skill netbox-review-integration

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 14 stars14 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its file declares

Copied from the file, not written here

The file declares its own license as Apache-2.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

7.3 KB, as published. Nobody here has run it

NetBox Integration Code Review

Your knowledge of NetBox APIs may be outdated. Verify specific API behaviors, limits, and patterns against current documentation before flagging issues.

Retrieval Sources

SourceURL / MethodUse for
NetBox REST API docshttps://netboxlabs.com/docs/netbox/integrations/rest-api/Current endpoint behavior
pynetbox repohttps://github.com/netbox-community/pynetboxSDK method signatures
Diode Python SDKhttps://github.com/netboxlabs/diode-sdk-pythonIngestion API patterns
NetBox MCP serverIf configured — verify object schemas and filter availabilityField validation

Review Workflow

Follow this checklist when reviewing NetBox integration code:

  1. Verify retrieval — Check current API docs for any endpoints/patterns you're unsure about
  2. Read the full file — understand the integration's intent before flagging issues
  3. Check authentication — token format, header usage, credential storage
  4. Check pagination — all list endpoints must handle pagination
  5. Check performance — config_context exclusion, brief mode, filter specificity
  6. Check error handling — HTTP errors, rate limits, timeouts, partial failures
  7. Check data integrity — correct use of PATCH vs PUT, bulk operation atomicity
  8. Provide evidence — reference specific line numbers and explain why something is wrong

Critical Rules

Authentication (AUTH)

IDRuleSeverity
AUTH-1Use nbt_-prefixed v2 tokens on NetBox 4.5+High
AUTH-2Never hardcode tokens in source — use env vars or secrets managerCritical
AUTH-3Use Bearer prefix in Authorization header (not Token on 4.5+)High
AUTH-4Verify token has required permissions for all accessed endpointsMedium
AUTH-5Flag reliance on v1 (Token <plaintext>) tokens — deprecated in 4.6, removed in v5.0; migrate to v2. On 4.6.1+ the v2 plaintext is shown once at creation, so capture it thenHigh

Pagination (PAG)

IDRuleSeverity
PAG-1All list endpoint calls MUST handle pagination (follow next links)Critical
PAG-2Never assume all results fit in one response — even small collections growHigh
PAG-3Set explicit limit parameter — don't rely on server default (50)Medium
PAG-4GraphQL queries MUST include pagination: {limit: N} at every list levelCritical
PAG-5Nested GraphQL lists need their own pagination parametersHigh
PAG-6Prefer cursor pagination over deep offsets for large reads — REST ?start=<id> (4.6+), GraphQL pagination: {start: N, limit: M} (4.5.2+); flag deep ?offset= scansMedium

Performance (PERF)

IDRuleSeverity
PERF-1Exclude config_context from device/VM list queries (?exclude=config_context)Critical
PERF-2Use ?brief=True for reference lookups and dropdownsHigh
PERF-3Use specific filters (name__ic=, site_id=) instead of ?q= at scaleHigh
PERF-4Use ?fields= to select only needed fieldsMedium
PERF-5Parallelize independent API calls — don't serialize unrelated requestsMedium
PERF-6Use bulk endpoints (POST/PATCH/DELETE arrays) instead of per-object callsHigh
PERF-7GraphQL depth must stay ≤ 3, never exceed 5High

Error Handling (ERR)

IDRuleSeverity
ERR-1Handle HTTP 4xx/5xx responses — don't assume successCritical
ERR-2Implement retry with backoff for 429 (rate limit) and 5xx errorsHigh
ERR-3Handle partial success in bulk operations (all-or-nothing semantics)Medium
ERR-4Check response.errors on Diode ingestion responsesHigh
ERR-5Handle branch async job failures (poll until terminal status)High

Data Integrity (DATA)

IDRuleSeverity
DATA-1Use PATCH for updates — PUT replaces entire objects, clearing omitted fieldsCritical
DATA-2Include id in each object for bulk PATCH/DELETE operationsHigh
DATA-3Use natural keys (slug/name) for readability but be aware of uniqueness constraintsMedium
DATA-4Validate dependency order for REST creates (parent before child)High
DATA-5IPAddress values MUST include CIDR prefix length (/24, not bare IP)High
DATA-6For tag edits, prefer write-only add_tags/remove_tags (4.6+) over read-modify-write of the full tags list — the latter clobbers concurrent writers' tagsMedium
DATA-7For read-modify-write on a single object under concurrency, use ETag + If-Match (4.6+); a 412 response means the object changed — re-fetch and retry rather than blind overwriteMedium

Anti-Patterns to Flag

Anti-PatternWhy It MattersFix
No pagination loopSilently drops data beyond first pageFollow next links until null
?q= for bulk filteringFull-text search is slow at scaleUse specific filter expressions
PUT for partial updatesClears fields you didn't intend to changeUse PATCH
Hardcoded token in sourceSecurity vulnerabilityUse environment variable
Sequential single-object creates100x slower than bulkUse array POST to list endpoint
Ignoring config_context in list queries10-100x slower responsesAdd ?exclude=config_context
Catching bare Exception on API callsHides real errorsCatch requests.HTTPError specifically
No timeout on HTTP requestsHangs indefinitely on network issuesSet timeout=30
GraphQL without pagination paramsOmitting pagination returns all rows; pagination without limit returns Strawberry's default 100 (not the REST default of 50) — both silently differ from expectationsAlways pass pagination: {limit: N} explicitly
Polling branch jobs without backoffWastes API calls, may trigger rate limitsExponential backoff (1s → 30s)

Scope

This skill covers code that calls NetBox APIs. It does NOT cover:

Principles

  • Be certain. Retrieve current API docs before flagging version-specific issues.
  • Provide evidence. Reference line numbers and explain the actual failure mode.
  • Focus on correctness. A working integration that's slightly verbose is better than a broken clever one.
  • Severity matters. Critical issues break functionality. High issues degrade performance or reliability. Medium issues affect maintainability.
  • Don't over-flag. If code works correctly for its specific use case (e.g., small dataset that fits in one page), note the limitation but don't mark it critical.

Keep looking

Skills are one crate of 628,853. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.