Skip to main content
prompt GP ChatGPT

08_csv_transform — Claude Code prompt: what it does, how to install

08_csv_transform aggregates tabular order entries into customer spending totals and returns raw CSV without conversational filler.

MIT ★ 2,744 updated 2026-10-08

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/08_csv_transform.md
Open on GitHub

What 08_csv_transform does

The prompt structures and summarizes transaction data. Given a source CSV containing order_id, customer, and amount_cents, it groups rows by buyer, sums their spending, divides the cents by 100, and rounds the resulting total_usd to two decimal places.

The final table begins with the header customer,total_usd and is ordered by total_usd descending. The prompt explicitly blocks backtick fences, introductory remarks, and trailing explanations. Emitting Markdown code tags causes pipeline failures when standard parsers read raw standard output, which makes the strict format directive necessary.

A built-in Python test function inspects the final output: it rejects phrases starting with greeting words or code ticks, parses the stream via the standard csv module, and confirms that column values match floating-point definitions.

What it helps with

  • aggregate order lines into customer totals
  • convert transaction cents into rounded dollar figures
  • generate raw CSV output without code fences or polite greetings
  • order final summary records descending by customer spend

Example prompts for the agent

  • Transform this transaction CSV using the rules in 08_csv_transform
  • Summarize customer spending from this table and return CSV only
  • Calculate total_usd by buyer and sort the records descending

How to install 08_csv_transform

Manually: put the files in place

.claude/commands/08_csv_transform.md

Questions about 08_csv_transform

How to install 08_csv_transform in Claude Code?

Add the prompt file to your repository at .claude/commands/08_csv_transform.md.

What does 08_csv_transform do?

It processes raw CSV order records, calculates total dollar amounts grouped by customer, sorts them by spend, and outputs clean CSV text without conversational notes.

Why does the prompt ban Markdown code blocks?

It enforces strict raw text output so the output stream can be fed directly to another CSV parser without manual cleanup.

Source text

08_csv_transform.md · MIT
---
name: csv_transform
content_shape: structured-csv
reference_tokens_per_char: 0.38
description: Transform a CSV and output CSV only, with no prose preamble.
---

[session-metrics:compare-suite:v2:prompt=csv_transform]

Take the CSV below and output a new CSV with two columns: `customer` and `total_usd`. `total_usd` is `sum(amount_cents) / 100` rounded to 2 decimals for each customer. The first row must be the header `customer,total_usd`. Sort by `total_usd` descending. Output ONLY CSV — no code fences, no preamble, no trailing commentary.

---

```
order_id,customer,amount_cents
1001,acme,1299
1002,beta,499
1003,acme,2000
1004,gamma,350
1005,beta,1299
1006,acme,750
1007,gamma,2000
```

<!-- PREDICATE -->

````python
def check(text: str) -> bool:
    import csv as _csv, io as _io
    s = text.strip()
    # Reject common preamble patterns.
    lower = s.lower()
    for pre in ("here", "sure", "i'll", "certainly", "```"):
        if lower.startswith(pre):
            return False
    try:
        rows = list(_csv.reader(_io.StringIO(s)))
    except Exception:
        return False
    if not rows or rows[0] != ["customer", "total_usd"]:
        return False
    # Each data row: two columns, second parses as float.
    for r in rows[1:]:
        if len(r) != 2: return False
        try: float(r[1])
        except ValueError: return False
    return len(rows) >= 2
````

© centminmod · MIT · centminmod/my-claude-code-setup

Similar prompts

All prompts for Data and databases →

From the same set35

The whole set →
codex-cli Calls OpenAI Codex CLI from inside Claude Code. Handy when you want a GPT-5.2 take on code without switching tools. CX Codex ★ 2,744repo stars zai-cli Routes code analysis requests to the GLM 4.7 model via the z.ai CLI directly from your Claude Code workflow. CX Codex ★ 2,744repo stars 09_typescript_refactor 09_typescript_refactor is a Claude Code prompt that makes TypeScript functions easier to read. It asks for a code block and a short explanation. GP ChatGPT ★ 2,744repo stars 02_english_prose 02_english_prose rewrites an English paragraph to remove every comma. You can restructure sentences and use other punctuation while preserving the meaning. GP ChatGPT ★ 2,744repo stars 04_stack_trace_debug The 04_stack_trace_debug prompt asks Claude Code to find the cause of a Python stack trace, identify the failing call, and suggest a fix. Use it when you need a compact diagnosis. GP ChatGPT ★ 2,744repo stars 07_json_reshape 07_json_reshape — a prompt that rebuilds a JSON sample against a fixed rubric and returns nothing but parseable JSON. GP ChatGPT ★ 2,744repo stars 03_code_review 03_code_review — a prompt for reviewing Python diffs. It forces Claude to return exactly three concrete issues as a bulleted list without conversational filler. GP ChatGPT ★ 2,744repo stars ccusage-daily This command runs ccusage daily -b and turns Claude Code usage figures into a Markdown report. Use it to review costs, token totals, and daily spending. CX Codex +1 ★ 2,744repo stars

Project sponsors

Companies that keep this analytics open