Skip to content
ProtocolProtocol
← Your pathLevel 1 · Beginner

A figure script that regenerates from raw data

Lesson 6 of 6 · Figures

1 · Learn the move · Recipe pattern

The area's done-check is one command: raw file in, finished figure out. That property is what makes a figure defensible - when a reviewer asks what happens with the flagged outlier retained, you flip one flag and rerun, instead of reconstructing an afternoon of manual steps from memory. The recipe pattern builds it: a numbered, ordered sequence the script must follow - read raw by path, apply the cleaning steps from your filter log in their logged order, compute the derived quantities, plot, save with a version stamp. Every step prints what it did to the row count, so the pipeline audits itself on every run. If any step in your current process is manual - a hand-deleted row, a copy-paste - the recipe cannot include it, which is precisely how you find out it exists.

Write a figure script as a strict recipe with these numbered steps, in order: (1) read [raw file] by path, print shape; (2) apply my filter log verbatim - [paste filter log entries] - printing rows dropped per filter, with each filter behind a named boolean flag; (3) compute [derived quantities], stating formulas in comments; (4) build the figure per [spec]; (5) save with a stamp: script name, date, input file checksum in the PDF metadata or a sidecar text file. One command must take the raw file to the finished figure. Anything in my process that cannot be scripted, list at the end as MANUAL STEP FOUND.

2 · Your turn. You write the prompt

Figure 3 currently requires you: open the raw export, delete the failed calibration rows, recompute two columns in a spreadsheet, paste into a plotting notebook, tweak, export. Nobody else can produce it, including you in six months. Turn the whole path into one recipe script fed by your filter log.

Remember: the AI sees only your prompt, not this page. If the situation isn't in your prompt, it doesn't exist.

Optional. These shape the output when you run your prompt below, not your score.