Operating notes for AI coding assistants (Claude Code, Codex, etc.) working
in this repository. Treated as canonical; CLAUDE.md defers here.
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.
The site is mid-migration to a "v2" design language:
assets/css/tokens.css— design tokens (--c-*brand colours,--t-*typography,--s-*spacing,--r-*radii). Single source of truth.assets/css/bridge.css— loaded aftertokens.cssandstyles.cssso its:rootdeclarations win. Maps legacy--color-*/--font-*/--shadow-*names onto v2 tokens, declares shared component primitives (panel, eyebrow, lede, chip, btn-ghost, paper-card, news-row, team-tile).- v2 page stylesheets —
home.css,team-v2.css,research-v2.css,footer-v2.css,about-layout.css,shared-news-history.css,join-us.css. Coexist with legacystyles.css,research.css,team.css,teaching.css.
When adding a new v2 page, prefer composing from bridge primitives over duplicating styles. Page-specific files only for genuinely page-specific rules.
Several pages render from YAML rather than handwritten HTML:
_data/hero.yml— homepage hero section (slides, copy, eyebrow)._data/news.yml— news items shown on the homepage and/news/archive (date, kind, title, meta, action)._data/team.yml— present members, collaborators, alumni for the team page (name, role, photo, bio)._data/research_themes.yml— research-themes block.
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/default.html— base layout, used by everything except the collection-specific layouts below._layouts/research.html,team.html,teaching.html,teaching-course.html,join-us.html,history.html— collection / page layouts._includes/footer-v2.html— site footer (v2 footer is the only footer)._includes/theme-init.html,tokens-bridge.html,tokens-head.html— early-load fragments for theme persistence and token wiring.
command-palette.jsmust load beforecommand-data.js(dependency order;scripts/fix-script-order.shenforces this).- Fuse.js powers fuzzy search.
- Search database (
search_db.json) is generated and updated daily from the comphy-lab/comphy-search repository via GitHub Actions; not edited by hand here. - Keyboard shortcut: ⌘K (Mac) / Ctrl+K (Windows).
- CSS variables in
:rootfor light, overridden under[data-theme="dark"]. - Theme persisted in
localStorage, applied early viatheme-init.htmlto avoid FOUC.
- Client-side JS filtering plus pre-generated tag pages for SEO.
- Tags must use
<div class="tags"><span>TagName</span></div>in_research/index.md.
about.html— Jekyll permalink/about/, redirects to/. Plain JS redirect with visible fallback link, mirrors thecontact.htmlpattern.contact.html— Jekyll permalink/contact/, redirects to/join.
# 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"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>
[](URL)- Use
**Name**for lab members. - Add
<span>Featured</span>to display on the homepage (max 2). - The
idattribute enables direct linking:/research/#NUMBER.
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).
- Slash command:
/add-news "Your news content here"— see "Custom slash commands" below. - Manual: edit
_data/news.yml(the source of truth for the homepage feed and/news/archive), then mirror toNews.mdandhistory.md.News.mdkeeps only the 5 most recent legacy items plus the pinned Durham announcement; older items live on inhistory.mdand_data/news.yml. - Format:
- News contentunder### Month Yearheaders; pinned items have no header. Months are reverse-chronological within each year.
- Main page:
_teaching/index.md(uses theteachinglayout, sorts and filters courses). - Course pages:
_teaching/YYYY-CourseName-Location.md(usesteaching-courselayout). - Images:
/assets/images/teaching/— 600x400 for cards, 1200x400 for banners.
Enforced by lint-check.sh, but worth keeping in mind:
- Fuse.js loads before any search code.
command-palette.jsloads beforecommand-data.js.theme-init.htmlruns as early as possible to avoid theme flash.
Installed by setup.sh via Husky:
- ESLint with auto-fix for JS.
- Prettier for JS/CSS/JSON/YAML formatting.
- markdownlint-cli2 for Markdown.
- Only staged files are checked.
- Bypass with
git commit --no-verifyonly in real emergencies.
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.
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.
- Command palette (navigation, search, keyboard shortcuts).
- Line-breaking utilities (80-char enforcement).
- Platform detection (Mac vs Windows shortcuts).
- Teaching page sorting.
- Featured-papers homepage media handling regression.
- Browser API mocks in
tests/setup.js.
npm test -- command-data.test.js
npm test -- --watch
node scripts/simple-test.js # quick validation without Jestscripts/build.sh runs (in order):
- Jekyll build (production env).
- Search database fetch (in CI only).
- SEO tag generation.
- Filtered research tag pages.
- WebP where possible; optimise before adding.
- Lazy loading on images.
- CSS organised by breakpoint (1700, 1300, 900, 768, 500) for cache hits.
- ALWAYS prefer editing existing files over creating new ones.
- Developer docs (READMEs, CONTRIBUTING) are not created unless asked.
- Site content follows its specific workflow (research / news / teaching / team — see "Content management" above).
- 80-char line limit for JavaScript.
- Double quotes for strings.
- ES6+ (arrow functions, const/let, async/await).
- Mobile-first CSS; min-width media queries.
- BEM naming for CSS classes (
.s-header__nav-list,.news-item__body). - Compose from
bridge.cssprimitives where possible.
- Work on feature branches.
- Run
./scripts/lint-check.shandnpm testbefore committing. - Reference issue numbers in commits where relevant.
- Don't bypass hooks (
--no-verify) unless explicitly authorised.
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.
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:
- Add a structured item to
_data/news.ymlin reverse-chronological position withdate,kind,title,meta,action_label,action_href. - Add the item to the matching
### Month Yearsection inhistory.md. - Add the item to
News.mdin the same section. - If the count of non-pinned items in
News.mdexceeds 5, remove the oldest fromNews.mdonly (history.mdkeeps everything). - Save all three files.
Rules:
- The pinned Durham announcement has no month/year header — preserve it.
- News items use the
- News contentbullet form (dash + space + text). - Maintain blank lines between sections.
- Years descend in
history.md; months descend within each year.