Reference

Finish-check card

The compressed form of lesson 1. Keep it next to the chat when you write a prompt.

The test

A finish condition can be false. If no run could fail it, it is a wish.

SentenceCan it fail?
Each id appears once in the written fileYes. Count the ids.
The row count matches the fixtureYes. Count the rows.
Make the export betterNo. Nothing comes out wrong.
Work on it for an hourNo. A duration is not a result.
It compilesThe build can fail, and that still says nothing about the file.

Prompt, five slots

/poteto-mode shelf writes one title twice.   # goal
repro first. do not fix it yet.              # constraint
done means each id appears once.             # finish condition
show me the rows.                            # proof
# leave out: your hunch about the cause

From the prompt page. You do not name a playbook. /poteto-mode matches one.

Match the check to the change

ChangeThe check reads
A commandThat command, run for real
A screenThe flow, in the running app
A parser or a migrationA saved input, replayed
A speed changeA profile before and after
A stored valueThe value, read back

Source: Verify the result and open a PR. If the check could not run, the honest word is inconclusive.

Where it breaks

A passed check means the artifact met that sentence. It does not mean the code is good. Unique ids can still carry the wrong title.

What a check looks like

One way to make "each id appears once" able to fail. It reads the written file. It leaves out quoting, commas inside titles, and a test runner.

export function findDuplicates(csvText) {
  // 1. The artifact, not the source. csvText is out/shelf.csv.
  const ids = csvText.trim().split('\n').slice(1)
    .map((line) => line.split(',')[0]);
  // 2. Count. A finish condition needs a number that can be too high.
  const seen = new Map();
  for (const id of ids) seen.set(id, (seen.get(id) ?? 0) + 1);
  // 3. Only the ids that make the process exit 1.
  return [...seen].filter(([, n]) => n > 1).map(([id]) => id);
}

A real run of the same file, Node 22.22.2: 4 data rows, duplicate bk-014, exit 1. A function that ignores the file and returns [] exits 0. That passing exit is not evidence.

Same sources