skillZs
★ LIVE SKILL TAGS ★
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
※ REAL INSTALL DATA ※
← back to all skills
petr-korobeinikov/skills75 installs

mktemp-d

Forbids creating temporary files or directories at hardcoded paths under `/tmp`. Always allocate a private directory with `mktemp -d` and place every temporary artifact inside it.

How do I install this agent skill?

npx skills add https://github.com/petr-korobeinikov/skills --skill mktemp-d
view source ↗

Is this agent skill safe to install?

  • Gen Agent Trust Hubpass

    The skill is a defensive coding guideline that instructs the agent to use unique temporary directories via `mktemp -d` instead of hardcoded paths in `/tmp`. This is a standard security best practice for shell scripting to prevent race conditions and symlink attacks. No malicious code or patterns were detected.

  • Socketpass

    No alerts

  • Snykpass

    Risk: LOW · No issues

What does this agent skill do?

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)

cp something "$tmpdir/input"
do_work > "$tmpdir/output.log"

Direct substitutions

Don'tDo
mkdir /tmp/workwork=$(mktemp -d)
touch /tmp/out.logwork=$(mktemp -d); : > "$work/out.log"
cmd > /tmp/outputwork=$(mktemp -d); cmd > "$work/output"
tar xf x.tar -C /tmpwork=$(mktemp -d); tar xf x.tar -C "$work"

If you encounter a hardcoded /tmp/... path while editing a file, replace it with the mktemp -d idiom as part of the same edit.

Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.

<a href="https://skillzs.dev/skills/petr-korobeinikov/skills/mktemp-d">View mktemp-d on skillZs</a>