skills/file-safety/SKILL.md
File modification rules to prevent overwriting important files. Use when overwriting existing files, deleting files, or writing to directories that contain important data (data/, outs/). Also applies when moving or renaming files that other scripts depend on.
npx skillsauth add musserlab/lab-claude-skills file-safetyInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
_updated, _with_new_column)Never create standalone scripts solely to modify outputs from other scripts.
If modifications are needed:
Do NOT create intermediate "fixer" scripts that modify upstream outputs after the fact — this breaks the reproducibility chain between scripts and their outputs.
If you're not sure whether a file is safe to overwrite, ask:
These additional rules apply in projects with project-type: data-science or that use the script-organization conventions (numbered scripts, data/ for inputs, outs/ for outputs).
Each script writes only to its own output folder under outs/. Never write to another script's output folder.
# Script 03_plots.qmd writes ONLY to:
out_dir <- here("outs/03_plots")
# NEVER write to another script's folder:
# here("outs/01_analysis/modified_data.rds") # WRONG
data/ is Read-OnlyScripts never write to data/. This directory contains only external/immutable inputs (raw data, collaborator files, annotations). If your code produced it, it goes in outs/.
# BAD: Creating a script to add Gene.short to another script's output
# This disconnects the file from the script that produced it
# GOOD: Downstream plotting script joins against lookup at runtime
limma_res <- readRDS(here("outs/01_analysis/limma_results_annotated.rds")) %>%
left_join(gene_name_lookup, by = "trinity_gene_id")
development
Phylogenetic tree visualization and formatting with ggtree (R) or iTOL (web). Use when rendering a phylogenetic tree as a figure, choosing tree layout, coloring branches or labels by taxonomy, collapsing clades, displaying support values, or adding overlays to a tree. Do NOT load for tree inference (use protein-phylogeny skill) or domain annotation (future separate skill).
development
Configure and manage Claude Code security protections for sensitive files, credentials, and data. Use when the user invokes /security-setup to set up or modify protections against unauthorized file access, credential exposure, or sensitive data leaks.
development
Script organization for data science analysis projects with numbered scripts, data/outs/ directories, and reproducibility conventions. Use when creating new analysis scripts in projects that follow data science conventions (numbered XX_ prefix scripts, outs/ directories, BUILD_INFO.txt). Do NOT load for documentation projects (Quarto books), infrastructure repos, or projects without data/outs/ directory structure.
testing
R renv package management for data science projects. Use when working with renv (renv.lock, renv::restore, renv::snapshot) in R analysis projects. Do NOT load for projects that do not use R or renv.