agentsclimarketplace

Mktemp d

Skill petr-korobeinikov/skills/skills/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.From its SKILL.md

Install
npx -y skills add petr-korobeinikov/skills --skill mktemp-d

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

1.7 KB, 288 tokens by cl100k_base, as published. Nobody here has run it

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.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.