# Aging or Dying — Repository Guide for Agents

## What this project is

Static website for https://agingordying.com — a free, browser-based educational symptom "reality check" for U.S. adults 18+, plus preventive-health tools, men's health guides, and caregiving resources. No framework, no build step, no backend: plain HTML/CSS/JS served from the repo root (deployed on Vercel).

## Project structure

- `index.html`, `styles.css`, `script.js` — homepage, global styles, assessment wizard logic
- `assessment.js` — symptom assessment rule engine (client-side)
- `preventive-health.js`, `preventive-tool.js`, `preventive-tools.css` — shared logic/styles for `/tools/*`
- `resource-library.css` — styles for resource/guide/trust pages
- `mens-health/`, `resources/`, `tools/`, `decide/`, `about/`, `contact/`, `privacy/`, `terms/`, `sources/` — directory-based routes, each with `index.html`
- `content/` — JSON source data for generated pages (`resources.json`, `mens-health/`, and, when enabled, `decide/`)
- `scripts/rebuild-resource-copy.mjs`, `scripts/rebuild-mens-health-content.mjs`, `scripts/render-decide-page.mjs` — destination-owned renderers that regenerate HTML from validated `content/` sources
- `test/` — node:test contract tests
- `docs/` — content specs and business docs

## Commands

- `npm test` — run contract tests (`node --test`)
- `npm run resources:rebuild` — regenerate `/resources/` HTML from `content/resources.json`
- `npm run mens-health:rebuild` — regenerate `/mens-health/guides/` HTML from `content/mens-health/`
- `node scripts/render-decide-page.mjs content/decide/{slug}.json` — validate one `agingordying.decide.v1` source and render its native `/decide/{slug}/` page
- `npm run serve` — local static server on port 4173 (Python http.server)

## Conventions

- Guide pages under `resources/` and `mens-health/guides/` are GENERATED — edit `content/` data and run the rebuild scripts; do not hand-edit generated HTML.
- Decision pages use the destination-native contract in `.well-known/warmstart-publish.json`: source records belong in `content/decide/{slug}.json` and rendered pages at `decide/{slug}/index.html`. The manifest remains disabled until the route and release workflow are independently verified.
- `scripts/render-decide-page.mjs` owns the Decide schema validation, native template, canonical safety copy, source-reference checks, and revision marker. Do not hand-edit rendered decision HTML.
- Never copy generic report HTML into `decide/`. Every decision page must use this site's route, `preventive-tools.css` shell, canonical and social metadata, PostHog and GA4 loaders, structured data, source list, educational disclaimer, and visible review status.
- Medical decision pages require credentialed clinical review of the exact production revision. Draft approval is not publication, and no page may be labeled published while that review or live-revision verification is missing.
- All symptom processing is client-side; raw symptom text and exact age must never be sent to analytics (see `posthog.js`, privacy policy).
- Clinical claims must link to a listed source on `/sources/`.
- Site is educational only: never add diagnosis language, accounts, payments, or medical-data collection.

## Agent-facing files

`llms.txt`, `agents.md`, and `.well-known/agent-card.json` / `.well-known/ai-agent.json` are served from the repo root and describe the site to external agents. Keep them in sync when routes change.
