Custom Skills

Create /commands for common tasks

Modified

February 25, 2026

Advanced 12 min read Phase 4: Advanced

Skills are reusable command templates that you invoke with /skillname. They encode complex workflows into simple commands.

What Are Skills?

A skill is a markdown file in .claude/commands/ that defines: - What the command does - Step-by-step instructions for Claude - Any parameters it accepts

Using Skills

> /review              # Run the review skill
> /review --all        # With arguments
> /validate            # Run validation skill

Lab-Provided Skills

/review

Comprehensive code review with priority-ordered checks:

# .claude/commands/review.md

# /review - Code Review Command

Review changes for bugs, security issues, and lab standard violations.

## Usage
/review              # Review since last commit
/review --all        # Review all recent changes

## Instructions

When invoked:

1. Check git status for changed files
2. Review each file with this priority:
   - Logic errors (highest priority)
   - Security vulnerabilities
   - Data integrity issues
   - Lab standard violations
   - Style issues (lowest priority)

3. Check project-specific patterns from review-checklist.yml

4. Output findings as:
   - CRITICAL: Must fix
   - WARNING: Should review
   - INFO: Minor notes

5. Write summary to logs/code_review.log

/validate

Check project consistency:

# .claude/commands/validate.md

# /validate - Project Consistency Check

Verify project follows the consistency framework.

## Instructions

1. Check globals.yml exists and is valid YAML
2. Scan R/ for hardcoded values that should be in globals.yml
3. Verify manuscript uses dynamic values (not hardcoded)
4. Check DATA_PROVENANCE.md is up to date
5. Report any inconsistencies found

/preflight

Pre-Slurm submission checks:

# .claude/commands/preflight.md

# /preflight - Pre-Submission Checks

Run before submitting jobs to Slurm.

## Instructions

1. Check for stale lock files in _targets/
2. Look for orphaned worker processes
3. Verify Slurm script has required directives
4. Check disk space in /proj/rashidlab/
5. Confirm R packages are available
6. Report any issues that would cause job failure

Creating Custom Skills

1. Create the file

mkdir -p .claude/commands
nano .claude/commands/myskill.md

2. Write the skill

# /myskill - Description

Brief description of what this skill does.

## Usage

/myskill [arguments]

## Instructions

Step-by-step instructions for Claude:

1. First, do X
2. Then, check Y
3. Finally, output Z

## Examples

Example invocation and expected output.

3. Use it

> /myskill

Skill Structure

Basic Template

# /skillname - Short Description

Longer description of purpose.

## Usage

/skillname [optional-args]

## Instructions

When this command is invoked:

1. First step
2. Second step
3. Third step

## Output Format

Describe expected output format.

With Parameters

# /analyze - Run Analysis

## Usage

/analyze <target>           # Analyze specific target
/analyze --all              # Analyze everything
/analyze --since <date>     # Since specific date

## Instructions

Parse the arguments:
- If <target> provided: analyze that target
- If --all: analyze all targets
- If --since: filter by date

Then proceed with analysis...

Best Practices

Keep Skills Focused

Each skill should do one thing well:

# Good: Focused
/review    # Review code
/validate  # Check consistency
/preflight # Pre-submission checks

# Bad: Too broad
/do-everything  # Review, validate, and submit

Include Examples

## Examples

### Example 1: Basic usage
> /review
Reviews changes since last commit...

### Example 2: With arguments
> /review --since abc123
Reviews all changes since commit abc123...

Reference Project Files

## Instructions

1. Read the review checklist from `.claude/review-checklist.yml`
2. Apply patterns specific to this project
3. Check critical files listed in CLAUDE.md

Skill vs Agent

Feature Skill (/command) Agent
Invocation /skillname “Use the reviewer agent”
Purpose Workflow automation Specialized expertise
Length Short, procedural Can be detailed
State Stateless Can maintain context

Use skills for workflows; use agents for specialized knowledge.

Sharing Skills

Within the Lab

Skills in template repos are shared with everyone:

template-research-project/.claude/
└── commands/
    ├── review.md
    └── validate.md

Personal Skills

Add to ~/.claude/commands/ for personal skills available everywhere.

GSD Workflows

GSD (Get Stuff Done) is a plugin that provides structured, multi-phase project management through Claude Code. It’s the scaled-up version of the plan→implement pattern — designed for large research efforts that span weeks or months.

When to Use GSD

Scope Approach
5-minute fix Just do it — no structure needed
Single feature or analysis Plan→implement pattern with docs/plans/
Multi-week research effort GSD workflows
Full paper (method + sims + manuscript) GSD with milestone tracking

Core Commands

GSD provides commands organized around a research → plan → execute cycle:

Starting a Project

Command What it does
/gsd:new-project Interviews you about the project, researches the domain, creates a phased roadmap with milestones
/gsd:new-milestone Start a new milestone cycle within an existing project

Example:

> /gsd:new-project

GSD asks about your methodology, simulation design, target journal, etc. Then it creates a roadmap — for instance:

  • Phase 1: Core method implementation
  • Phase 2: Simulation study design and execution
  • Phase 3: Results analysis and figures
  • Phase 4: Manuscript

Each phase is scoped and sequenced with dependencies.

Planning and Executing Phases

Command What it does
/gsd:research-phase Research how to implement a phase before planning (reads docs, explores codebase)
/gsd:plan-phase Creates a detailed execution plan with tasks, dependencies, and success criteria
/gsd:execute-phase Works through the plan task by task, committing as it goes
/gsd:discuss-phase Gather context through adaptive questioning before planning

The cycle for each phase is: research → plan → execute. This ensures every phase is well-understood before code is written.

Tracking Progress

Command What it does
/gsd:progress Shows completed phases, current task, what’s next
/gsd:check-todos List pending tasks and select one to work on
/gsd:verify-work Validate that built features meet the original spec
/gsd:audit-milestone Audit milestone completion against original goals

Pausing and Resuming

Command What it does
/gsd:pause-work Saves full context to a handoff document when stopping
/gsd:resume-work Restores context from the handoff document in a new session

This is especially useful for HPC workflows — plan locally, pause before submitting Longleaf jobs, resume when results are back.

Managing the Roadmap

Command What it does
/gsd:add-phase Add a phase to the end of the current milestone
/gsd:insert-phase Insert urgent work as a decimal phase (e.g., Phase 2.5)
/gsd:remove-phase Remove a future phase from the roadmap

Utilities

Command What it does
/gsd:quick Execute a quick task with GSD tracking
/gsd:debug Systematic debugging with persistent state
/gsd:map-codebase Analyze codebase structure with parallel analysis
/gsd:help Show all available GSD commands

How GSD Fits With Lab Infrastructure

GSD creates planning files in .planning/ at your project root:

.planning/
├── ROADMAP.md           # Phase breakdown with milestones
├── phases/
│   ├── 01-method/
│   │   ├── RESEARCH.md  # Domain research output
│   │   ├── PLAN.md      # Detailed task breakdown
│   │   └── VERIFICATION.md
│   ├── 02-simulation/
│   │   └── ...
│   └── ...
└── PROGRESS.md          # Current status

This complements the lab’s docs/plans/ directory — GSD plans are more structured and automated, while docs/plans/ holds your manually written design documents.

Installation

GSD is installed as a plugin:

claude plugins install gsd@gsd-plugin

After installation, all /gsd:* commands are available in every project.