payload-optimization

Remove null, undefined, and empty values from nested API response payloads.

7|Updated Dec 4, 2025
One-click install
npx skills add https://github.com/planetaryescape/blah.chat --skill payload-optimization
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: payload-optimization
Source: https://github.com/planetaryescape/blah.chat/tree/main/.claude/skills/payload-optimization
Command: npx skills add https://github.com/planetaryescape/blah.chat --skill payload-optimization

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill reduces API payload size by removing dead weight from data responses. It recursively strips null, undefined, empty strings, empty arrays, and empty objects, ensuring only meaningful data is transmitted.

Core Features & Use Cases

  • Automatic data compaction: recursively remove null/undefined/empty values from nested objects and arrays.
  • Integration with API layers: works with formatEntity and payload utilities to reduce network traffic.
  • Real-world scenario: optimize responses in high-latency or high-traffic APIs to save bandwidth and improve performance.

Quick Start

Use the compact() function on an API response payload to strip dead weight before sending to clients.

Frequently Asked Questions about payload-optimization

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

FAQPage Schema
How do I remove null and undefined values from API response payloads in TypeScript?

To remove null and undefined values from API response payloads, you can use a recursive compaction function that strips null, undefined, empty strings, empty arrays, and empty objects from complex nested data structures before transmitting them.

What is the best way to reduce API payload size for high-traffic endpoints?

The best way to reduce API payload size for high-traffic endpoints is applying recursive data compaction to responses, automatically stripping empty values and dead weight from nested objects and arrays to minimize bandwidth and improve network performance.

How do I clean empty arrays and objects from nested SSE streaming data?

To clean empty arrays and objects from nested SSE streaming data, apply a recursive compaction utility that traverses the streaming data structure and removes empty values, ensuring only meaningful data is transmitted to the client.

Does payload compaction alter essential fields in my API responses?

Payload compaction does not alter essential fields in API responses. It only removes null, undefined, and empty values from the data structure, integrating seamlessly with pick and omit utilities without modifying your existing meaningful data.

Can I integrate data compaction with existing formatEntity and pick utilities?

You can integrate data compaction with existing formatEntity and pick utilities. The compaction function works alongside these payload utilities to strip dead weight from API responses without disrupting your current data formatting workflows.

What are the limitations of recursively stripping empty values from API payloads?

A limitation of recursively stripping empty values from API payloads is that it removes all empty strings, arrays, and objects indiscriminately. If your client logic expects empty structures to exist as placeholders, this compaction could cause unexpected behavior.