governing-payload-structure

Enforce JSON object, items array, and I-JSON payload conventions.

Updated Mar 6, 2026
One-click install
npx skills add https://github.com/musher-dev/bundles --skill governing-payload-structure
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: governing-payload-structure
Source: https://github.com/musher-dev/bundles/tree/main/api-route-governance/skills/governing-payload-structure
Command: npx skills add https://github.com/musher-dev/bundles --skill governing-payload-structure

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enforces consistent and predictable API payload structures, preventing inconsistencies that lead to complex client-side parsing logic and potential integration issues.

Core Features & Use Cases

  • Enforces Top-Level Object Rule: Ensures all API responses are JSON objects, not bare arrays.
  • Standardizes Collection Wrapping: Mandates the use of an items array for collections.
  • Promotes I-JSON Compliance: Adheres to RFC 7493 for better interoperability.
  • Defines Contract Type Taxonomy: Categorizes payloads (State Representation, Desired State, etc.) for clarity.
  • Establishes Semantic Field Ontology: Guides the naming and placement of fields (identity, attributes, relationships, etc.).
  • Use Case: When designing a new API endpoint that returns a list of projects, use this Skill to ensure the response is structured as {"items": [...], "next_page_token": "...", "total_count": N} rather than a bare array [...].

Quick Start

Review the API response for the endpoint that retrieves user profiles to ensure it follows the defined payload structure conventions.

Frequently Asked Questions about governing-payload-structure

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

FAQPage Schema
Why should API payload structure be a JSON object instead of a bare array?▼

API payload structure should use a top-level JSON object to ensure consistent client-side parsing and prevent integration issues. Wrapping collections in an object with an items array allows adding metadata fields like next_page_token without breaking changes.

What is I-JSON compliance for API payloads?▼

I-JSON compliance for API payloads means adhering to RFC 7493 to guarantee better interoperability across different JSON parsers. It establishes strict rules for serializing JSON documents so that all conforming parsers interpret the structure predictably.

How do I standardize collection wrapping in API response design?▼

Standardize collection wrapping in API response design by mandating an items array within the top-level JSON object. Use a structure like {"items": [...], "next_page_token": "...", "total_count": N} rather than returning a bare array.

What is a contract type taxonomy for JSON payloads?▼

A contract type taxonomy for JSON payloads categorizes documents into state representations and commands. This classification provides clarity on the payload's purpose, distinguishing between returning current state and requesting desired state changes.

Does this API payload structure approach work without external dependencies?▼

This API payload structure approach works without external dependencies because it functions as a governance reference. It provides design rules and audit conventions for JSON payloads directly, requiring no additional libraries or frameworks to implement.

When should I audit API contract types for payload structure?▼

Audit API contract types for payload structure when designing new endpoints or reviewing existing JSON responses. This ensures adherence to envelope conventions, semantic field ontology, and I-JSON compliance before client integration begins.