Shuffle JSON Data
GitHubOfficialOriginally contributed by @jhauga as prompts/shuffle-json-data.prompt.md; moved into a skill by pull request #761Distributed by GitHub
- Skill
- Workflow
- Data and AI
- MIT
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured approach to randomizing JSON data collections. It acts as a data integrity guard, ensuring that JSON files are syntactically valid and structurally consistent before performing any shuffle operations. By default, it targets flat arrays of objects with identical property sets, but it supports custom configurations to handle specific properties, ignore fields, or manage nested structures when explicitly instructed.
What it does
- Validates JSON syntax and structural consistency before modification.
- Shuffles arrays of repetitive JSON objects at the object level.
- Enforces strict schema checks to prevent data corruption.
- Supports custom overrides for ignoring properties or defining required fields.
- Handles complex data structures when provided with specific configuration variables.
- Preserves original encoding and formatting conventions in the output.
When to use it
- When you need to randomize the order of items in a JSON dataset for testing or sampling.
- When you want to ensure data integrity during a shuffle operation.
- When working with large JSON arrays that require consistent property structures.
- When you need to exclude specific fields from the randomization process.
Advantages
- Prevents accidental data corruption through pre-shuffle validation.
- Maintains valid JSON syntax throughout the process.
- Flexible configuration allows for handling non-standard or nested JSON structures.
- Reduces manual effort in preparing randomized datasets for development or analysis.
Usage examples
- “/shuffle-json-data”
- The agent prompts the user to provide a JSON file or data structure to begin the validation and shuffling process.
- “/shuffle-json-data #file:data.json ignoreProperties = "id", "timestamp"”
- The agent validates the structure of data.json and shuffles the objects while keeping the 'id' and 'timestamp' fields intact.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/github/shuffle-json-data/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip shuffle-json-data.zip -d .agents/skills
Documentation by jhauga
Shuffle JSON Data
Overview
Shuffle repetitive JSON objects without corrupting the data or breaking JSON syntax. Always validate the input file first. If a request arrives without a data file, pause and ask for one. Only proceed after confirming the JSON can be shuffled safely.
Role
You are a data engineer who understands how to randomise or reorder JSON data without sacrificing integrity. Combine data-engineering best practices with mathematical knowledge of randomizing data to protect data quality.
Confirm that every object shares the same property names when the default behavior targets each object.
Reject or escalate when the structure prevents a safe shuffle (for example, nested objects while operating in the default state).
Shuffle data only after validation succeeds or after reading explicit variable overrides.
Objectives
Validate that the provided JSON is structurally consistent and can be shuffled without producing invalid output.
Apply the default behavior—shuffle at the object level—when no variables appear under the
Variablesheader.Honour variable overrides that adjust which collections are shuffled, which properties are required, or which properties must be ignored.
Data Validation Checklist
Before shuffling:
Ensure every object shares an identical set of property names when the default state is in effect.
Confirm there are no nested objects in the default state.
Verify that the JSON file itself is syntactically valid and well formed.
If any check fails, stop and report the inconsistency instead of modifying the data.
Acceptable JSON
When the default behavior is active, acceptable JSON resembles the following pattern:
[
{
"VALID_PROPERTY_NAME-a": "value",
"VALID_PROPERTY_NAME-b": "value"
},
{
"VALID_PROPERTY_NAME-a": "value",
"VALID_PROPERTY_NAME-b": "value"
}
]Unacceptable JSON (Default State)
If the default behavior is active, reject files that contain nested objects or inconsistent property names. For example:
[
{
"VALID_PROPERTY_NAME-a": {
"VALID_PROPERTY_NAME-a": "value",
"VALID_PROPERTY_NAME-b": "value"
},
"VALID_PROPERTY_NAME-b": "value"
},
{
"VALID_PROPERTY_NAME-a": "value",
"VALID_PROPERTY_NAME-b": "value",
"VALID_PROPERTY_NAME-c": "value"
}
]If variable overrides clearly explain how to handle nesting or differing properties, follow those instructions; otherwise do not attempt to shuffle the data.
Workflow
Gather Input – Confirm that a JSON file or JSON-like structure is attached. If not, pause and request the data file.
Review Configuration – Merge defaults with any supplied variables under the
Variablesheader or prompt-level overrides.Validate Structure – Apply the Data Validation Checklist to confirm that shuffling is safe in the selected mode.
Shuffle Data – Randomize the collection(s) described by the variables or the default behavior while maintaining JSON validity.
Return Results – Output the shuffled data, preserving the original encoding and formatting conventions.
Requirements for Shuffling Data
Each request must provide a JSON file or a compatible JSON structure.
If the data cannot remain valid after a shuffle, stop and report the inconsistency.
Observe the default state when no overrides are supplied.
Examples
Below are two sample interactions demonstrating an error case and a successful configuration.
Missing File
[user]
> /shuffle-json-data
[agent]
> Please provide a JSON file to shuffle. Preferably as chat variable or attached context.Custom Configuration
[user]
> /shuffle-json-data #file:funFacts.json ignoreProperties = "year", "category"; requiredProperties = "fact"Default State
Unless variables in this prompt or in a request override the defaults, treat the input as follows:
fileName = REQUIRED
ignoreProperties = none
requiredProperties = first set of properties from the first object
nesting = false
Variables
When provided, the following variables override the default state. Interpret closely related names sensibly so that the task can still succeed.
ignoreProperties
requiredProperties
nesting
Files
- ATTRIBUTION.mdAdded by AutoGineer1.1 KiB
- LICENSELicence file added by AutoGineer1.0 KiB
- SKILL.md4.4 KiB
Requirements and compatibility
Written for: GitHub Copilot
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Originally contributed by
@jhaugaas prompts/shuffle-json-data.prompt.mdmoved into a skill by pull request #761
- Publisher
- GitHub (Official)
- Distributed by
- GitHub
- Source
- github/awesome-copilot · skills/shuffle-json-data · commit 797337f
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
- Contributors
- jhauga
AutoGineer is not affiliated with or endorsed by jhauga or GitHub.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download shuffle-json-data.zip