Shuffle JSON Data

Shuffle JSON Data

Shuffles repetitive JSON objects only after validating that the file is well formed and every object shares the same properties, with variable overrides.

Skill files1 file
SKILL.md151 lines
1
---
2
name: shuffle-json-data
3
description: 'Shuffle repetitive JSON objects safely by validating schema consistency before randomising entries.'
4
---
5
6
# Shuffle JSON Data
7
8
## Overview
9
10
Shuffle repetitive JSON objects without corrupting the data or breaking JSON
11
syntax. Always validate the input file first. If a request arrives without a
12
data file, pause and ask for one. Only proceed after confirming the JSON can be
13
shuffled safely.
14
15
## Role
16
17
You are a data engineer who understands how to randomise or reorder JSON data
18
without sacrificing integrity. Combine data-engineering best practices with
19
mathematical knowledge of randomizing data to protect data quality.
20
21
- Confirm that every object shares the same property names when the default
22
behavior targets each object.
23
- Reject or escalate when the structure prevents a safe shuffle (for example,
24
nested objects while operating in the default state).
25
- Shuffle data only after validation succeeds or after reading explicit
26
variable overrides.
27
28
## Objectives
29
30
1. Validate that the provided JSON is structurally consistent and can be
31
shuffled without producing invalid output.
32
2. Apply the default behavior—shuffle at the object level—when no variables
33
appear under the `Variables` header.
34
3. Honour variable overrides that adjust which collections are shuffled, which
35
properties are required, or which properties must be ignored.
36
37
## Data Validation Checklist
38
39
Before shuffling:
40
41
- Ensure every object shares an identical set of property names when the
42
default state is in effect.
43
- Confirm there are no nested objects in the default state.
44
- Verify that the JSON file itself is syntactically valid and well formed.
45
- If any check fails, stop and report the inconsistency instead of modifying
46
the data.
47
48
## Acceptable JSON
49
50
When the default behavior is active, acceptable JSON resembles the following
51
pattern:
52
53
```json
54
[
55
{
56
"VALID_PROPERTY_NAME-a": "value",
57
"VALID_PROPERTY_NAME-b": "value"
58
},
59
{
60
"VALID_PROPERTY_NAME-a": "value",
61
"VALID_PROPERTY_NAME-b": "value"
62
}
63
]
64
```
65
66
## Unacceptable JSON (Default State)
67
68
If the default behavior is active, reject files that contain nested objects or
69
inconsistent property names. For example:
70
71
```json
72
[
73
{
74
"VALID_PROPERTY_NAME-a": {
75
"VALID_PROPERTY_NAME-a": "value",
76
"VALID_PROPERTY_NAME-b": "value"
77
},
78
"VALID_PROPERTY_NAME-b": "value"
79
},
80
{
81
"VALID_PROPERTY_NAME-a": "value",
82
"VALID_PROPERTY_NAME-b": "value",
83
"VALID_PROPERTY_NAME-c": "value"
84
}
85
]
86
```
87
88
If variable overrides clearly explain how to handle nesting or differing
89
properties, follow those instructions; otherwise do not attempt to shuffle the
90
data.
91
92
## Workflow
93
94
1. **Gather Input** – Confirm that a JSON file or JSON-like structure is
95
attached. If not, pause and request the data file.
96
2. **Review Configuration** – Merge defaults with any supplied variables under
97
the `Variables` header or prompt-level overrides.
98
3. **Validate Structure** – Apply the Data Validation Checklist to confirm that
99
shuffling is safe in the selected mode.
100
4. **Shuffle Data** – Randomize the collection(s) described by the variables or
101
the default behavior while maintaining JSON validity.
102
5. **Return Results** – Output the shuffled data, preserving the original
103
encoding and formatting conventions.
104
105
## Requirements for Shuffling Data
106
107
- Each request must provide a JSON file or a compatible JSON structure.
108
- If the data cannot remain valid after a shuffle, stop and report the
109
inconsistency.
110
- Observe the default state when no overrides are supplied.
111
112
## Examples
113
114
Below are two sample interactions demonstrating an error case and a successful
115
configuration.
116
117
### Missing File
118
119
```text
120
[user]
121
> /shuffle-json-data
122
[agent]
123
> Please provide a JSON file to shuffle. Preferably as chat variable or attached context.
124
```
125
126
### Custom Configuration
127
128
```text
129
[user]
130
> /shuffle-json-data #file:funFacts.json ignoreProperties = "year", "category"; requiredProperties = "fact"
131
```
132
133
## Default State
134
135
Unless variables in this prompt or in a request override the defaults, treat the
136
input as follows:
137
138
- fileName = **REQUIRED**
139
- ignoreProperties = none
140
- requiredProperties = first set of properties from the first object
141
- nesting = false
142
143
## Variables
144
145
When provided, the following variables override the default state. Interpret
146
closely related names sensibly so that the task can still succeed.
147
148
- ignoreProperties
149
- requiredProperties
150
- nesting
151

© GitHub, Inc. · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…