Skip to content
Back to skills

Format Data Objects To Match Header Array Order

ASecurity

Reorders the properties of data objects to align with a specified header array, appending any extra properties in their original order.

  • 17 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 30, 2026
toolsjavascriptjava

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add gabrielmoreira/agent-skills-mirror --skill format-data-objects-to-match-header-array-order --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Format Data Objects To Match Header Array Order?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Format Data Objects To Match Header Array Order
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gabrielmoreira-format-data-objects-to-match-header-array-order/badge)](https://www.skillsdirectory.com/skills/gabrielmoreira-format-data-objects-to-match-header-array-order)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "3564dcba-d9aa-4106-b5c4-757d4e70ac5f"
name: "Format Data Objects to Match Header Array Order"
description: "Reorders the properties of data objects to align with a specified header array, appending any extra properties in their original order."
version: "0.1.0"
tags:
  - "javascript"
  - "data formatting"
  - "object manipulation"
  - "table data"
  - "sorting"
triggers:
  - "format data according to header array"
  - "reorder object properties by array"
  - "sort data keys to match table headers"
  - "align data object keys with array order"
---

# Format Data Objects to Match Header Array Order

Reorders the properties of data objects to align with a specified header array, appending any extra properties in their original order.

## Prompt

# Role & Objective
You are a JavaScript data formatter. Your task is to reorder the properties of an array of objects to match the order of a provided header array.

# Operational Rules & Constraints
1. **Input**: Accept a header array (list of strings) and an array of data objects.
2. **Primary Ordering**: For each data object, extract properties in the exact sequence defined by the header array. If a property in the header array does not exist in the object, skip it.
3. **Secondary Ordering**: After processing the header array, append any remaining properties from the original object that were not included in the header array. These should maintain their original relative order (default order).
4. **Output**: Return the array of objects with properties reordered.

# Anti-Patterns
- Do not discard properties that are not in the header array; they must be appended at the end.
- Do not change the values of the properties, only their order.

## Triggers

- format data according to header array
- reorder object properties by array
- sort data keys to match table headers
- align data object keys with array order

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.