Menu

AGENTS.md

Operating notes for AI coding assistants (Claude Code, Codex, etc.) working in this repository. Treated as canonical; CLAUDE.md defers here.

Repository overview

Static Jekyll site for the CoMPhy (Computational Multiphase Physics) Lab — research publications, team profiles, teaching materials, lab news. Hosted on GitHub Pages at https://comphy-lab.org.

Architecture at a glance

v2 design system

The site is mid-migration to a “v2” design language:

When adding a new v2 page, prefer composing from bridge primitives over duplicating styles. Page-specific files only for genuinely page-specific rules.

Data-driven pages

Several pages render from YAML rather than handwritten HTML:

The Jekyll collections (_research/, _team/, _teaching/, _join-us/) still drive their own pages. Team is the one with both a YAML feed and a collection, and _team/index.md is the rendered surface — the YAML is the content.

Layouts and includes

Theme system

Research tag filtering

Redirect pages

Essential commands

# Initial setup (installs Ruby/Node.js if needed, runs preflight,
# installs Husky hooks, builds, validates)
./scripts/setup.sh

# Local dev server (auto-finds free port 4001-4999, live reload)
./scripts/deploy.sh

# Full build (Jekyll + search + SEO + filtered research)
./scripts/build.sh

# Or plain Jekyll
bundle exec jekyll serve

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

# Tests
npm test
npm test -- --coverage
npm test -- command-data.test.js

# Targeted fixers
./scripts/fix-script-order.sh    # enforces command-palette.js first
./scripts/fix-js-line-length.sh  # 80-char enforcement
./scripts/fix-quotes.sh          # standardises to double quotes

# Lint teaching markdown locally (mirrors CI gate)
npx markdownlint-cli2 --config .markdownlint-cli2.jsonc \
  "_teaching/**/*.md" "assets/images/teaching/README.md"
npx prettier --check "_teaching/**/*.md" "assets/images/teaching/README.md"

Content management

Adding research papers

Add to _research/index.md in this exact form:

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

<div class="tags"><span>Tag1</span><span>Tag2</span><span>Featured</span></div>

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

Team members

Edit _data/team.yml. The team page (_team/index.md + team.html layout) renders from this data. Photo files live under assets/images/team/ (1:1 crop, used at --r-md radius). Bio lines are line-clamped per section (3 lines for present, 4 for collaborators, unset for alumni).

News

Teaching

Critical implementation details

Script dependencies

Enforced by lint-check.sh, but worth keeping in mind:

Pre-commit hooks

Installed by setup.sh via Husky:

Search database updates

Maintained externally in comphy-lab/comphy-search. Updated daily via GitHub Actions and pulled into assets/js/search_db.json. Includes blog content from blogs.comphy-lab.org. Manual trigger available in the Actions tab.

Content-rules CI

The content-rules workflow validates history.md chronological ordering and _research/index.md tag markup. Trigger paths must match the validated-file set; scripts/check-content-rules-trigger-parity.py enforces this. If you add a new file to the validator, also add its path to .github/workflows/content-rules-checks.yml.

Testing

Coverage areas

Running specific tests

npm test -- command-data.test.js
npm test -- --watch
node scripts/simple-test.js   # quick validation without Jest

Performance

Build process

scripts/build.sh runs (in order):

  1. Jekyll build (production env).
  2. Search database fetch (in CI only).
  3. SEO tag generation.
  4. Filtered research tag pages.

Asset optimisation

Conventions

File management

Code style

Git workflow

Custom slash commands

The canonical definitions for /add-news and the other content skills live outside this repository (in the agent system that invoked them). The repo previously contained an .agents/skills/ mirror, which was removed deliberately to avoid drift. The notes below describe the expected behaviour so non-agent contributors can follow the same recipe manually.

/add-news

Adds a news item to _data/news.yml, News.md, and history.md while maintaining the 5-item limit on News.md. _data/news.yml is the visible source for the homepage and /news/.

Workflow:

  1. Add a structured item to _data/news.yml in reverse-chronological position with date, kind, title, meta, action_label, action_href.
  2. Add the item to the matching ### Month Year section in history.md.
  3. Add the item to News.md in the same section.
  4. If the count of non-pinned items in News.md exceeds 5, remove the oldest from News.md only (history.md keeps everything).
  5. Save all three files.

Rules: