-
-
Notifications
You must be signed in to change notification settings - Fork 11
docs(agent): add config authoring workflow guide #305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,213 @@ | ||||||||||||||||||||||||||||
| # html2rss-configs Agent Guide | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| This repo owns the curated YAML config set for `html2rss`. | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Primary goal: add or repair configs that are stable, shippable, and easy to verify. Prefer a narrow, clean surface over a broad noisy one. | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| ## Scope | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - Source of truth here: `lib/html2rss/configs/`. | ||||||||||||||||||||||||||||
| - Do not hand-edit generated schema output. | ||||||||||||||||||||||||||||
| - Keep config work separate from downstream docs, web, or example changes unless the task explicitly includes them. | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| ## Defaults | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - Use the registrable domain folder, not a subdomain folder, unless there is a strong existing reason. | ||||||||||||||||||||||||||||
| - Start from the cleanest article list the site offers, not the marketing homepage by default. | ||||||||||||||||||||||||||||
| - Prefer stable list/detail extraction over extracting every possible field. | ||||||||||||||||||||||||||||
| - If the site only becomes reliable on a narrower path, use that narrower path. | ||||||||||||||||||||||||||||
| - Omit brittle fields. If dates or descriptions are low quality, leave them out. | ||||||||||||||||||||||||||||
| - Set `enhance: false` when enhancement pulls in page chrome, duplicate cards, or unrelated links. | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| ## Surface Selection | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Prefer these surfaces first: | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - dedicated newsroom or blog archive pages | ||||||||||||||||||||||||||||
| - category pages with one repeated card structure | ||||||||||||||||||||||||||||
| - stable subpaths like `/blog/latest` or `/blog/everything/` | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Avoid these unless they are the only workable option: | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - homepages with hero content mixed with promos | ||||||||||||||||||||||||||||
| - pages that combine multiple unrelated card systems | ||||||||||||||||||||||||||||
| - infinite-scroll surfaces unless Browserless is already clearly required | ||||||||||||||||||||||||||||
| - localized or geo-redirecting entry pages when a stable non-localized path exists | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| ## Selector Strategy | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Start with the smallest useful selector set: | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - `items` | ||||||||||||||||||||||||||||
| - `title` | ||||||||||||||||||||||||||||
| - `url` | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Add fields only when they are clean: | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - `description` | ||||||||||||||||||||||||||||
| - `published_at` | ||||||||||||||||||||||||||||
| - `author` | ||||||||||||||||||||||||||||
| - `categories` | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Useful patterns: | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - Prefer the repeated article card itself as `items`, especially when it is a single anchor. | ||||||||||||||||||||||||||||
| - Anchor on article URLs or stable path fragments instead of generic headings. | ||||||||||||||||||||||||||||
| - Keep selectors item-local when possible. | ||||||||||||||||||||||||||||
| - Do not add complexity to recover weak optional fields. | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| ## Chrome MCP | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Use Chrome MCP when the static HTML is unclear, the page is hydrated, or Faraday fetch returns zero items while the browser shows a valid list. | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Recommended sequence: | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| 1. Open the target URL. | ||||||||||||||||||||||||||||
| 2. Take an accessibility snapshot. | ||||||||||||||||||||||||||||
| 3. Identify the exact repeated item boundary. | ||||||||||||||||||||||||||||
| 4. Confirm the title and URL live inside that boundary. | ||||||||||||||||||||||||||||
| 5. Record the final URL if the page redirects by locale or renders a different surface than expected. | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| ## Browserless | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Use Browserless when: | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - the page is JS-rendered | ||||||||||||||||||||||||||||
| - Faraday fetch returns zero items but Chrome shows a valid repeated list | ||||||||||||||||||||||||||||
| - the site is bot-sensitive enough that static fetch is unreliable | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Local Browserless notes: | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - `html2rss-web` exposes a local endpoint at `ws://127.0.0.1:4002` | ||||||||||||||||||||||||||||
| - Browserless fetch tests require `BROWSERLESS_IO_WEBSOCKET_URL` | ||||||||||||||||||||||||||||
| - custom websocket endpoints also require `BROWSERLESS_IO_API_TOKEN` | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Do not default the whole repo to Browserless. Use it only for configs that need it. | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| ## Command Assumptions | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Assume the `html2rss` CLI is available on `PATH` when working against the sibling core repo. | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - Use `html2rss ...` in examples and one-off validation commands. | ||||||||||||||||||||||||||||
| - If the CLI is not installed globally in the current environment, run the equivalent command from the sibling `html2rss/` checkout, typically `bundle exec exe/html2rss ...`. | ||||||||||||||||||||||||||||
| - In this repo, keep using `make ...` and `bundle exec rspec ...` because those are the implemented entrypoints. | ||||||||||||||||||||||||||||
|
Comment on lines
+89
to
+93
|
||||||||||||||||||||||||||||
| Assume the `html2rss` CLI is available on `PATH` when working against the sibling core repo. | |
| - Use `html2rss ...` in examples and one-off validation commands. | |
| - If the CLI is not installed globally in the current environment, run the equivalent command from the sibling `html2rss/` checkout, typically `bundle exec exe/html2rss ...`. | |
| - In this repo, keep using `make ...` and `bundle exec rspec ...` because those are the implemented entrypoints. | |
| Assume the `html2rss` CLI is available on `PATH` when working against the sibling core repo, or available via Bundler in this repo. | |
| - When a global CLI is installed, use `html2rss ...` in examples and one-off validation commands. | |
| - When running via Bundler (the default in this repo), use the README-style equivalents, for example: | |
| - `bundle exec html2rss validate path/to/config.yml` | |
| - `bundle exec html2rss feed path/to/config.yml` | |
| - If you are working directly in a sibling `html2rss/` core checkout without a global install, run the CLI via that repo, typically `bundle exec exe/html2rss ...`. | |
| - In this configs repo, keep using `make ...` and `bundle exec rspec ...` for repo-level tasks because those are the implemented entrypoints. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Chrome MCP" is introduced as a required inspection tool, but the acronym/tooling isn’t defined anywhere else in the repo. Consider adding a brief definition (what it is, how to access/run it, and/or a link) so new contributors/agents can follow the workflow without prior context.