Audit a page for answer engines.
Done by an agent. Checked twice.
A scored audit showing what a search or answer engine can and cannot read on the page, with each fix named.
Real files in
- page.html
The service page of an invented roofing firm, with an overlong title, two main headings, skipped heading levels, images without alt text, vague link text and facts hidden in a comment, a script and a picture. 76 lines, 3 KB. - page_standard.md
Eight pass or fail checks on how a page is built and the rule for when a question counts as answered. 20 lines, 1 KB. - questions.csv
Fourteen questions a buyer would ask about the firm. 15 lines, 631 bytes.
Sample data written by Atris. Not a real company.
Three steps
- 1.Check how the page is built
- 2.Test the page against buyer questions
- 3.Write the fix list
Claude Sonnet 5.5, 57 seconds. No web. It never saw the check.
Checked twice
- Passed: 8 of 8 checks have the pass or fail found again by parsing the page
- Passed: 8 of 8 measures equal a fresh count (title 100 characters, 2 h1 headings, 2 skipped levels, 3 images without alt text, 3 vague links)
- Passed: 14 of 14 questions are marked answered or not as the page's visible text shows
- Passed: 8 of 8 quotes for answered questions appear word for word in the text a reader sees
- Passed: fixes.md opens with the score 10 of 22
- Passed: fixes.md names 6 of 6 failed checks and 6 of 6 unanswered questions and gives a line to 0 others
- Passed: 6 of 6 figures in fixes.md are limits from the page standard, counts found again on the page or the score
Second review by Claude Opus 5.5: pass.
Then we broke a copy of the output 8 ways on purpose. The check caught 8.
Score: 10 of 22
S1 Shorten the title from 100 characters to 30 to 60 characters.
S3 The page has 2 h1 headings ("Roof repairs in Sheffield" and "What our customers say"). Keep one and change "What our customers say" to an h2.
S4 Two headings skip a level: the h4 "Storm damage and leaks" follows an h2 (make it an h3), and the h3 "A customer in Rotherham" follows an h1 (it will follow an h2 once the second h1 becomes an h2).
S5 Add alt text of at least one word to three images: /img/call-us-banner.png (none), /img/flat-roof.jpg (empty alt) and /img/badge-1.png (none).
S6 Add at least one script of type application/ld+json. The page has none.
S8 Three links have weak text: "Click here" (to /quote), "Read more" (to /emergency) and "Click here" (to /about). Change each to words that say where it goes.
Q02 The page does not state what a roof repair costs. It only says "Prices that will not break the bank", which gives no figure.
Q04 The page says new roofs come with a guarantee but does not state the number of years.
Q06 The phone number is not in the text a reader sees. It appears only inside a script in the head. The page needs to state the number in the body.
Q07 The opening hours are not in the text a reader sees. They appear only in an HTML comment. The page needs to state the hours in the body.
Q12 The page does not name any trade body the company belongs to.
Q14 The page does not state which ways to pay it accepts.How this was run
An AI agent on Claude Sonnet 5.5 was given a folder with the files below and a three-step flow, and nothing else. It had no web access and never saw the check. The check was written before the run and made stricter after it. It works the answer out again from the input files. Then Claude Opus 5.5 reviewed the result against the inputs. The input files are sample data written by Atris, with the problems a real week has planted in them.
Run 1 of 1 on 1 December 2026. The agent took 57 seconds.
What the second review verified
- S1 title is 100 characters and S2 description is 118 characters (recounted), so S1 fails and S2 passes as reported
- Heading sequence h1 h2 h3 h3 h3 h2 h4 h2 h2 h1 h3 gives 2 h1s and 2 skips (h2→h4, h1→h3); 3 images lack alt text (call-us-banner, flat-roof empty alt, badge-1); 3 weak links ('Click here' x2, 'Read more'); 0 ld+json scripts
- Q06 phone '0114 496 0142' appears only in a head script and Q07 hours appear only in an HTML comment, so both are correctly marked no; all 8 'yes' quotes (e.g. 'We hold public liability insurance of £5 million.') appear word for word in the visible body
- Score 10 of 22 = 2 passed checks (S2, S7) + 8 answered questions over 8 checks + 14 questions; fixes.md has lines for all 6 failed checks and 6 unanswered questions, and none of them makes up a fact
What this run does not show
- The check decides whether each buyer question is answered with a word pattern written by hand before the run. A page that answers in other words could be marked wrong.
- The page and its eight point standard were written for this run. No real search or answer engine was asked to read the page.
- Whether each suggested fix is good advice is read only by the second review.
Would the check catch a wrong answer?
A check that cannot fail proves nothing. After the run we took a copy of the output, broke it one small way at a time and ran the check again. It caught 8 of 8. The check was made stricter after the first try at this, and the same untouched output was graded again.
Open every file
flow.md · the three steps the agent followed
# Audit a page for answer engines function: marketing for: the marketer who owns how the company shows up in search results and in assistant answers goal: The page has a pass or fail on every point of the page standard and a yes or no on every buyer question, with a list of what to fix. ## 1. Check how the page is built Read input/page_standard.md and input/page.html. Run every check in the standard on the page source. Count from the source itself with a parser. Do not estimate. Write output/audit.csv with columns check_id,result,measure,detail. One row per check. result is pass or fail. measure is the number the standard asks for. detail says what you found, such as the text of each link that fails. ## 2. Test the page against buyer questions Read input/questions.csv. For each question decide whether the page answers it, using the standard's rules on what counts. Write output/answers.csv with columns question_id,answered,quote. answered is yes or no. For yes, quote is the passage from the text a reader sees that answers the question, copied word for word. For no, leave quote empty. ## 3. Write the fix list Write output/fixes.md. Line 1 is `Score: X of Y`, where X is passed checks plus answered questions and Y is all checks plus all questions. Then one line per failed check, starting with its check_id, saying what to change. Then one line per unanswered question, starting with its question_id, naming the fact the page needs to state. Do not make up a missing fact. Say what is missing and not what it should be. ## Done looks like - Every check in the standard has a row with its measure. - Every yes has a quote that can be found in the text a reader sees. - Every failed check and every unanswered question has a line in fixes.md.
input/page.html · 76 lines, 3 KB
<!DOCTYPE html>
<html lang="en-GB">
<head>
<meta charset="utf-8">
<title>Roof Repairs, Flat Roofs, Gutters, Chimneys and Emergency Call Outs | Brackenridge Roofing Sheffield</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Roof repairs, flat roofs and guttering in Sheffield, Rotherham and Chesterfield from a family firm trading since 1987.">
<link rel="stylesheet" href="/css/site.css">
<style>
.hero { background: #1f3a4d; color: #fff; }
.badge { width: 120px; }
</style>
<script>
window.siteData = {"name": "Brackenridge Roofing", "phone": "0114 496 0142", "page": "roof-repairs"};
</script>
</head>
<body>
<nav>
<a href="/">Home</a>
<a href="/roof-repairs">Roof repairs</a>
<a href="/flat-roofs">Flat roofs</a>
<a href="/contact">Contact</a>
</nav>
<img src="/img/logo.png" alt="Brackenridge Roofing logo">
<div class="hero">
<h1>Roof repairs in Sheffield</h1>
<img src="/img/call-us-banner.png">
<p>Brackenridge Roofing is a family firm that has been fixing roofs since 1987. We cover Sheffield, Rotherham and Chesterfield.</p>
<p>Prices that will not break the bank. <a href="/quote">Click here</a></p>
</div>
<h2>What we repair</h2>
<h3>Pitched roofs</h3>
<p>Slipped slates, broken tiles, leaking valleys and storm damage.</p>
<img src="/img/slate-repair.jpg" alt="A roofer replacing a slipped slate on a terraced house">
<h3>Flat roofs</h3>
<p>We repair and replace felt, rubber and fibreglass flat roofs.</p>
<img src="/img/flat-roof.jpg" alt="">
<h3>Gutters and chimneys</h3>
<p>We clear, reseal and replace gutters. We repoint chimneys and replace lead flashing.</p>
<p>We do not remove asbestos roofing. We can point you to a licensed firm that does.</p>
<h2>Emergencies</h2>
<h4>Storm damage and leaks</h4>
<p>Our emergency team answers the phone 24 hours a day, every day of the year. <a href="/emergency">Read more</a></p>
<h2>Quotes and timing</h2>
<p>Every quote is free and written down. Most repairs start within five working days of your quote.</p>
<!-- <p>Opening hours: Monday to Friday 8am to 5pm, Saturday 8am to 12 noon.</p> -->
<h2>Why choose us</h2>
<ul>
<li>All new roofs come with a guarantee.</li>
<li>We hold public liability insurance of £5 million.</li>
<li>The same team quotes for the job and does the job.</li>
</ul>
<img class="badge" src="/img/badge-1.png">
<h1>What our customers say</h1>
<h3>A customer in Rotherham</h3>
<p>"They came the same morning and the leak was fixed by lunch."</p>
<img src="/img/team-van.jpg" alt="The Brackenridge team beside their van">
<p>Want to know more about how we work? <a href="/about">Click here</a> or see our <a href="/flat-roofs">flat roof guide</a>.</p>
<footer>
<p>Brackenridge Roofing. Registered in England.</p>
<a href="/privacy">Privacy policy</a>
</footer>
<script src="/js/analytics.js"></script>
</body>
</html>
input/page_standard.md · 20 lines, 1 KB
# Page standard: can a search or answer engine read this page Run these eight checks on the page source. Each one passes or fails. Record the measure for each. | id | check | passes when | measure | | --- | --- | --- | --- | | S1 | Title | there is one title of 30 to 60 characters | characters in the title | | S2 | Description | there is a meta description of 70 to 160 characters | characters in the description, 0 when it is missing | | S3 | Main heading | there is exactly one h1 | number of h1 headings | | S4 | Heading order | no heading is more than one level deeper than the heading before it | number of headings that skip a level | | S5 | Image text | every image has alt text of at least one word | number of images without alt text | | S6 | Structured data | there is at least one script of type application/ld+json | number of such scripts | | S7 | Language | the html tag has a lang value | 1 when it is there, 0 when it is not | | S8 | Link text | no link's whole text is one of: click here, here, read more, more, learn more | number of links with such text | ## What counts as answered An engine can only quote what a reader can see. Count the text shown in the body of the page. Text inside comments, scripts, styles and the head does not count. Words inside a picture do not count. A question is answered only when the page states the specific fact asked for: the number, the place, the year, or a plain yes or no. A clear no is an answer. A promise with no fact in it is not an answer.
input/questions.csv · 15 lines, 631 bytes
question_id,question Q01,Which towns and cities does the company cover? Q02,How much does a roof repair cost? Q03,Can I reach someone at night in an emergency? Q04,How many years is the guarantee on a new roof? Q05,How much public liability insurance does the company hold? Q06,What is the company's phone number? Q07,What are the opening hours? Q08,Does the company repair flat roofs? Q09,Are quotes free? Q10,How soon after a quote can work start? Q11,In what year did the company start? Q12,Which trade body is the company a member of? Q13,Does the company remove asbestos roofing? Q14,What ways to pay does the company accept?
output/answers.csv · written by the agent, 15 lines
question_id,answered,quote Q01,yes,"We cover Sheffield, Rotherham and Chesterfield." Q02,no, Q03,yes,"Our emergency team answers the phone 24 hours a day, every day of the year." Q04,no, Q05,yes,We hold public liability insurance of £5 million. Q06,no, Q07,no, Q08,yes,"We repair and replace felt, rubber and fibreglass flat roofs." Q09,yes,Every quote is free and written down. Q10,yes,Most repairs start within five working days of your quote. Q11,yes,Brackenridge Roofing is a family firm that has been fixing roofs since 1987. Q12,no, Q13,yes,We do not remove asbestos roofing. Q14,no,
output/audit.csv · written by the agent, 9 lines
check_id,result,measure,detail S1,fail,100,"1 title; 100 characters (needs 30 to 60): ""Roof Repairs, Flat Roofs, Gutters, Chimneys and Emergency Call Outs | Brackenridge Roofing Sheffield""" S2,pass,118,118 characters (needs 70 to 160) S3,fail,2,2 h1 headings (needs exactly 1) S4,fail,2,heading order: h1 h2 h3 h3 h3 h2 h4 h2 h2 h1 h3; skips: h2 to h4; h1 to h3 S5,fail,3,images without alt text: /img/call-us-banner.png (no alt attribute); /img/flat-roof.jpg (empty alt); /img/badge-1.png (no alt attribute) S6,fail,0,"0 application/ld+json scripts (the only inline script is a plain JavaScript variable, not structured data)" S7,pass,1,"html lang=""en-GB""" S8,fail,3,"links with weak text: ""Click here""; ""Read more""; ""Click here"""
output/fixes.md · written by the agent, 13 lines
Score: 10 of 22
S1 Shorten the title from 100 characters to 30 to 60 characters.
S3 The page has 2 h1 headings ("Roof repairs in Sheffield" and "What our customers say"). Keep one and change "What our customers say" to an h2.
S4 Two headings skip a level: the h4 "Storm damage and leaks" follows an h2 (make it an h3), and the h3 "A customer in Rotherham" follows an h1 (it will follow an h2 once the second h1 becomes an h2).
S5 Add alt text of at least one word to three images: /img/call-us-banner.png (none), /img/flat-roof.jpg (empty alt) and /img/badge-1.png (none).
S6 Add at least one script of type application/ld+json. The page has none.
S8 Three links have weak text: "Click here" (to /quote), "Read more" (to /emergency) and "Click here" (to /about). Change each to words that say where it goes.
Q02 The page does not state what a roof repair costs. It only says "Prices that will not break the bank", which gives no figure.
Q04 The page says new roofs come with a guarantee but does not state the number of years.
Q06 The phone number is not in the text a reader sees. It appears only inside a script in the head. The page needs to state the number in the body.
Q07 The opening hours are not in the text a reader sees. They appear only in an HTML comment. The page needs to state the hours in the body.
Q12 The page does not name any trade body the company belongs to.
Q14 The page does not state which ways to pay it accepts.
check.py · the check, written before the run
"""Parses the page again, reruns the eight checks and the question tests, and compares them with what the agent wrote."""
import csv, re, sys
from html.parser import HTMLParser
from pathlib import Path
root = Path(sys.argv[1]); ok = True
def say(passed, text):
global ok; ok = ok and passed; print(("PASS " if passed else "FAIL ") + text)
def flat(t): return " ".join((t or "").replace("’", "'").replace("“", '"').replace("”", '"').replace("*", "").split())
class Page(HTMLParser):
def __init__(self):
super().__init__(); self.stack = []; self.title = ""; self.desc = None; self.heads = []; self.imgs = []
self.ld = 0; self.lang = ""; self.links = []; self.text = []; self.titles = 0
def handle_starttag(self, tag, attrs):
a = dict(attrs)
if tag in ("img", "meta", "link", "br", "hr", "input"):
if tag == "img": self.imgs.append((a.get("alt") or "").strip())
if tag == "meta" and (a.get("name") or "").lower() == "description": self.desc = (a.get("content") or "").strip()
return
self.stack.append(tag)
if tag == "html": self.lang = (a.get("lang") or "").strip()
if tag == "title": self.titles += 1
if tag == "script" and (a.get("type") or "").lower() == "application/ld+json": self.ld += 1
if re.fullmatch(r"h[1-6]", tag): self.heads.append(int(tag[1]))
if tag == "a": self.links.append("")
if tag in ("p", "li", "div", "ul", "h1", "h2", "h3", "h4", "h5", "h6", "nav", "footer", "a"): self.text.append(" ")
def handle_endtag(self, tag):
if tag in self.stack:
while self.stack and self.stack.pop() != tag: pass
self.text.append(" " if tag != "a" else "")
def handle_data(self, data):
if "title" in self.stack: self.title += data
if "a" in self.stack and self.links: self.links[-1] += data
if "body" in self.stack and not {"script", "style", "noscript", "template"} & set(self.stack): self.text.append(data)
page = Page(); page.feed((root/"input/page.html").read_text(encoding="utf-8"))
seen = flat("".join(page.text))
vague = {"click here", "here", "read more", "more", "learn more"}
skips = sum(1 for a, b in zip(page.heads, page.heads[1:]) if b - a > 1)
measure = {"S1": len(page.title.strip()), "S2": len(page.desc or ""), "S3": page.heads.count(1), "S4": skips,
"S5": sum(1 for alt in page.imgs if not alt), "S6": page.ld, "S7": 1 if page.lang else 0,
"S8": sum(1 for t in page.links if flat(t).lower().strip(".") in vague)}
passed = {"S1": page.titles == 1 and 30 <= measure["S1"] <= 60, "S2": 70 <= measure["S2"] <= 160, "S3": measure["S3"] == 1, "S4": skips == 0,
"S5": measure["S5"] == 0, "S6": page.ld >= 1, "S7": measure["S7"] == 1, "S8": measure["S8"] == 0}
# the words that state each fact, looked for in the text a reader sees
STATES = {"Q01": r"\bcover [A-Z]\w+", "Q02": r"(repairs? (cost|from|start at)|from|per \w+) £\d|£\d[\d,.]* (per|for a|a) ", "Q03": r"24 hours a day|day and night|at night",
"Q04": r"\d+[- ]years? guarantee|guarantee[^.]*\d+ years?|guaranteed for \d+", "Q05": r"insurance of £\d", "Q06": r"\b0\d{2,4} ?\d{3} ?\d{4}\b",
"Q07": r"opening hours|\d ?(am|pm)\b", "Q08": r"repair[^.]*flat roofs", "Q09": r"quote is free|free quotes?", "Q10": r"start within \w+ (working )?days",
"Q11": r"since (19|20)\d\d|founded in (19|20)\d\d", "Q12": r"members? of ", "Q13": r"(do not|don't|we) remove asbestos",
"Q14": r"\b(pay by|card|cash|bank transfer|cheque)\b"}
qids = [r["question_id"] for r in csv.DictReader((root/"input/questions.csv").open(encoding="utf-8"))]
want = {q: "yes" if re.search(STATES[q], seen, re.I if q != "Q01" else 0) else "no" for q in qids}
apath, npath, fpath = root/"output/audit.csv", root/"output/answers.csv", root/"output/fixes.md"
if not apath.exists() or not npath.exists() or not fpath.exists():
say(False, "audit.csv, answers.csv and fixes.md were not all written"); sys.exit(1)
audit = {(r.get("check_id") or "").strip().upper(): r for r in csv.DictReader(apath.open(encoding="utf-8"))}
res = sum(1 for k, v in passed.items() if (audit.get(k, {}).get("result") or "").strip().lower() == ("pass" if v else "fail"))
say(res == len(passed), f"{res} of {len(passed)} checks have the pass or fail found again by parsing the page")
def number(k):
m = re.search(r"\d+", audit.get(k, {}).get("measure") or ""); return int(m.group(0)) if m else None
meas = sum(1 for k, v in measure.items() if number(k) == v)
say(meas == len(measure), f"{meas} of {len(measure)} measures equal a fresh count (title {measure['S1']} characters, {measure['S3']} h1 headings, {measure['S4']} skipped levels, {measure['S5']} images without alt text, {measure['S8']} vague links)")
answers = {(r.get("question_id") or "").strip().upper(): r for r in csv.DictReader(npath.open(encoding="utf-8"))}
def ans(q): return (answers.get(q, {}).get("answered") or "").strip().lower()
agree = sum(1 for q in qids if ans(q) == want[q])
say(agree == len(qids), f"{agree} of {len(qids)} questions are marked answered or not as the page's visible text shows")
yes = [q for q in qids if ans(q) == "yes"]
quoted = sum(1 for q in yes if len(flat(answers[q].get("quote"))) >= 10 and flat(answers[q].get("quote")).strip('" ') in seen)
say(yes and quoted == len(yes), f"{quoted} of {len(yes)} quotes for answered questions appear word for word in the text a reader sees")
fixes = fpath.read_text(encoding="utf-8")
score = sum(passed.values()) + sum(1 for v in want.values() if v == "yes"); total = len(passed) + len(qids)
first = next((l for l in fixes.splitlines() if l.strip()), "")
say(re.search(r"score\D*%d\s*(of|/|out of)\s*%d\b" % (score, total), first, re.I) is not None, f"fixes.md opens with the score {score} of {total}")
failed = [k for k, v in passed.items() if not v]; unanswered = [q for q in qids if want[q] == "no"]
named_f = sum(1 for k in failed if re.search(r"\b%s\b" % k, fixes)); named_q = sum(1 for q in unanswered if re.search(r"\b%s\b" % q, fixes))
starts = [m.group(1).upper() for m in re.finditer(r"(?mi)^\W*([SQ]\d+)\b", fixes)]
extra = [s for s in starts if s not in failed + unanswered]
say(named_f == len(failed) and named_q == len(unanswered) and not extra and len(starts) == len(set(starts)),
f"fixes.md names {named_f} of {len(failed)} failed checks and {named_q} of {len(unanswered)} unanswered questions and gives a line to {len(extra)} others")
def plain_figs(text): return [n.replace(",", "") for n in re.findall(r"(?<![\w./-])\d[\d,]*(?:\.\d+)?(?![\w-])", text)]
known = set(plain_figs((root/"input/page_standard.md").read_text(encoding="utf-8"))) | set(plain_figs((root/"input/page.html").read_text(encoding="utf-8")))
known |= {str(v) for v in measure.values()} | {str(n) for n in (score, total, len(failed), len(unanswered), sum(passed.values()), len(passed), len(qids), len(qids) - len(unanswered))}
ffigs = plain_figs(fixes); f_right = sum(1 for n in ffigs if n in known)
say(ffigs and f_right == len(ffigs), f"{f_right} of {len(ffigs)} figures in fixes.md are limits from the page standard, counts found again on the page or the score")
sys.exit(0 if ok else 1)
page.html: sample data written by Atris. Fingerprint ca162210831d.
page_standard.md: sample data written by Atris. Fingerprint 3743db897977.
questions.csv: sample data written by Atris. Fingerprint 72dc834d90a7.
answers.csv: written by the agent. Fingerprint 6212ef5e1cbd.
audit.csv: written by the agent. Fingerprint 1c90aec48b1b.
fixes.md: written by the agent. Fingerprint 275c07dabba3.