Skip to content

Writing Rule Packs

OCEANOFANYTHING edited this page Nov 24, 2026 · 1 revision

This page is the complete guide to writing your own rule packs: the file format, every test and operator, scopes, a step-by-step tutorial that builds a real pack and tests it on a live site, how to read validation errors, and how to share your pack. You don't need to be a programmer: if you can read a CSS selector or a simple regular expression, you can write a rule.

To learn how to load and use packs, see Rule packs first.

Every TOML example on this page was checked with shouting-toad rules validate and passes.

What a rule pack is

A rule pack is one plain-text file with the extension .toml. It has:

  • one [pack] section that names the pack, and
  • one or more [[rule]] sections, each describing one check: its name, type, priority, explanation, fix, and the condition (when) a URL must meet to be reported.
[pack]
name = "My Agency"

[[rule]]
id = "old-shop-links"
name = "Links to the old shop"
when = { selector = 'a[href*="shop.example.com"]' }

That's a complete, valid pack. Every page that contains a link to shop.example.com is reported as a Warning (the default type) with Medium priority (the default priority).

TOML basics you need:

  • key = "text" or key = 'text'. Text in double quotes treats a backslash as an escape character; text in single quotes is taken literally. Always use single quotes for regular expressions and CSS selectors, so '\d+' means exactly what it says.
  • { key = value, key = value } is an inline table (it must stay on one line, but a list [ ... ] inside it may span lines).
  • [ a, b ] is a list.
  • # text is a comment.
  • Numbers are written without quotes: status = 404.

Format reference

Unknown keys are errors, so a typo such as severity instead of priority is caught when the pack loads.

The [pack] section

Key Required Meaning
name yes Display name, for example "WordPress". Also the default category of the pack's rules.
id no Prefix of every rule id. Lower-case letters, digits, - and _, starting with a letter or digit, at most 64 characters. Defaults to the file name in lower case (my-agency.toml gives my-agency). If the file name contains spaces or other characters, set id explicitly or the pack is refused.
version no Your pack's version, for example "1.2.0". Shown in the app and in rules list.
author no Who maintains it. Shown as "by …".
homepage no Where the pack lives. When it starts with http, the app shows a homepage link.
description no One or two sentences about what the pack checks.
min_version no Oldest ShoutingToad version the pack works with, for example "1.1.0". An older ShoutingToad refuses the pack with this pack needs ShoutingToad 1.1.0 or newer (this is 1.0.0).

Full example:

[pack]
id = "examples"
name = "Examples"
version = "1.0.0"
author = "Example Agency"
homepage = "https://example.com/seo-rules"
description = "Every example from the Writing rule packs guide."
min_version = "1.0.0"

A [[rule]] section

Key Required Meaning Default
id yes Unique within the pack. Same character rules as the pack id. The full id is pack-id/rule-id: that is what --fail-on-check, the CSV exports and the app show.
name yes Short title, for example "Default tagline is still set".
when yes The condition a URL must meet to be reported.
category no A built-in category name ("Security", "Content", "Structured Data", … matched without regard to case, so "structured data" joins the built-in group) or a new one (1 to 40 characters). the pack name
kind no "issue" (something is broken), "warning" (probably a problem) or "opportunity" (an improvement). Case doesn't matter. "warning"
priority no "high", "medium" or "low". Issues at or above the --fail-on level fail CI. "medium"
description no What the finding means and why it matters. Shown in the app, the report and issues.csv. empty
fix no How to fix it. Shown as How to fix. empty
scope no Which URLs the rule looks at (see Scopes). "html"

kind and priority also weigh the rule in the health score, exactly like built-in checks.

A rule with every key:

[[rule]]
id = "full"
name = "Rule with every key"
category = "Content"
kind = "issue"
priority = "high"
description = "What the finding means and why it matters."
fix = "How to fix it."
scope = "indexable"
when = { word_count = '< 150' }

Scopes

A rule only looks at URLs in its scope. robots.txt and XML sitemap files are never in scope.

Scope URLs it looks at Typical use
html (default) Internal HTML pages that returned 200. Most content and template rules.
indexable Internal HTML pages that are indexable: status 200, no noindex, canonical to themselves (or no canonical), not blocked by robots.txt, no meta refresh. Duplicate-content and "should not be indexable" rules: a page that is already noindexed or canonicalised is not a problem.
internal Every internal URL: pages, redirects, errors, images, CSS, JavaScript, PDFs. URL pattern and status rules.
external External URLs. (External links are only checked for status and headers, so selector, html and HTML-only number tests never match here.) Rules about outgoing links.
all Internal and external URLs. URL patterns anywhere.
images Image URLs, internal or external. Image size rules.
css CSS files, internal or external. Stylesheet rules.
js JavaScript files, internal or external. Script rules.
[[rule]]
id = "big-images"
name = "Image over 300 KB"
scope = "images"
when = { size = '> 300000' }

Conditions

when holds the test (or tests) a URL must pass to be reported. It is either one table with exactly one test, or a list of tables that must all match:

when = { url = '/products/' }                                # one test
when = [ { url = '/products/' }, { word_count = '< 150' } ]  # all must match

Putting two tests in one table is an error (one test per table, found depth and url: combine tests with all = [ ... ] or any = [ ... ]).

Combining tests: all, any, not

Test Matches when
all = [ {…}, {…} ] every condition in the list matches (same as a plain list)
any = [ {…}, {…} ] at least one condition matches
not = {…} the condition does not match
when = { any = [ { url = '/tag/' }, { url = '/author/' } ] }
when = [ { word_count = '< 100' }, { not = { url = '/blog/' } } ]

They nest as deep as you need. "Blog pages with neither a <time datetime> element nor datePublished in the source":

when = { all = [ { url = '/blog/' }, { not = { any = [ { selector = 'time[datetime]' }, { html = 'datePublished' } ] } } ] }

all and any can't be empty.

Page content: selector

selector tests the page's HTML elements with a CSS selector.

Keys Matches when
selector = 'css' at least one element matches the selector
selector, exists = false no element matches
selector, count = '>= 3' the number of matching elements passes the comparison
selector, attr = 'name' only elements that have this attribute are counted
selector, matches = 'regex' only elements whose text matches the regex are counted
selector, attr, matches only elements whose attribute value matches the regex are counted

count and exists can't be used together (use either count or exists, not both). exists = true is the default.

Examples:

when = { selector = 'a[href*="shop.example.com"]' }                       # links to the old shop
when = { selector = '#cookie-banner', exists = false }                    # cookie banner missing
when = { selector = 'h1', count = '> 1' }                                 # more than one H1
when = { selector = 'img:not([alt])' }                                    # an image without alt
when = { selector = 'meta[name="generator" i]', attr = 'content', matches = '^WordPress \d' }
when = { selector = 'script[type="application/ld+json"]', matches = '"@type"\s*:\s*"Product"', exists = false }
when = { selector = 'a[rel~="nofollow"]', attr = 'href', matches = '^/', count = '>= 3' }  # 3+ nofollowed internal links

Selectors support CSS Level 4 as implemented by the selectors library: tag, #id, .class, attribute selectors with all operators (=, ~=, |=, ^=, $=, *=) and the case-insensitive i flag, :not(), :nth-child(), :first-child and similar, and the combinators (descendant, >, +, ~).

Page content: html

html runs a regular expression over the raw HTML source, exactly as served, including comments and scripts (which the selector test doesn't see as text).

Keys Matches when
html = 'regex' the source contains a match
html, exists = false the source contains no match
html, count = '>= 3' the number of matches passes the comparison
when = { html = '<!--\s*TODO' }                                     # a TODO comment left in the source
when = { html = '<iframe\b', count = '>= 3' }                       # three or more iframes
when = { html = 'googletagmanager\.com/gtm\.js', exists = false }   # tag manager missing

Good to know about selector and html tests:

  • They only run on HTML pages. On any other URL (an image, a PDF, a redirect) they don't match, whatever exists says.
  • They are evaluated by the crawler while it reads each page, on the HTML as the server sent it (before any JavaScript runs, even when JavaScript rendering is on). Only the match counts are kept, two bytes per test per page, so they cost little memory even on 50,000 pages. Identical tests in different rules or packs are evaluated once.
  • Because of that, after you add or change a selector or html test you need a new crawl to see its results. Opening a saved crawl or re-running the audit applies URL, header and number tests at once; selector and html tests the crawl didn't evaluate stay silent.

Response: url, content_type, header

Keys Matches when
url = 'regex' the full URL matches
content_type = 'regex' the Content-Type header matches
header = 'name' the response has this header (the name is not case-sensitive)
header, matches = 'regex' a header with that name has a matching value
header, exists = false the header is missing
header, matches, exists = false no value of that header matches (including when the header is missing)
when = { url = '^https?://[^/]+/.*[A-Z]' }          # upper-case letters in the path (scope = "internal")
when = { url = '(?i)staging' }                       # "staging" anywhere, any case
when = { content_type = '^application/pdf' }         # PDF files (scope = "internal")
when = { header = 'x-powered-by' }                   # the server reveals its technology
when = { header = 'cache-control', matches = 'no-store' }
when = { header = 'content-language', exists = false }
when = { header = 'server', matches = '(?i)cloudflare', exists = false }   # not served through the CDN

Numbers and comparisons

Compare a number with field = 300 (equals) or a string with an operator: '>= 2', '> 2', '<= 1.5', '< 300', '!= 0', '== 0' (or '= 0'). Decimals are allowed. Anything else is an error ('slow' is not a comparison: use a number or e.g. ">= 2", "< 300", "!= 0").

Field Value HTML only
status HTTP status code (0 when there was no response)
response_ms response time in milliseconds
size body size in bytes after decompression
transfer_size bytes on the wire
depth clicks from the start page
inlinks internal links pointing at the URL
word_count words of visible text yes
title_length characters in the first <title> (0 when missing) yes
description_length characters in the first meta description (0 when missing) yes
h1_count number of H1 headings yes
outlinks number of <a href> links on the page yes
images number of images on the page yes

Fields marked "HTML only" never match on URLs that are not HTML pages.

when = { status = 404 }
when = { any = [
  { response_ms = '> 2000' },
  { size = '>= 500000' },
  { transfer_size = '>= 300000' },
  { depth = '> 4' },
  { inlinks = '<= 1' },
  { title_length = '== 0' },
  { description_length = '!= 0' },
  { h1_count = 0 },
  { outlinks = '> 300' },
  { images = '>= 50' },
  { word_count = '<= 1.5' },
] }

Regular expressions

  • Rust regex syntax (reference): . any character, \d digit, \s whitespace, \b word boundary, [abc], (a|b), ?, *, +, {2,5}, ^ start, $ end.
  • Case-sensitive by default; start with (?i) to ignore case.
  • They match anywhere in the text unless you anchor them with ^ and $. url = '/blog/' matches https://example.com/blog/post and https://example.com/en/blog/.
  • Look-around ((?=…), (?!…), (?<=…)) and back-references (\1) are not supported, which also guarantees a regex can never hang a crawl. To express "not", use the not test.
  • Escape special characters with a backslash: \. for a literal dot, \? for a literal question mark.

Tutorial: write a pack for a bookshop

We'll write house rules for https://books.toscrape.com/, a public demo shop made for crawler testing. The goals:

  • find the "this is a demo website" warning banner (it must not go live),
  • make sure every product page has a breadcrumb,
  • flag products with a one-star rating and products with only 1 to 3 copies left,
  • find dead review markup hidden in HTML comments,
  • find product pages that are too deep in the site,
  • check the HSTS security header.

Step 1: look at the page source

Open a product page in your browser, right-click and choose View page source. The parts we care about (trimmed):

<ul class="breadcrumb"> ...
<div class="col-sm-6 product_main">
    <h1>Tipping the Velvet</h1>
    <p class="price_color">£53.74</p>
    <p class="instock availability"> In stock (20 available) </p>
    <p class="star-rating One"> ...
<div class="alert alert-warning" role="alert"><strong>Warning!</strong> This is a demo website for web scraping purposes. ...
<!-- <small><a href="/catalogue/a-light-in-the-attic_1000/reviews/"> ...

And the response headers include Strict-Transport-Security: max-age=0; includeSubDomains; preload.

Step 2: create the file

Create a text file named bookshop.toml (any text editor works; save it as UTF-8). Start with the pack header:

[pack]
name = "Bookshop"
version = "1.0.0"
author = "Example Agency"
description = "House rules for the demo bookshop: product page template, stock and rating checks."

The pack id becomes bookshop (from the file name).

Step 3: add the rules

The demo banner (an Issue, High priority). The banner is a .alert-warning element whose text contains "demo website":

[[rule]]
id = "demo-warning"
name = "Demo-site warning banner is live"
kind = "issue"
priority = "high"
description = "The page shows the 'This is a demo website' banner. Visitors will think the shop is not real."
fix = "Remove the alert-warning block from the product template."
when = { selector = '.alert-warning', matches = '(?i)demo website' }

No category, so it goes into a new category named after the pack: Bookshop.

Product page without breadcrumb: two conditions in a list (all must match): the URL is a product page, and there is no ul.breadcrumb:

[[rule]]
id = "product-no-breadcrumb"
name = "Product page without breadcrumb"
category = "Links"
kind = "issue"
priority = "medium"
description = "A product page has no breadcrumb trail, so visitors and search engines lose the path back to the category."
fix = "Include the breadcrumb partial in the product template."
when = [
  { url = '/catalogue/[^/]+_\d+/index\.html$' },
  { selector = 'ul.breadcrumb', exists = false },
]

One-star products. A first attempt:

[[rule]]
id = "one-star-product"
name = "Product with a one-star rating"
category = "Content"
kind = "opportunity"
priority = "low"
description = "The product shows a one-star rating. Low ratings shown prominently can hurt conversions."
fix = "Review the product: improve the description, or ask happy customers for reviews."
when = { selector = 'p.star-rating.One' }

(We'll find a problem with this one in step 6.)

Low stock: a selector with a text regex. The parentheses are escaped because they are literal characters:

[[rule]]
id = "low-stock"
name = "Only 1 to 3 copies left"
category = "Content"
kind = "warning"
priority = "low"
description = "The stock line says only 1, 2 or 3 copies are available."
fix = "Reorder the book, or plan what the page should show when it sells out."
when = { selector = 'p.instock.availability', matches = '\(([1-3]) available\)' }

Commented-out reviews: comments are invisible to selectors, so use an html test:

[[rule]]
id = "commented-out-reviews"
name = "Reviews link commented out in the HTML"
category = "Content"
kind = "opportunity"
priority = "low"
description = "The template contains a reviews link inside an HTML comment, so reviews are never shown."
fix = "Either enable reviews or remove the dead markup from the template."
when = { html = '<!--\s*<small><a href="[^"]*/reviews/' }

Deep product pages: a URL test plus a number test, and scope = "indexable" so non-indexable copies are ignored:

[[rule]]
id = "deep-product-page"
name = "Product page five or more clicks deep"
category = "Links"
kind = "opportunity"
priority = "low"
description = "The product can only be reached after five or more clicks from the home page."
fix = "Link popular products from the home page or category landing pages."
scope = "indexable"
when = [ { url = '/catalogue/[^/]+_\d+/' }, { depth = '>= 5' } ]

HSTS switched off: a header test, in the built-in Security category:

[[rule]]
id = "hsts-disabled"
name = "HSTS switched off (max-age=0)"
category = "Security"
kind = "warning"
priority = "medium"
description = "The Strict-Transport-Security header has max-age=0, which tells browsers to forget the HTTPS-only policy."
fix = "Set max-age to at least 31536000 (one year) once the whole site works over HTTPS."
when = { header = 'strict-transport-security', matches = 'max-age=0\b' }

Step 4: validate

Run:

shouting-toad rules validate bookshop.toml
Bookshop (bookshop) 1.0.0 by Example Agency: 7 rules in bookshop.toml
All rule packs are valid.

Then list the rules to check their full ids and categories:

$ shouting-toad rules list bookshop.toml
Bookshop (bookshop) 1.0.0 by Example Agency: 7 rules in bookshop.toml
  bookshop/demo-warning                        Issue       High   Bookshop: Demo-site warning banner is live
  bookshop/product-no-breadcrumb               Issue       Medium Links: Product page without breadcrumb
  bookshop/one-star-product                    Opportunity Low    Content: Product with a one-star rating
  bookshop/low-stock                           Warning     Low    Content: Only 1 to 3 copies left
  bookshop/commented-out-reviews               Opportunity Low    Content: Reviews link commented out in the HTML
  bookshop/deep-product-page                   Opportunity Low    Links: Product page five or more clicks deep
  bookshop/hsts-disabled                       Warning     Medium Security: HSTS switched off (max-age=0)

If something is wrong, see Validating a pack below.

Step 5: test it on the site

Crawl a small part of the site with the pack. Keep it small and polite while you test:

shouting-toad crawl https://books.toscrape.com/ --rules bookshop.toml --max-urls 150 --threads 4 --delay 150 --out bookshop-run

The summary now includes your rules:

Loaded 7 rules from 1 rule pack(s)
Crawling https://books.toscrape.com/ …
...
Crawled 151 URLs in 27.9s (5 URLs/s). Health score: 64/100
Audit took 0.0s, writing reports took 0.1s
5 issues, 16 warnings, 34 opportunities (481 checks run)
  [Issue       High  ] Security: Mixed Content                                    105 URLs
  [Issue       High  ] Bookshop: Demo-site warning banner is live                 105 URLs
  ...
  [Warning     Medium] Security: HSTS switched off (max-age=0)                    105 URLs
  ...

Open bookshop-run/issues.csv and filter the Issue ID column for bookshop/ (first six columns shown: Issue ID, Category, Issue, Type, Priority, URLs):

bookshop/demo-warning,Bookshop,Demo-site warning banner is live,Issue,High,105
bookshop/hsts-disabled,Security,HSTS switched off (max-age=0),Warning,Medium,105
bookshop/low-stock,Content,Only 1 to 3 copies left,Warning,Low,3
bookshop/one-star-product,Content,Product with a one-star rating,Opportunity,Low,94
bookshop/commented-out-reviews,Content,Reviews link commented out in the HTML,Opportunity,Low,49

product-no-breadcrumb and deep-product-page found nothing, which is correct: every product page has a breadcrumb, and a 150-URL crawl doesn't go five clicks deep.

Step 6: check for false positives and refine

94 one-star products out of about 50 product pages in the crawl can't be right. Open issue_urls.csv, filter for bookshop/one-star-product, and open a few of the URLs in a browser:

  • Category listing pages show many products, each with its own p.star-rating, so any listing with a one-star book matches.
  • Product pages have a "Products you recently viewed" block with more star ratings, so a three-star book can match because of a one-star book in that block.

The fix is to only look at the rating inside the main product area, .product_main:

when = { selector = '.product_main p.star-rating.One' }

Validate again and re-crawl (selector changes always need a new crawl). Now the rule reports 13 product pages, and each one really has a one-star rating.

Always check a sample of what a rule reports, and also a few pages that should not be reported. A rule that cries wolf gets ignored.

Step 7: look at the results in the app

  1. Open Configuration → Rule packs…, click Add pack file… and pick bookshop.toml. The dialog shows ✔ Bookshop 1.0.0 by Example Agency: 7 rules. After editing the file later, click Reload.

    The Rule packs dialog with bookshop.toml loaded

  2. Open the crawl (File → Open crawl…, bookshop-run/crawl.shoutingtoad) or crawl again from the app. Your rules appear in the Issues panel under their categories: HSTS switched off (max-age=0) under Security, Only 1 to 3 copies left under Content, and so on. Click one to see its URLs, with your description and fix above the table, and select a URL to see the rule in the inspector's Issues tab.

    The low-stock rule selected: its description and fix above the URL table, and the demo-banner rule in the inspector

Step 8: use it as a gate

To fail a deployment when the demo banner is still there:

shouting-toad crawl https://staging.example.com --rules bookshop.toml --fail-on-check bookshop/demo-warning

The run exits with code 2 if the rule finds anything. --fail-on high also counts your rule, because it is an Issue with High priority. See CI and GitHub Actions.

Validating a pack

shouting-toad rules validate <file or folder> checks the TOML syntax, every key, every regex and every CSS selector, without crawling. Problems are printed as error: file:line: rule 'id': message, and the command exits with code 1. The same messages appear in red in the Rule packs dialog, and an invalid pack passed to crawl --rules stops the crawl.

Here is a real draft full of mistakes:

[pack]
name = "Bookshop"

[[rule]]
id = "one-star-product"
name = "Product with a one-star rating"
kind = "opportunty"
when = { selector = 'p.star-rating.One[' }

[[rule]]
id = "Low-Stock"
name = "Only 1 to 3 copies left"
when = { selector = 'p.instock', count = '>= 1', exists = true }

[[rule]]
id = "slow-page"
name = "Slow page"
when = { response_ms = 'slow' }

[[rule]]
id = "deep-product-page"
name = "Deep product page"
scope = "products"
when = { url = '/catalogue/(?=[a-z])', depth = '>= 5' }
$ shouting-toad rules validate broken/bookshop-draft.toml
error: broken/bookshop-draft.toml:5: rule 'one-star-product': kind 'opportunty' must be issue, warning or opportunity
error: broken/bookshop-draft.toml:8: rule 'one-star-product': when: invalid CSS selector "p.star-rating.One[": Unexpected EOL
error: broken/bookshop-draft.toml:11: rule 'Low-Stock': rule id must be lower-case letters, digits, '-' or '_'
error: broken/bookshop-draft.toml:13: rule 'Low-Stock': when: use either `count` or `exists`, not both
error: broken/bookshop-draft.toml:18: rule 'slow-page': when: response_ms: 'slow' is not a comparison: use a number or e.g. ">= 2", "< 300", "!= 0"
error: broken/bookshop-draft.toml:21: rule 'deep-product-page': scope 'products' must be one of: html, indexable, internal, external, all, images, css, js
error: broken/bookshop-draft.toml:24: rule 'deep-product-page': when: one test per table, found depth and url: combine tests with all = [ ... ] or any = [ ... ]
7 problem(s) found

The line number points at the rule's id line for rule-level problems and at the when line for condition problems. In the app:

The same problems shown in red in the Rule packs dialog

Once the "one test per table" problem is fixed by splitting the table into a list, the regex itself is checked, and look-ahead is refused:

error: broken/look.toml:7: rule 'a': when: invalid regex in `url` ("/catalogue/(?=[a-z])"): error: look-around, including look-ahead and look-behind, is not supported

A misspelt key is caught too:

error: broken/typo.toml:3: unknown field `severity`, expected one of `id`, `name`, `version`, `author`, `homepage`, `description`, `min_version`

All validation messages:

Message Cause and fix
unknown field 'x', expected one of … A misspelt or unsupported key. Use one of the listed keys.
(TOML syntax messages) A quote, bracket or comma is missing. The line number points close to it.
pack id '…' must be lower-case letters, digits, '-' or '_' (set id under [pack]) The file name is not a valid id (spaces, capitals). Set id under [pack] or rename the file.
[pack] needs a name name is empty.
min_version '…' is not a version like "1.1.0" Use three numbers separated by dots.
this pack needs ShoutingToad X or newer (this is Y) Update ShoutingToad.
the pack has no [[rule]] entries Add at least one rule.
rule id must be lower-case letters, digits, '-' or '_' Rename the rule id.
duplicate rule id in this pack Two rules have the same id.
the rule needs a name name is empty.
kind '…' must be issue, warning or opportunity Fix the spelling.
priority '…' must be high, medium or low Fix the spelling.
scope '…' must be one of: html, indexable, internal, external, all, images, css, js Use one of those scopes.
category must be 1 to 40 characters Shorten (or fill in) the category.
when: a condition is a table such as { url = '/blog/' } or a list of them, got … when must be { … } or [ { … }, … ].
when: no test in { … }: use one of all, any, not, selector, html, header, url, content_type, status, … The table has no test key.
when: one test per table, found X and Y: combine tests with all = [ ... ] or any = [ ... ] Split into a list.
when: `x` does not go with `selector` (allowed: attr, matches, count, exists) An extra key that this test doesn't take.
when: `url` takes no other keys (found `x`) url, content_type, number tests and all/any/not take no extra keys.
when: `exists` must be true or false Write exists = false without quotes.
when: use either `count` or `exists`, not both Keep one.
when: count: … is not a comparison … / when: status: … Use a number or a string like '>= 2'.
when: `all` must be a list / `any` is empty Use all = [ {…}, {…} ] with at least one item.
when: invalid CSS selector "…": … Fix the selector (often a missing ] or quote).
when: invalid regex in `url` ("…"): … Fix the regex. Look-around and back-references are not supported.
when: `header` needs a header name header = '' is empty.
could not read the file: … / could not read the folder: … The path is wrong or not readable.
pack id '…' is already used by … Two loaded packs have the same id: change id in one of them.
no rule packs found The folder you passed contains no .toml files.

Writing good rules

Before you share a pack, check that each rule:

  • reports something a site owner can act on, with a fix that says how;
  • is true on real sites: test it on a few, including sites that do it right (no findings expected);
  • has the right kind: an Issue is broken, a Warning is likely a problem, an Opportunity is an improvement;
  • uses the narrowest scope that works (indexable for duplicate-content rules, images for image rules);
  • anchors URL regexes when a partial match could catch the wrong pages ('/blog/' also matches /en/blog/ and /blog-archive/);
  • targets the main content with specific selectors, so navigation, footers and "related items" blocks don't cause false positives (as in step 6 of the tutorial);
  • doesn't duplicate a built-in check. Search Help → All checks… or shouting-toad checks first.

Sharing a pack

  • Publish it on GitHub in a repository with the topic shoutingtoad-rules, so others can find it. Say in the README which ShoutingToad version you tested with, set homepage to the repository, set min_version if you use newer features, and bump version when rules change.
  • Send it upstream. Packs that are useful to many sites are welcome as pull requests to the rules/ folder of the ShoutingToad repository:
    1. Fork the repository on GitHub and add your .toml file to rules/.
    2. Run shouting-toad rules validate rules/ and make sure it prints All rule packs are valid.
    3. Open a pull request. List the sites you tested each rule on, and what each rule found there.
  • Keep it in your project. A pack checked into a site's repository can gate every deploy: --rules .seo/rules.toml --fail-on high.

Next steps: Rule packs · Checks reference · Command line · CI and GitHub Actions

Clone this wiki locally