saturn
- 187 commits
- 2 branches
- 0 tags
- updated
- CI 2/2
pr: add code review instructions
SignedGitea couldn't verify the signature.
Showing 1 changed file with 81 additions and 0 deletions.
AGENTS.mdadded
+81 −0
@@ -0,0 +1,81 @@1# AGENTS.md23Review guidance for this repo. Personal site, served by Cloudflare Pages.45## What this is67Hand-written static HTML, one file per page, no build step and no bundler.8Vite is dev-server only; deploying is `git push` to `main`. Pages are plain9files, so there is no template layer and shared markup (the `<head>`, the10header, the footer) is genuinely duplicated across pages on purpose.1112Dynamic behaviour lives at the edge in `functions/`, not in the browser.1314## Invariants — flag any change that breaks one1516**No client-side JavaScript.** There is not one `<script>` tag on the site and17no inline handlers. Likes and replies work as plain form POSTs handled by edge18middleware. A change that adds JS to a page breaks the core constraint.1920**Edge code fails open.** `functions/_middleware.js` must serve the page's21static fallback markup on any error from D1 or the PDS, never a 500 and never a22broken page. Any new `catch` that rethrows, or new code that can throw before23`context.next()` resolves, is a bug.2425**Escape everything from outside.** Reply bodies, Bluesky post text and any26other remote or user-supplied string must go through `escapeHtml` before it27reaches HTML.2829**`_routes.json` stays in step** with `ALLOWED_PATHS` in30`functions/_middleware.js` and `isBlogPost()` in `functions/_lib/social.js`.31Adding a dynamic path in one place and not the others silently disables it.3233**Feed IDs are permanent.** A published `<id>` never changes and a published34post directory is never renamed or moved — it re-notifies every subscriber and35404s saved links. `/now/` is a living URL and must never be a feed entry; each36edition is archived to a dated directory first. See `FEED.md`.3738**Secrets stay out of the repo.** `.dev.vars` is gitignored; bindings and39secrets are configured in Cloudflare, not committed.4041## Conventions4243- **Colours come from the custom properties** in the `html {}` block of44 `global.css` (`--accent`, `--text-body`, `--text-secondary`, `--borders`, the45 rating scale). Flag hardcoded hex in new CSS. Adding a token means adding it46 to the `prefers-contrast: high` block too.47- **Fonts are self-hosted only** (`assets/fonts/`, woff2, preloaded). No font48 CDNs.49- **The CSP is a per-page `<meta>` tag.** Any new external origin has to be50 added to the CSP on every page that loads from it, or it will be blocked in51 production but not in dev.52- **The `og:`/`twitter:` block is duplicated in every page's head** and53 maintained by hand. If a PR changes it in one page it should change it in all54 of them; only title, description and `og:url` differ per page.55- **URLs**: directory pages are canonical with a trailing slash56 (`/garden/books/`), root-level pages without an extension (`/about`). Pages57 308-redirects the other forms.58- **Accessibility is part of review**: semantic elements, `aria-label` on nav59 landmarks, `aria-hidden` on decorative glyphs, visible `:focus-visible`60 styles, and the `prefers-reduced-motion` / `prefers-contrast` blocks kept61 working.62- **Comments explain why, not what.** Match the existing lowercase, prose style.6364## Out of scope — do not raise these6566- Suggesting a framework, static-site generator, template engine, bundler or67 build step. The absence of one is the design.68- Flagging duplicated `<head>`, header or footer markup as a DRY problem. With69 no build step, duplication is the only option.70- Suggesting client-side JS, analytics, trackers or third-party embeds.71- Suggesting a test suite or CI test job for static HTML and CSS.72- Adding npm dependencies to the site itself. `workers/` may have them.73- Style nits already settled by the existing file: lowercase page titles and74 comments, uppercase display text in markup.7576## Priorities7778Rank findings: broken invariants above > correctness in `functions/` >79accessibility and CSP regressions > everything else. Prefer few specific80comments over broad ones. If a change is a deliberate deviation the author81explained in a comment, leave it alone.