Skip to content
Development
Skill

/file-operation-patterns

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

From plugin
gsd-skill-creator
70102 skills61 agents26 commands1 MCP
Install
$ npx -y skills add Tibsfox/gsd-skill-creator --skill file-operation-patterns --agent claude-code

How it fires

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

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/file-operation-patterns

Context preview

The summary Claude sees to decide when to auto-load this skill.

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

SKILL.md

file-operation-patterns.SKILL.md
name: file-operation-patterns
description: Safe file operation patterns. Use when performing bulk file operations or writing deployment scripts.
version: 1.0.0
format: 2025-10-02
triggers:
  - performing bulk file operations or writing deployment scripts
updated: 2026-04-25
status: ACTIVE

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

Other skills on gsd-skill-creator.