mktemp-d
Installation
SKILL.md
mktemp-d
Never create a temporary file or directory at a hardcoded path
under /tmp.
Always allocate a private directory with mktemp -d
and place all temporary artifacts inside it.
Why
mktemp -d returns a unique, private directory.
A hardcoded path under /tmp does not —
it collides with concurrent runs and any leftover state from prior runs.
Rule
One mktemp -d per logical scope, then build paths inside it:
tmpdir=$(mktemp -d)