skills/cleanup-scripts/SKILL.md
Session-scoped script cleanup for data science projects. Checks scripts/scratch/ for working files that need consolidation into .qmd scripts, flags numbered non-.qmd files in scripts/, and verifies script-output directory correspondence. Use when finishing a coding session, when scripts/scratch/ has accumulated files, or when the user says "clean up scripts", "consolidate scratch", or "check script conventions". Lightweight and fast — reads files, no expensive computation.
npx skillsauth add musserlab/lab-claude-skills cleanup-scriptsInstall 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.
Check and consolidate working scripts from the current session. This skill focuses
on the current session's work — for project-wide script health, use /audit-project.
/done at the end of a coding sessionscripts/scratch/ has accumulated working filesscripts/scratch/List all files in scripts/scratch/. For each file:
.qmd script this code belongs to. If no matching script exists, it may need a new numbered .qmd..qmd chunk (using the quarto-docs skill template) and add it to the target script. Or create a new numbered .qmd if needed.If scripts/scratch/ is empty or doesn't exist, report "No scratch files" and move on.
Scan scripts/ (not subdirectories) for files that violate conventions:
.qmd files: Files matching [0-9]*_*.R, [0-9]*_*.py, [0-9]*_*.Rmd in scripts/. On local, these should be .qmd — unless they carry a # allow-py: <reason> override comment in the first 20 lines, in which case .py is sanctioned. On the cluster, .py is the default and is fine without the override. Helpers belong in R//python/; superseded scripts in scripts/old/.scripts/old/, scripts/scratch/, scripts/exploratory/, unnumbered files (legacy).For each violation:
.qmd, move to helper dir (R/ or python/), or archive to scripts/old/?For each numbered .qmd in scripts/:
15 from 15a_threshold.qmd).outs/{number}_{topic}/ exists (using the lettered script convention — all scripts with the same number share one output dir).status: development).For each output directory in outs/:
scripts/.Summarize:
/audit-project..Rmd files in scripts/ are legacy — do not flag them as violations.enforce-qmd-scripts.sh hook blocks creation of numbered non-.qmd files unless the file content carries a # allow-py: <reason> override comment in its first 20 lines. The hook auto-skips on the cluster (detected by /nfs/roberts/), where .py is the default. This skill catches anything that slipped through, pre-dates the hook, or used the override.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.