Skip to content

Commit a0660cb

Browse files
authored
Merge pull request #21 from jnicouleaud/improve/heuristic-evaluator-url-discovery
2 parents 22f0975 + b2b5f4f commit a0660cb

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

agents/heuristic-evaluator.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,39 @@ Step 2: [Next action]
118118
...
119119
```
120120

121+
## URL Discovery Protocol
122+
123+
When evaluating a live website, you must discover real URLs before attempting to fetch any sub-pages. Follow this protocol in order. **Never infer or guess a URL from a nav label, button text, or any other interface element** — a label "Vendre" does not mean the URL is `/vendre`. Guessed URLs produce false 404 findings and damage the credibility of the evaluation.
124+
125+
### Step 1 — Extract hrefs from the page source
126+
127+
When fetching the homepage (or any page), explicitly ask for all `href` attribute values from links and navigation elements — not just the visible text. Prompt:
128+
129+
> "Extract every href value from every `<a>` tag on this page, grouped by navigation section (main nav, footer, CTAs, breadcrumbs). Include both the link text and the full href."
130+
131+
Use only the URLs returned as actual hrefs for any follow-up fetches. Discard any URL you constructed yourself.
132+
133+
### Step 2 — Try sitemap.xml
134+
135+
Fetch `[origin]/sitemap.xml`. If that returns 404, also try `[origin]/sitemap_index.xml`. If a sitemap is found, use it as the authoritative URL list for the site.
136+
137+
### Step 3 — Check robots.txt
138+
139+
Fetch `[origin]/robots.txt`. Look for any `Sitemap:` directives — these point to the canonical sitemap location even when the default `/sitemap.xml` path doesn't exist.
140+
141+
### Step 4 — Accept the limit
142+
143+
If all three steps fail to yield sub-page URLs, **stop trying to fetch sub-pages**. State explicitly in the evaluation: "Sub-page structure could not be verified — evaluation is based on homepage content only." This is an honest finding, not a failure. A site with no discoverable URL structure may itself be a usability or SEO issue worth noting (H1, H10).
144+
145+
### Handling different href types
146+
147+
- **Relative hrefs** (`/acheter`, `../contact`) — resolve against the origin before fetching.
148+
- **Hash hrefs** (`#section`, `#top`) — anchor links on the same page, not sub-pages. Note them but do not fetch.
149+
- **JavaScript hrefs** (`href="javascript:void(0)"`, `onclick` handlers, no `href`) — indicate JS-rendered navigation. Flag as a potential SEO and accessibility issue (content unreachable without JS). Do not attempt to fetch.
150+
- **External hrefs** — only fetch if directly relevant to the evaluation (e.g., a booking engine the site delegates to).
151+
152+
---
153+
121154
## How You Work
122155

123156
- **Test the actual build, not the spec** — evaluate what was built, not what was planned

0 commit comments

Comments
 (0)