file-operation-safety
CRITICAL SAFETY SKILL - Use this skill before any file system operation that deletes, moves, or overwrites files. Activate when the user wants to rm, mv, cp (with overwrite), clear directories, or perform bulk file operations. This skill prevents accidental file loss through verification and confirmation protocols.
What this skill does
# File Operation Safety
**CRITICAL: File deletions can be permanent. This skill prevents irreversible file loss.**
## Danger Levels
| Level | Operations | Requires |
|-------|------------|----------|
| โ CRITICAL | `rm -rf`, recursive delete on directories | Full path verification + explicit confirmation |
| ๐ด HIGH | `rm` multiple files, `mv` with overwrite | List all files + confirmation |
| ๐ MEDIUM | `rm` single file, `cp` with overwrite | Verify file exists + confirm |
| ๐ข LOW | `cp` to new location, `mkdir`, `touch` | Standard execution |
## Pre-Operation Protocol
### Before ANY Deletion
**Step 1: Verify the path**
```bash
# ALWAYS expand and verify the path first
realpath /path/to/target
ls -la /path/to/target
# Check what's inside (for directories)
find /path/to/target -type f | wc -l # Count files
du -sh /path/to/target # Check size
```
**Step 2: Present impact to user**
```markdown
## File Deletion Impact Assessment
**Command:** rm -rf ./node_modules
**Resolved path:** /Users/dev/myproject/node_modules
**Contents:**
- Total files: 45,234
- Total directories: 8,901
- Total size: 234 MB
- Contains hidden files: Yes (.cache, .bin)
**Can be recreated:** Yes (via `npm install`)
Proceed with deletion? Type "yes, delete node_modules" to confirm.
```
### For Critical Operations
#### rm -rf on Directory
```markdown
โ **CRITICAL: RECURSIVE DELETE REQUESTED**
**Command:** rm -rf /var/www/myapp
**โ ๏ธ FULL PATH CHECK:**
- Requested path: /var/www/myapp
- Resolved path: /var/www/myapp
- Parent directory: /var/www (contains 3 other directories)
- Is symlink: No
**Contents to be deleted:**
- Files: 1,234
- Directories: 89
- Size: 456 MB
- Includes:
- Source code (*.js, *.ts): 234 files
- Configuration (*.json, *.yml): 12 files
- Environment files (.env): 1 file โ ๏ธ
- Uploaded files (uploads/): 567 files โ ๏ธ
**Recovery:**
- Git repository: Yes (can recover source code)
- Uploads folder: NO GIT โ ๏ธ (not recoverable)
- .env file: NO GIT โ ๏ธ (not recoverable)
**Before deletion, I recommend:**
1. Backup uploads folder: `cp -r uploads /backup/uploads_$(date +%Y%m%d)`
2. Backup .env: `cp .env /backup/.env_$(date +%Y%m%d)`
Proceed with deletion after backup? Type "yes, delete /var/www/myapp after backup" to confirm.
```
#### rm on Home Directory or Root
```markdown
โโโ **EXTREME DANGER: CATASTROPHIC PATH DETECTED**
**Command:** rm -rf ~/ (or /, /home, /usr, /etc, /var)
**๐ซ I WILL NOT EXECUTE THIS COMMAND.**
This would delete:
- Your entire home directory
- All personal files, documents, and configurations
- SSH keys, credentials, and secrets
- Potentially your entire system
**This is almost certainly a mistake.**
If you need to clean up:
- Specify exact subdirectories to delete
- Use `rm -rf ~/specific/directory` instead
- Never use wildcards at root level
**I will not proceed with this request under any circumstances.**
```
#### rm with Wildcards
```markdown
๐ด **DANGEROUS: WILDCARD DELETION**
**Command:** rm -rf *.log
**Working directory:** /var/log/myapp
**Files matching pattern:**
1. access.log (234 MB)
2. error.log (45 MB)
3. debug.log (12 MB)
4. app.2024-01-15.log (5 MB)
5. app.2024-01-14.log (4 MB)
... and 23 more files
**Total files:** 28
**Total size:** 345 MB
**Potential issues:**
- Pattern `*.log` is broad - verify these are all logs you want to delete
- Some may be needed for debugging recent issues
- Rotating logs may have important history
**Safer alternatives:**
```bash
# Delete only old logs
find . -name "*.log" -mtime +30 -delete
# Keep recent logs
rm -f *.log.2023*
```
Proceed with deleting all 28 .log files? Type "yes, delete 28 log files" to confirm.
```
### Moving Files (Overwrite Risk)
```markdown
## File Move Impact Assessment
**Command:** mv ./config.json ./backup/config.json
**โ ๏ธ OVERWRITE WARNING:**
A file already exists at the destination!
**Source file:**
- Path: ./config.json
- Size: 2.3 KB
- Modified: 2024-01-16 14:30:00
**Destination file (WILL BE OVERWRITTEN):**
- Path: ./backup/config.json
- Size: 1.8 KB
- Modified: 2024-01-15 09:00:00
**Differences detected:** Yes (source is newer and larger)
**Options:**
1. Overwrite (lose old backup)
2. Rename destination first: `mv ./backup/config.json ./backup/config.json.old`
3. Use versioned name: `mv ./config.json ./backup/config.$(date +%Y%m%d).json`
4. Cancel
Choose an option or type "yes, overwrite backup/config.json" to proceed with overwrite.
```
### Copying with Overwrite
```markdown
## File Copy Impact Assessment
**Command:** cp -r ./src ./backup/src
**โ ๏ธ DIRECTORY OVERWRITE WARNING:**
The destination directory already exists!
**Source directory:**
- Path: ./src
- Files: 234
- Size: 12 MB
**Destination directory (contents may be OVERWRITTEN):**
- Path: ./backup/src
- Files: 198
- Size: 10 MB
- Modified: 2024-01-14 16:00:00
**What will happen:**
- 198 existing files may be overwritten with newer versions
- 36 new files will be added
- 0 files in destination will be deleted (cp doesn't delete)
**Safer alternatives:**
```bash
# Create versioned backup
cp -r ./src ./backup/src_$(date +%Y%m%d_%H%M%S)
# Use rsync for smarter sync
rsync -av --backup --suffix=.bak ./src/ ./backup/src/
```
Choose approach or type "yes, overwrite backup/src" to proceed.
```
## Safe Patterns
### Safe Deletion with Confirmation
```bash
# Interactive deletion (asks for each file)
rm -i file1 file2 file3
# Show what would be deleted (dry run)
find /path -name "*.tmp" -print # Preview
find /path -name "*.tmp" -delete # Execute after verification
# Move to trash instead of permanent delete
# macOS
mv file ~/.Trash/
# Linux (with trash-cli)
trash-put file
```
### Safe Directory Cleanup
```bash
# Never use: rm -rf *
# Instead, be explicit:
rm -rf ./node_modules
rm -rf ./dist
rm -rf ./.cache
# Or use a list:
DIRS_TO_CLEAN="node_modules dist .cache"
for dir in $DIRS_TO_CLEAN; do
echo "Deleting: $dir"
rm -rf "./$dir"
done
```
### Backup Before Risky Operations
```bash
# Create timestamped backup
BACKUP_DIR="./backups/$(date +%Y%m%d_%H%M%S)"
mkdir -p "$BACKUP_DIR"
cp -r ./important_folder "$BACKUP_DIR/"
# Then proceed with risky operation
rm -rf ./important_folder
```
## Protection Mechanisms
### Alias Safeguards (Add to .bashrc/.zshrc)
```bash
# Make rm interactive by default
alias rm='rm -i'
# Require verbose output for dangerous operations
alias rm='rm -iv'
alias mv='mv -iv'
alias cp='cp -iv'
# Prevent recursive operations on root
alias rm='rm --preserve-root'
# Add confirmation for rf
rmrf() {
echo "โ ๏ธ About to delete: $@"
echo "Files: $(find "$@" -type f 2>/dev/null | wc -l)"
read -p "Are you sure? (yes/no) " confirm
if [ "$confirm" = "yes" ]; then
rm -rf "$@"
else
echo "Aborted"
fi
}
```
### Safe Delete Function
```bash
# Safe delete with trash support
safe_delete() {
local target="$1"
local trash_dir="${HOME}/.local/share/Trash/files"
if [ ! -e "$target" ]; then
echo "Error: $target does not exist"
return 1
fi
# Show what will be deleted
echo "Target: $(realpath "$target")"
if [ -d "$target" ]; then
echo "Type: Directory"
echo "Files: $(find "$target" -type f | wc -l)"
echo "Size: $(du -sh "$target" | cut -f1)"
else
echo "Type: File"
echo "Size: $(ls -lh "$target" | awk '{print $5}')"
fi
echo ""
read -p "Move to trash? (yes/no) " confirm
if [ "$confirm" = "yes" ]; then
mkdir -p "$trash_dir"
mv "$target" "$trash_dir/$(basename "$target").$(date +%s)"
echo "Moved to trash. Recover from: $trash_dir"
else
echo "Aborted"
fi
}
```
## Common Dangerous Patterns to Block
| Pattern | Risk | Safe Alternative |
|---------|------|------------------|
| `rm -rf /` | System destruction | Never execute |
| `rm -rf ~` | Home directory loss | Be specific: `rm -rf ~/Downloads/temp` |
| `rm -rf *` | Current directory wipe | List files explicitly |
| `rm -rf .` | Current directory wipe | `rm -rf ./specific-folder` |
| `rm -rf ..` | Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.