No slash command · from lab-skills
Create a new Claude Code skill with proper structure and effective description. Use when creating a new skill, or when the /done skill proposes a new skill and the user approves. Also use when refactoring CLAUDE.md content into a skill.
Ships in lab-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Follow these steps when creating a new skill, whether proposed during /done or requested directly.
Before creating, verify the pattern actually warrants a skill (not just a CLAUDE.md entry):
If it's a simple one-liner convention, put it in the project CLAUDE.md instead.
Ask the user if not already decided:
{project}/.claude/skills/{name}/SKILL.md) — Specific to one project. Examples: gene naming conventions, project-specific data formats, project-specific workflows.~/.claude/skills/{name}/SKILL.md) — Applies across multiple projects. Examples: plotting conventions, environment management, export formats.The description field in YAML frontmatter is the single most important part of a skill — it determines whether the skill gets activated. Follow these rules:
The first sentence should say WHEN to use the skill, not just WHAT it does.
# BAD — describes what, not when:
description: R ggplot2 plotting conventions and theme.
# GOOD — front-loads triggers:
description: R ggplot2 plotting conventions and theme. Use when creating, modifying, or styling ggplot2 plots in R, or when adjusting plot themes, colors, labels, or formatting.
Be specific about what actions or contexts should activate the skill. Use verbs: "creating", "modifying", "saving", "debugging", "exporting".
# BAD — too vague:
description: Use when working with files.
# GOOD — specific actions:
description: Use when overwriting existing files, deleting files, or writing to directories that contain important data (data/, outs/).
If the skill could be confused with similar skills, add "Do NOT load for" clauses.
description: >
Quarto document conventions for data science analysis scripts (.qmd).
Use when creating or rendering .qmd analysis scripts in data science projects.
Do NOT load for Quarto books, websites, or documentation projects.
Think about variations of the task that should also trigger the skill:
| Core trigger | Edge cases to include |
|---|---|
| "creating plots" | modifying, styling, fixing, adjusting themes |
| "saving figures" | choosing formats, setting DPI, export dimensions |
| "committing changes" | writing commit messages, creating branches, making PRs |
The description should be 1-3 sentences. If it needs more, use the multi-line > YAML syntax. Put the most important trigger first.
---
name: skill-name
description: >
One-sentence summary of what the skill covers.
Use when [specific trigger 1], [specific trigger 2], or [specific trigger 3].
Do NOT load for [exclusion 1] or [exclusion 2].
user-invocable: false
---
Fields:
name — kebab-case, matches the directory namedescription — trigger-focused (see rules above)user-invocable — true only if the user triggers it with /name (like /done, /publish). Most skills are false (auto-loaded based on context).After the frontmatter, organize the skill body:
# Skill Name## sectionsKeep it focused. A skill should cover one coherent topic, not be a grab-bag.
~/.claude/skills/{name}/SKILL.md~/miniconda3, not /Users/jm284/miniconda3) so skills are portable/sync-skills when ready to publishFor skills that generate scripts (code-generating pipelines) or HPC-tool skills that deploy SLURM batch jobs, use the Anthropic skill-creator convention for bundled resources:
skill-name/
├── SKILL.md # <500 lines — workflow, decision points
├── templates/ # Job templates copied into project batch/<area>/
│ ├── my_array.sh
│ └── my_samples.tsv
├── scripts/ # Helper code deployed to project python/ or R/
│ └── my_helpers.py
└── references/ # Detailed docs loaded as needed
└── method_notes.md
The three subdirectories are semantically distinct — pick the right one for each resource:
| Subdir | What goes there | Where it gets deployed |
|---|---|---|
templates/ | Whole batch jobs (SLURM array .sh, sample sheet .tsv stub, conda env .yml, aggregator .qmd) | Project's batch/<area>/ (or scripts/<area>/ for .qmd), edited then run as-is |
scripts/ | Reusable helper functions (parsers, plotters, importable modules) | Project's python/ or R/ dir, imported by analysis scripts |
references/ | Long-form reading material (gotcha lists, lookup tables, tool docs) | Not deployed — loaded by Claude on demand from inside the skill |
Templates deployment convention: When the skill runs, it copies relevant
files from templates/ into the project's batch/<area>/ directory and tells
the user which placeholders to edit (<area>, <XX_script_name>, --array=1-N,
--mail-user=...). Templates should be self-documenting via top-of-file comments
that flag the edit points.
Helper deployment convention: When the skill runs:
python/ or R/ dir exists in the project, create if neededscripts/ directory.qmd imports from the project-level locationThis keeps helper code as real, testable files rather than code blocks in SKILL.md. SKILL.md references the helpers and describes how the generated script uses them.
Examples in the wild:
busco uses templates/ (5 batch files + an aggregator) and references/ (lineage table + gotchas list) — see ~/.claude/skills/busco/hpc, expression-report, and new-project use references/ and/or bundled exampleseggnog-mapper, prost-annotation, fcs-gx) embed batch scripts as fenced code blocks in SKILL.md — that's the legacy single-file pattern, slated for refactor$-tokens in SKILL.md bodiesWhen a skill is invoked, Claude Code runs an argument-substitution pass over the SKILL.md
body before Claude sees it. It replaces $N (a $ immediately followed by a digit —
0-based, so \$0 is the first argument), \$ARGUMENTS, and any declared argument name —
and these collapse to empty strings when the skill is invoked with no arguments (the usual
auto-load case). A $ followed by a letter ($SLURM_ARRAY_TASK_ID, $HOME), command
substitutions $(…), and ${…} are left untouched.
So runnable shell pasted inline that uses positional args or awk fields — echo "\$0",
awk '{print \$1}' — is silently blanked on load. Two fixes:
$+letter token ($SLURM_*, $HOME) — there the
backslash is kept, leaving a stray \.templates/ and load it with Read. Substitution does not
run on bundled files, so positional args and $SLURM_ARRAY_TASK_ID survive verbatim.(The example tokens above are backslash-escaped in this file's source so they render correctly when the skill loads.)
After creating a new user-level skill, add it to the appropriate table in ~/.claude/CLAUDE.md under "Available Skills":
Project-level skills don't need registration in the user CLAUDE.md — they're discovered automatically from the project's .claude/skills/ directory.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub musserlab/lab-claude-skills --plugin lab-skills34 skills in this plugin
/audit-projectPeriodic project health check - cross-check docs, prune conventions, find drift. Use when project documentation feels stale, before milestones, or when CLAUDE.md is getting long. Do NOT load for auditing skills (use /audit-skills) or data analysis scripts (use /audit-script).
/audit-scriptSystematic audit of data analysis scripts for bugs, analytical reasoning, data handling, style, and reproducibility. Includes domain verification phase that researches tools, file formats, and methods to catch domain-specific errors (not just code bugs). Use when auditing a script, reviewing code for correctness, checking for bugs, preparing a script for publication, or when the user says "audit this script", "review this code", "check this for bugs", or "is this script correct". Three modes: thorough (collaborative section-by-section), fast (Claude-driven with discussion), and report-only. Do NOT load for quick one-off questions about a single line or function.
/audit-skillsAudit Claude Code skills for bloat, trigger accuracy, structural quality, redundancy, and pruning opportunities. Use when skills feel bloated, before publishing to lab repo, after building several new skills, when reviewing a single newly-created skill before publishing, or when the user says "audit my skills", "review skills", "check skill quality", "audit this skill", or invokes /audit-skills. Covers both user-level (~/.claude/skills/) and project-level (.claude/skills/) skills, and supports both full-library scans and single-skill reviews. Do NOT load for auditing data analysis scripts (use /audit-script) or project documentation (use /audit-project).
/cleanup-scriptsSession-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.
/conda-envConda environment activation for Python commands. Use when running Python scripts, pip, or conda-dependent tools./data-handlingData handling best practices for R and Python data science analysis scripts. Use when writing data manipulation code, analysis pipelines, or .qmd scripts that process scientific/analytical data (e.g., filtering, joining, normalizing datasets). Do NOT load for general Python scripting, infrastructure code, or configuration management.