This is the single canonical AI-agent guide for this repository.
- Do not add tool-specific instruction files such as
CLAUDE.md,CODEX.md,HERMES.md, Copilot instructions, or Cursor rule files unless there is a hard technical requirement thatAGENTS.mdcannot satisfy. - If an agent or editor supports repository instructions, point it at
AGENTS.mdrather than maintaining a parallel policy file. - When updating agent guidance, update this file only.
feedreader is a small Cloudflare-native feed reader that aggregates Hacker News, GitHub Trending, Hugging Face Trending Papers, and more into a server-rendered feed backed by D1.
core/— platform-agnostic domain logic, source adapters, refresh orchestration, SSR renderingplatforms/cloudflare/— Worker entrypoint, D1-backed repository, migrations, wrangler configweb-static/— browser assets: CSS, JS, icons, manifest, service workerdocs/— standalone project docs; do not describe this repo as a port or point readers at retired implementations
npm install
npm run db:migrate:local
npm run devLocal dev serves on http://127.0.0.1:8788 by default.
npm run typecheck
npm test
npm run db:migrate:localIf you change GitHub Actions, migrations, or Worker wiring, run the migration smoke step too before calling the work done.
- CI:
.github/workflows/ci.yml - Deploy:
.github/workflows/deploy-cloudflare.yml
The deploy workflow validates Cloudflare secrets, re-runs verification, applies remote D1 migrations, and deploys the Worker.
No dedicated formatter or linter is configured. Match the existing TypeScript style:
- 2-space indent
- double quotes
- semicolons
- narrow, explicit diffs over broad rewrites
core/must stay free ofcloudflare:*,Deno.*, andnode:*imports.core/should use only pure functions and Web Standard APIs such asfetch,URL,crypto, andDate.- Platform-specific behavior belongs under
platforms/*behindcore/ports.ts. - D1 has no app-level
BEGIN/COMMIT; useenv.DB.batch([...])for atomic multi-statement writes. - Keep refresh fan-out through the
SELFbinding; do not collapse all source fetch+parse work into a single invocation. - Cloudflare Workers Free has a tight per-invocation CPU budget; never fetch and parse multiple upstream sources inline in one handler.
- Implement the
Sourceinterface incore/sources/. - Register it in
core/sources/index.ts. - Preserve
FeedItemshape and metadata conventions used bycore/service.ts. - Add or update tests under
core/test/.
- Keep docs standalone and accurate to this repository.
- Do not reference retired or alternate implementations in README or
docs/. - If behavior changes, update README,
docs/ARCHITECTURE.md,docs/DEPLOYMENT.md, anddocs/RUNBOOK.mdtogether.
POST /internal/refresh/:sourcemust remain gated byREFRESH_SECRET.- Do not log secrets or expose them in client-side code.
POST /api/refreshis intentionally small-scope and should stay limited to refresh behavior only.
Conventional Commits (feat:, fix:, chore:, ...).