Pitch
Today sp new always shells out to $EDITOR — perfect for interactive use, useless in a pipeline or from another tool/AI agent. There's no way to say "take this text and stash it as a scratch" without a human opening an editor. Add a headless capture path so scratchpatch can ingest content programmatically:
pytest -q 2>&1 | sp new failing-tests --stdin --tag ci
sp new note --stdin <<'EOF'
remember to revoke that token
EOF
curl -s https://api.example.com/thing | sp new resp --ext json --stdin
This turns scratchpatch into a sink for throwaway output (logs, API responses, generated snippets), which is squarely on-mission ("give every throwaway a home with an expiry") and directly serves the AI-agent-hygiene angle from PLAN.md — agents can park temp output in the reaped store instead of littering the repo.
Why it fits
- Reuses the exact create/index path
sp new already uses; only difference is content comes from stdin (or --content/--from-file) instead of an editor round-trip.
- Composes with the existing secret tripwire: piped-in content should still get scanned so a secret gets flagged (🔑) at capture time.
- Pure additive flag on an existing command; interactive
sp new behavior unchanged when --stdin is absent.
Acceptance criteria
Pitch
Today
sp newalways shells out to$EDITOR— perfect for interactive use, useless in a pipeline or from another tool/AI agent. There's no way to say "take this text and stash it as a scratch" without a human opening an editor. Add a headless capture path so scratchpatch can ingest content programmatically:This turns scratchpatch into a sink for throwaway output (logs, API responses, generated snippets), which is squarely on-mission ("give every throwaway a home with an expiry") and directly serves the AI-agent-hygiene angle from PLAN.md — agents can park temp output in the reaped store instead of littering the repo.
Why it fits
sp newalready uses; only difference is content comes from stdin (or--content/--from-file) instead of an editor round-trip.sp newbehavior unchanged when--stdinis absent.Acceptance criteria
sp new [name] --stdinreads content from standard input and creates the scratch without launching$EDITOR.--ttl,--ext,--tagflags on the same invocation.--content "<text>"for a one-liner and/or--from-file <path>to seed from an existing file (pick at least--stdin; the others are nice-to-have if cheap).sp new(still leads with the stablecreated scratch <id>anchor so scripts/tests keep working).sp lsshows the 🔑 marker andsp promoteguards it, same as editor-created scratches.--stdin+ a TTY with no piped input doesn't hang forever (guard/allow but document).go build/go vet/go test ./.../gofmtclean.