interactive-script-phantom-answerslisted
Install: claude install-skill MrBinnacle/skills
# Interactive Scripts Record Phantom Answers Without a TTY
## Problem
`read` returns EOF immediately when stdin is not a terminal. It does not error. A prompting
script therefore runs to completion, prints a cheerful summary, and writes a full set of
values that **nobody supplied**.
Empty strings are the mild case — they are at least visibly empty. The dangerous case is a
**defaulted choice**. `confirm() { read -r reply; [[ "$reply" =~ ^[Yy] ]]; }` resolves to
*no* on EOF. In the output file that `no` is byte-identical to a `no` a human typed.
Measured instance, 2026-08-17: an 8-stage provisioning wizard was run through an AI harness.
All ten values were written empty and one confirm produced `REVOCATION_SUPPORTED=no`. That
flag was the answer to the single most consequential question in the setup, and a documented
plan said a `no` there would narrow a merged architecture decision. **A fabricated answer was
one step from changing an ADR.** It was caught by inspecting the output file, not by any
guard — there was none.
## Context / Trigger Conditions
- A wizard or setup script "succeeded" but its `.env` / config / report is empty or default.
- The transcript shows two prompts printed on the same line with no input between them —
the signature of back-to-back EOF reads.
- A summary line like `wrote 10 value(s)` alongside a file whose values are all blank.
- You are about to suggest running an interactive script via an AI tool, `cmd | script`,
`script < /dev/null`, CI,