skills/new-project/SKILL.md
Use when creating a new project, setting up a project from scratch, or when the user invokes /new-project. Scaffolds directory structure, environments, git, and Claude Code configuration. Supports data science, documentation, and general project types.
npx skillsauth add musserlab/lab-claude-skills new-projectInstall 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.
When the user invokes /new-project, scaffold a complete project with version control and Claude Code configuration. The project type determines which conventions, directories, and environments to set up.
Run this skill from inside the target project directory (which may be empty or newly created).
Use AskUserQuestion to collect:
scripts/ directory — for small projects with <10 scripts on one topicscripts/, data/, outs/ — for larger projects with multiple analytical threadsIf sectioned, ask for section names (e.g., phosphoproteomics, transcriptomics).
If yes:
batch/ directory (tracked in git — SLURM batch scripts)logs/ directory (tracked in git — SLURM output for review in both environments)/nfs/roberts/project/pi_jm284/<project_name>/)BASEDIR=$(git rev-parse --show-toplevel) — no hardcoded pathshpc skill for full dual-environment conventionsCHANGELOG.md to track changes over time. The /done skill will propose entries automatically.mkdir -p R python scripts/exploratory data outs/exploratory .claude
(Omit R/ if Python-only, omit python/ if R-only.)
For each section (e.g., phosphoproteomics, transcriptomics):
mkdir -p R python scripts/exploratory data outs/exploratory .claude
# Per section:
mkdir -p scripts/{section} data/{section} outs/{section}
mkdir -p batch logs
These are gitignored (see .gitignore section below) — they hold ephemeral SLURM scripts and log output.
Add .gitkeep files to empty directories so git tracks them:
touch R/.gitkeep python/.gitkeep scripts/exploratory/.gitkeep outs/.gitkeep data/.gitkeep
Hand off to the /quarto-book-setup skill:
"This is a documentation project — I'll use
/quarto-book-setupto scaffold the Quarto book. Would you like to proceed?"
After /quarto-book-setup completes, return here to add project-type: general to the generated CLAUDE.md (documentation projects use the general type since they don't follow data science conventions).
mkdir -p .claude
Create only the .claude/ directory. Do NOT create data/, outs/, scripts/, R/, or python/ directories — let the user organize as appropriate for their project.
conda config --show channel_priority
If not already strict:
conda config --set channel_priority strict
conda config --set solver libmamba
conda config --add channels conda-forge
source ~/miniconda3/etc/profile.d/conda.sh
conda create -n {project_name} python=3.11 numpy pandas matplotlib ipykernel -y
conda activate {project_name}
Customize: Replace
~/miniconda3with your actual conda installation path (seeconda-envskill).
ipykernel is required for Quarto to execute Python chunks.
lab-generalGeneral projects always get the shared lab-general environment by default. This is included in the CLAUDE.md regardless of whether the project currently uses Python — it ensures Claude knows which env to activate if Python is needed later.
Check if the lab-general environment already exists:
source ~/miniconda3/etc/profile.d/conda.sh && conda env list | grep lab-general
If it does NOT exist, create it:
source ~/miniconda3/etc/profile.d/conda.sh
conda create -n lab-general python=3.11 ipykernel pyyaml requests pandas -y
Do NOT export an environment.yml into the project — lab-general is managed independently, not per-project.
Opt-out: project-specific environment. If the user specifically says they need specialized Python dependencies, create a project-specific env instead:
Ask the user which packages to install.
Create the environment:
source ~/miniconda3/etc/profile.d/conda.sh
conda create -n {project_name} python=3.11 ipykernel {user_packages} -y
conda activate {project_name}
Export environment:
conda env export --from-history > environment.yml
Always use --from-history for portable environment files:
conda env export --from-history > environment.yml
Do NOT create an environment.yml for projects using the shared lab-general environment.
base environmentlab-general shared environment by default; create project-specific only when specialized dependencies are neededconda install over pip installipykernel for Quarto compatibilityrig list
Ask the user which version to use (default: latest installed).
Ask: "Do you use Positron as your IDE?"
If yes, create .positron/settings.json:
{
"r.rpath.mac": "/Library/Frameworks/R.framework/Versions/{VERSION}-arm64/Resources/bin/R"
}
Replace {VERSION} with the chosen version (e.g., 4.4). For Intel Macs, use {VERSION}-x86_64.
Add .positron/ to .gitignore (already in the template).
renv::init()
install.packages(c("tidyverse", "here"))
renv::snapshot()
renv.lock, renv/activate.R, .Rprofile to gitrenv/library/ or renv/staging/# Generated outputs (reproducible from code)
outs/
# R artifacts
.Rhistory
.RData
.Rproj.user/
renv/library/
renv/staging/
renv/local/
*_cache/
# Python artifacts
__pycache__/
*.py[cod]
*.egg-info/
.eggs/
*.egg
.venv/
venv/
# Quarto rendering
*_files/
.quarto/
*.html
# Claude Code
.claude/worktrees/
# OS files
.DS_Store
Thumbs.db
# IDE settings
.vscode/
.positron/
*.Rproj
# Secrets
.env
*.pem
credentials.json
If cluster project, also add:
# HPC cluster — batch scripts and SLURM logs
batch/
logs/
Note on data/: Whether to gitignore data/ depends on file sizes. Small data files (< a few MB) can be committed. Large files should be gitignored with a data/README.md documenting sources. Ask the user.
# Python artifacts
__pycache__/
*.py[cod]
*.egg-info/
.venv/
venv/
# R artifacts
.Rhistory
.RData
.Rproj.user/
# Quarto rendering
*_files/
.quarto/
# Claude Code
.claude/worktrees/
# OS files
.DS_Store
Thumbs.db
# IDE settings
.vscode/
.positron/
# Secrets
.env
*.pem
credentials.json
Omit language-specific sections if that language isn't used.
Read templates/claude_md_data_science.md and fill in project-specific details:
{placeholders} with actual values from the discussion<!-- IF CLUSTER --> comment markers after decidingIf ~/lib/R/ or ~/lib/python/ exist, add to the Conventions section:
### Cross-Project Helpers
Shared helper functions are available at:
- `~/lib/R/` — source with `source("~/lib/R/helpers.R")`
- `~/lib/python/` — import with `sys.path.insert(0, os.path.expanduser("~/lib/python"))`
Read templates/claude_md_general.md and fill in project-specific details.
Same placeholder and cluster section rules as the data science template.
Create .claude/project-reminders.txt — this is read by the project-reminders hook to inject critical project-specific rules at every session start.
CRITICAL REMINDERS (re-injected after compaction):
1. (Add project-specific rules here as the project develops)
2. Check planning documents before modifying scripts
3. Never silently default unmatched data classifications
REMINDERS (re-injected after compaction):
1. (Add project-specific rules here as the project develops)
Tell the user: "I created .claude/project-reminders.txt — edit this as you discover critical rules that Claude keeps forgetting after long sessions."
# {Project Name}
{Brief description}
## Setup
### Prerequisites
- [Positron](https://positron.posit.co/) (recommended IDE)
- [rig](https://github.com/r-lib/rig) (R version manager)
- [Conda](https://docs.conda.io/) (Python environment manager)
- [Quarto](https://quarto.org/) (literate programming)
### Python
```bash
conda env create -f environment.yml
conda activate {project_name}
```
### R
```r
# renv auto-activates via .Rprofile
renv::restore()
```
## Data
(Document data sources and how to obtain them)
## Running the Analysis
(Document how to run scripts in order)
Omit Python or R sections if not using that language.
# {Project Name}
{Brief description}
## Setup
{Document prerequisites and setup steps as the project develops}
## Usage
{Document how to use the project}
If the user opted for a changelog in Step 1, create CHANGELOG.md:
# Changelog
## {today's date}
### Added
- Initial project setup
The /done skill auto-detects this file and proposes entries at each session wrap-up. No CLAUDE.md entry needed.
git init
git add .
git commit -m "Initial project setup"
Then create the remote:
# Lab org, private (default)
gh repo create LAB_ORG/{project_name} --private --source=. --push
# Personal, private
gh repo create {project_name} --private --source=. --push
# Personal, public
gh repo create {project_name} --public --source=. --push
Customize: Replace
LAB_ORGwith your lab's GitHub organization name.
After completing all steps, print a type-appropriate summary:
Project "{project_name}" created successfully!
Project type: Data science
Directory structure: {flat/sectioned}
Languages: {R/Python/both}
Conda env: {project_name}
R version: {version} (renv initialized)
Git remote: {github_url}
Next steps:
1. Add data files to data/
2. Create your first script: scripts/01_import.qmd
3. See the quarto-docs skill for QMD templates
Project "{project_name}" created successfully!
Project type: General
Languages: {languages}
Conda env: {lab-general (shared) / project_name (project-specific)}
Git remote: {github_url}
Next steps:
1. Start adding code and documentation
2. Update .claude/CLAUDE.md as the project develops
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.