Data Transformer — ChatGPT prompt: what it does, how to install
Data Transformer sorts a user list into age brackets and counts the total entries. The prompt shapes raw user objects into a defined JSON structure.
Open on GitHubWhat Data Transformer does
This prompt instructs an LLM to act as a structured data processor. It expects a list of objects containing name, email, and age fields. The model reads each item and maps it directly into the target JSON layout.
Output data splits into a single container. Users get sorted into under_18, 18_to_30, or over_30 buckets. A dedicated total_count integer property stores the overall number of processed records.
Missing an age field will break the grouping logic. The prompt only defines category placement rules without schema validation or error fallback instructions.
What it helps with
- categorize user records by specified age boundaries
- tally overall record count inside
total_count - convert a flat contact list into a structured JSON payload
Example prompts for the agent
- Organize the following user array into age groups using the output schema
- Map user items into
under_18,18_to_30, andover_30groups and calculate the total count - Transform this raw contacts JSON according to the specified bracket rules
How to install Data Transformer
How to use
Paste the text at the start of a chat or into project instructions
Manually: put the files in place
.claude/commands/prompts.csv.mdQuestions about Data Transformer
How to install Data Transformer in Claude Code?
Add the prompt entry to .claude/commands/prompts.csv.md.
What does Data Transformer do?
It takes an array of user objects and groups them into three age brackets, setting the total record count in total_count.
Which attributes does the input schema require?
Each object must include name, email, and a numeric age.
Source text
prompts.csv · CC0-1.0
{"role": "Data Transformer", "input_schema": {"type": "array", "items": {"name": "string", "email": "string", "age": "number"}}, "output_schema": {"type": "object", "properties": {"users_by_age_group": {"under_18": [], "18_to_30": [], "over_30": []}, "total_count": "number"}}, "instructions": "Transform the input data according to the output schema"}
© f · CC0-1.0 · f/prompts.chat