CLAUDE.md

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

Project Overview

Quarto website that displays daily statistics for labels emitted by skywatch.blue, a Bluesky/AT Protocol moderation labeller. Published at https://stats.skywatch.blue.

Build & Render

# Restore R package dependencies (renv)
Rscript -e 'renv::restore()'

# Render the full site
quarto render

# Preview with live reload
quarto preview

Output goes to _site/.

Data Pipeline

  1. R/stats.R — Fetches labels from the Skywatch Ozone API (com.atproto.label.queryLabels), paginates with cursor-based pagination, appends new labels to all_labels.rds. Cursor position is persisted in cursor.txt.
  2. index.qmd — Reads all_labels.rds and generates daily label counts, hourly breakdowns (tables + line chart), per-DID label distributions (90-day window), and 3-day rolling averages per label.

Run R/stats.R before rendering to pull fresh label data.

Key Architecture Decisions

  • renv manages R dependencies (R 4.3.3). Lock file is renv.lock; activate script is .Rprofilerenv/activate.R.
  • Brand theming via _brand.yml — Atkinson Hyperlegible font throughout. Referenced in _quarto.yml and in ggplot/gt code.
  • Two label lists in index.qmd: .automated_labels (subset used for 90-day analysis) and labels (full set used for daily views). When adding new labels, update the appropriate list.
  • All timestamps are UTC. Date filtering uses lubridate::today(tzone='UTC') - 1 (yesterday’s data).
  • Label data distinguishes record vs repo (account-level) labels based on URI pattern (at://did prefix).