Repository navigation
Scripts: every script answers --help, and CLAUDE.md says how to verify and ship - #128
Merged
Merged
Conversation
overlay-demo.sh, make-screenshots.sh, make-fixtures.sh and make-site-media.sh took --help for a normal run and built, recorded or synthesised, and the release scripts exited non-zero on it, so an agent could not safely ask a script what it does. Each one now prints its header comment and exits 0 when any argument is -h or --help, before it changes directory, reads an argument or builds. cask.sh and the two checks get the Usage line they lacked. scripts.yml runs --help, -h and "x --help" for every scripts/*.sh with a 5 s timeout, requires a "Usage: scripts/<name>.sh" line and a clean tree afterwards, and fails on an executable in scripts/ that is not a .sh, which the loop would miss. On Linux a script that builds or records before its check fails for want of swift, say or screencapture. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It printed the usage to stderr and exited 2, as for a mistake, so a script or an agent asking for it saw a failure. -h or --help anywhere now prints it to stdout and exits 0; no arguments and bad arguments still print it to stderr and exit 2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The verify and ship-it skills read these two sections, and without them each agent improvised how to prove and land a change. Verify gives the command per kind of change, where its output lands, the screen lock for the scripts that record, the hard states and what only a human can check. Ship gives Verify, Merge, After merge and Live check; an agent installs without asking only when the installed copy's capture log shows no recording in progress and nothing in the past 20 s, and asks otherwise. check-doc-commands.sh, run by docs.yml, fails when CLAUDE.md names a scripts/ file or a bare .sh that does not exist, or a pladder-cli command in code that main.swift has no case for, and when those case labels and the usage text disagree. The Commands list loses the overlay demo's --speed, which the app no longer reads, and gains make-screenshots.sh. Closes #123. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dinooo13
force-pushed
the
fan-out/123-safe-scripts
branch
from
November 25, 2026 19:26
f9d36ca to
8f756a0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #123
Why
Asking a script for help was not safe.
overlay-demo.sh,make-screenshots.sh,make-fixtures.shandmake-site-media.shtook--helpas an ordinary run and started a build or a recording.bundle.sh,release.sh,appcast.sh,cask.shandchangelog.shexited non-zero on it, andpladder-cli --helpexited 2. CLAUDE.md had no## Verifyor## Shipsection, which the verify and ship-it skills read, so every agent improvised how to prove and ship a change.Change
scripts/*.sh, all eleven: the first statement afterset -…o pipefailscans every argument. On-hor--helpit prints the header comment and exits 0, beforecd,mkdir, a build or a launch.cask.sh,check-doc-pointers.shandcheck-site-numbers.shget the# Usage:line they lacked.bundle.shgets only that block, away from Keep --overlay-demo and --screenshots out of the release build #124's lines..github/workflows/scripts.yml: a step in the requiredscriptsjob runs every script with--help,-handx --helpunder a 5 s timeout. It fails on a non-zero exit, on a missingUsage: scripts/<name>.shline, on files left in the tree, and on an executable inscripts/that is not a.sh(the two.swifthelpers are not executable and stay out of the rule).scripts/check-doc-commands.sh, new, in docs.yml'sdoc-pointersjob: fails when CLAUDE.md names ascripts/…path or a bare*.shthat does not exist. It also fails on apladder-cli <command>, in backticks or a fence, that is not a top-levelcaseinmain.swift, and when those labels and the usage text disagree.pladder-cli:-hor--helpanywhere prints the usage to stdout and exits 0. No arguments or bad ones still go to stderr with exit 2.CLAUDE.md:## Verify: the command for each kind of change, where its output lands, the screen lock, the hard states, and what only a human can check.## Ship: the lines Verify, Merge, After merge and Live check.--speedon the overlay-demo line is gone (the app reads--styleand--reduce-motion), and there is amake-screenshots.shline.bundle.sh --installstops the copy in use, so an agent may run it unasked only after a check from the installed copy's own log printsidle. The check reads the capture category'scapture startedandcapture stop calledand fails closed whenlog showfails. Otherwise the agent asks. Two one-line comments inAVAudioEngineCapture.swiftmark the log text as matched there.## Verifysaysoverlay-demo.shandmake-screenshots.shbuild with-DPLADDER_DEV_MODESin.build/dev-modesand a plain build has no developer modes. Keep --overlay-demo and --screenshots out of the release build #124 has merged, and this branch is rebased on it, so that is now true ofmain.Verified
--help: 33 runs (--help,-handx --helpon eleven scripts) exit 0 in 0.01–0.4 s and write nothing; a stamp file followed byfind -newershows no new files.bash -xshows onlyset, the loop,sedandexit 0.bundle.shor frommake-fixtures.shsleepbefore the block (the timeout)Usagelinex.pycheck-doc-commands.sh: passes on CLAUDE.md (47 script names, 18 commands). It exits 1 and names the line forbundel.sh,overlay-dmo.sh,bench-coordinaterandbench-releese, and when the case labels and usage text disagree. It passes onpladder-cli <audio path>,"$f",…and a\continuation.idle; with a broken predicate it prints nothing. Replaying today's log windows gave "recording" inside a real dictation andidlebetween dictations. Not checked: a recording caught live by the check itself, since no agent posts hotkey events.shellcheck scripts/*.sh,actionlint,check-doc-pointers.shandcheck-site-numbers.share clean.swift buildhas no warnings andswift testpasses all 711 tests.pladder-cli --helpand-hexit 0; no arguments exits 2.Benchmark
No code between
recordingStoppedandinsertedchanged (two comments inAVAudioEngineCapture.swift), so no benchmark.Review loop
Round 1 found three real problems, all fixed:
idlewhenlog showfailed\as commandspladder-cliprefix, so the check never saw themIt also raised nits, fixed. Declined: dropping the executable-but-not-
.shguard and the usage-versus-case-labels self-check. The first keeps a new script from skipping the--helpcheck by its name; the second keeps the doc check from passing on an empty list.🤖 Generated with Claude Code