|
| 1 | +# html2rss-web AI Agent Instructions |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +- Ruby web app that converts websites into RSS 2.0 feeds. |
| 6 | +- Built with **Roda**, using the **html2rss** gem (+ `html2rss-configs`). |
| 7 | +- **Principle:** _All features must work without JavaScript._ JS is only progressive enhancement. |
| 8 | + |
| 9 | +## Core Rules |
| 10 | + |
| 11 | +- ✅ Use **Roda routing with `hash_branch`**. Keep routes small. |
| 12 | +- ✅ Put logic into `helpers/` or `app/`, not inline in routes. |
| 13 | +- ✅ Validate all inputs. Pass outbound requests through **SSRF filter**. |
| 14 | +- ✅ Add caching headers where appropriate (`Rack::Cache`). |
| 15 | +- ✅ Errors: friendly messages for users, detailed logging internally. |
| 16 | +- ✅ CSS: Water.css + small overrides in `public/styles.css`. |
| 17 | +- ✅ Specs: RSpec, unit + integration, use VCR for external requests. |
| 18 | + |
| 19 | +## Don’t |
| 20 | + |
| 21 | +- ❌ Don’t depend on JS for core flows. |
| 22 | +- ❌ Don’t bypass SSRF filter or weaken CSP. |
| 23 | +- ❌ Don’t add databases, ORMs, or background jobs. |
| 24 | +- ❌ Don’t leak stack traces or secrets in responses. |
| 25 | + |
| 26 | +## Project Structure |
| 27 | + |
| 28 | +- `app.rb` – main Roda app |
| 29 | +- `app/` – core modules (config, cache, ssrf, health) |
| 30 | +- `routes/` – route handlers (`hash_branch`) |
| 31 | +- `helpers/` – pure helper modules (`module_function`) |
| 32 | +- `views/` – ERB templates |
| 33 | +- `public/` – static assets (CSS/JS, minimal) |
| 34 | +- `config/feeds.yml` – feed definitions |
| 35 | +- `spec/` – RSpec tests + VCR cassettes |
| 36 | + |
| 37 | +## Environment |
| 38 | + |
| 39 | +- `RACK_ENV` – environment |
| 40 | +- `AUTO_SOURCE_ENABLED`, `AUTO_SOURCE_USERNAME`, `AUTO_SOURCE_PASSWORD`, `AUTO_SOURCE_ALLOWED_ORIGINS` |
| 41 | +- `HEALTH_CHECK_USERNAME`, `HEALTH_CHECK_PASSWORD` |
| 42 | +- `SENTRY_DSN` (optional) |
| 43 | + |
| 44 | +## Style |
| 45 | + |
| 46 | +- Add `# frozen_string_literal: true` |
| 47 | +- Follow RuboCop style |
| 48 | +- YARD doc comments for public methods |
0 commit comments