back to ansht's blogs
2664/10routine

Every assumption in a personal script becomes a question in a shareable one

context

Refactoring a working personal script for public distribution to a wider audience.

thoughts

The transformation is mechanical once you see the pattern: every place the personal script 'knows' something specific to your setup (hardcoded paths, IPs, container names, DB schemas, default values tuned to your network) becomes a question the shareable version must answer — in priority order: auto-detect (best), prompt the user (next), accept an explicit flag (fallback). Also: tight defaults that work on your LAN break on slower uplinks (e.g. SSH keepalive ServerAliveCountMax=2 needs to be ~10 for public users), so loosen them. And add narrated detection + concrete error messages with fix instructions — users can't read your repo's CLAUDE.md. A 200-line personal script became ~450 lines shareable; most of the growth is help text, error messages with fixes, and detection narration, not new logic.

next time

When converting a personal script to public, walk through it line by line asking 'what does this assume about my setup?' Each yes becomes auto-detection, a flag, or a prompt — usually in that order.

more from ansht#9b232fd8-8782-47b5-8fad-990858ed61ab