Menu

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Repository Overview

This repository contains the CoMPhy Lab website, a static site built with Jekyll for the Computational Multiphase Physics Laboratory. The site features research publications, team member information, teaching materials, and lab news.

Key Architecture Patterns

Command Palette and Search System

The website implements a sophisticated command palette system that requires coordination between multiple files:

Theme System Architecture

Research Tag Filtering

Essential Commands

# Initial setup (installs Ruby/Node.js if needed)
./scripts/setup.sh

# Build site with all assets
./scripts/build.sh

# Local development server
bundle exec jekyll serve

# Run before committing
./scripts/lint-check.sh

# Run a single test
npm test -- command-data.test.js

# Run tests with coverage
npm test -- --coverage

# Fix common issues
./scripts/fix-script-order.sh    # Fix script loading order
./scripts/fix-js-line-length.sh  # Enforce 80 char limit
./scripts/fix-quotes.sh          # Standardize to double quotes

Content Management

Adding Research Papers

Add to _research/index.md with this exact format:

<h3 id="NUMBER">[NUMBER] Author1, A., **Author2, B.**, & Author3, C. Title. _Journal_, Volume, Pages (Year).</h3>

<tags><span>Tag1</span><span>Tag2</span><span>Featured</span></tags>

[![Badge](https://img.shields.io/static/v1.svg?style=flat-square&label=LABEL&message=MESSAGE&color=COLOR)](URL)

Team Member Format

In _team/index.md:

<img src="../assets/images/team/NUMBER.webp" alt="Name" width="250" height="250" class="member-image">

News

Managing news items across the site:

Teaching Course Pages

Critical Implementation Details

Script Dependencies

The lint-check.sh script automatically fixes these, but be aware:

Pre-commit Hooks

Automatically installed via setup.sh using Husky:

Search Database Updates

CSS Variable System

Key variables for customization:

/* Colors */
--primary-color, --secondary-color, --accent-color
--text-color, --bg-color, --card-bg
/* Typography */
--font-family-serif, --font-family-sans
/* Spacing */
--spacing-unit, --content-max-width
/* Shadows & Transitions */
--shadow-sm, --shadow-md, --transition-speed

Testing Strategy

Test Coverage Areas

Running Specific Tests

# Test command palette
npm test -- command-data.test.js

# Test with watch mode for development
npm test -- --watch

# Quick validation without Jest
node scripts/simple-test.js

Performance Considerations

Build Process

The build.sh script performs these operations in sequence:

  1. Jekyll build with production environment
  2. Search database generation (if in GitHub Actions)
  3. SEO tag generation
  4. Filtered research page creation

Asset Optimization

Important Conventions

File Management

Code Style

Git Workflow

Custom Slash Commands

/add-news

Adds a news item to both News.md and history.md while maintaining the 5-item limit on the main page.

Workflow:

  1. Add the news item to the appropriate month/year section in both files
  2. If month/year doesn’t exist, create it
  3. Keep only 5 most recent news items in News.md (excluding the pinned Durham announcement)
  4. Preserve the pinned item (recognized by not having ### Month header above it)

Usage:

/add-news "Your news content here"

Implementation steps:

  1. Read both News.md and history.md
  2. Ask for month/year if not provided or unclear
  3. Add to history.md in the correct chronological position
  4. Add to News.md in the correct position
  5. Count non-pinned news items in News.md
  6. If count > 5, remove oldest items from News.md only
  7. Save both files

Important notes: