Skip to content
Development
Command

/file-operation-patterns

Safe file operation patterns. Use when performing bulk file operations or writing deployment scripts.

From plugin
gsd-skill-creator
6926 skills64 agents26 commands1 MCP
Install
$ npx -y skills add Tibsfox/gsd-skill-creator --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/file-operation-patterns

Context preview

What this command does when you run it.

Safe file operation patterns. Use when performing bulk file operations or writing deployment scripts.

Command definition

file-operation-patterns.md
name: file-operation-patterns
description: Safe file operation patterns. Use when performing bulk file operations or writing deployment scripts.

File Operation Patterns

Safe Patterns

# Create directory tree (idempotent)
mkdir -p path/to/nested/dir

# Copy preserving permissions
cp -rp src/ dst/

# Atomic write (prevents partial reads)
tmpfile=$(mktemp "${target}.XXXXXX")
echo "$content" > "$tmpfile"
mv "$tmpfile" "$target"

# Safe deletion (guard variables)
[ -n "$DIR" ] && [ "$DIR" != "/" ] && rm -rf "$DIR"

# Incremental sync
rsync -av src/ dst/

Anti-Patterns

| Don't | Do | |-------|------| | `rm -rf $DIR` unguarded | Guard with `[ -n "$DIR" ]` | | Write directly to target | Write to temp, then `mv` | | Assume dir exists | `mkdir -p` first | | Ignore permissions | `cp -p` or explicit `chmod` |

Ships withgsd-skill-creator

An adaptive learning and coprocessor architecture for Claude Code, built as an extension to GSD (open-gsd)

Get the whole plugin, auto-invoked