seo-audit-skill
AGENTS.md1k starsChanged 12 days agoMITView on GitHub
Guidance for AI agents working in this repository. claude.md covers the same ground in more depth — read it for anything not spelled out here. SEOmator (@seomator/seo-audit) is an SEO audit engine: 398 rules across 20 weighted categories, shipped as (a) an npm CLI, (b) an Electron desktop app, (c) a Claude Code skill. It fetches pages, parses HTML with Cheerio, optionally renders with Playwright (Core Web Vitals + rendered DOM), and produces weighted scores and reports. Electron: npm run…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,337 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
We split this AGENTS.md into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 87
No new dependencies without checking: Use what src/ already imports (cheerio, etc.).
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
Guidance for AI agents working in this repository. claude.md covers the same
ground in more depth — read it for anything not spelled out here.
Project Overview
SEOmator (@seomator/seo-audit) is an SEO audit engine: 398 rules across 20
weighted categories, shipped as (a) an npm CLI, (b) an Electron desktop app,
(c) a Claude Code skill. It fetches pages, parses HTML with Cheerio, optionally
renders with Playwright (Core Web Vitals + rendered DOM), and produces weighted
scores and reports.
src/— the shared audit engine (CLI + Electron both import it)electron/— desktop app, purely additive, never modifiessrc/docs/— documentation, includingSEO-AUDIT-RULES.md(rule reference)skill/+SKILL.md— the published agent skill wrapper
Commands
npm run build # clean dist/, tsup (CLI + library), then web:build (dashboard)
npm run typecheck # tsc --noEmit — runs on prepublish, must stay green
npm run test:run # vitest, all tests once
npx vitest run src/rules/core/core.test.ts # single test file
./dist/cli.js audit https://example.com --no-cwv # smoke-run after buildElectron: npm run electron:dev etc. — but rebuild the native module first
when switching sides: npm run rebuild:electron before Electron,
npm run rebuild:cli before CLI/tests. Mismatch → NODE_MODULE_VERSION
error. Do not call electron-rebuild or npm rebuild directly: the scripts
also re-sign the module, without which Electron dies silently on Apple
Silicon (see claude.md).
Hard Constraints (breaking these ships broken software)
package.jsonis dual-purpose.main= Electron entry (./dist-electron/main/index.js),exports/bin= CLI (./dist/cli.js),files: ["dist"]= only the CLI ships to npm. Do not repointmain.- Dependency split.
dependencies= CLI only. React/zustand/recharts/ electron stay indevDependenciesor npm users download ~15MB of UI code. src/stays Electron-free. Electron reachessrc/via the@corealias; never the reverse.- Category weights sum to exactly 100 (
validateCategoryWeights()insrc/categories/index.ts). Adding rules to an existing category does not touch this; adding/changing a category does. - Registry throws on duplicate rule IDs (
src/rules/registry.ts). An accidental re-registration crashes rule loading at import time.
Rule System in Brief
- Rules are
defineRule({ id, name, description, category, weight, run })objects, self-registered viaregisterRule()in eachsrc/rules/<category>/index.ts, pulled in by static imports insrc/rules/loader.ts. run(context: AuditContext)returnspass()(100),warn()(50),fail()(0), ornotMeasured()(statusnot-measured, weight 0, excluded from scoring).AuditContext(src/types.ts): page data always present; Tier 2 (robotsTxtContent,sitemapContent,sitemapUrls,sitemapEntries,redirectChain) fetched once per audit; Tier 4 (rendered$,renderDiagnostics,mobile$) only with Playwright;site(SiteContext link graph) only in crawl mode. All of these are optional — check forundefined.- Category score = weighted average of rule scores; overall = weighted average of category scores.
Adding a Rule Without Breaking the Stable Audit
This is the checklist for the hint-coverage-expansion rules:
- File:
src/rules/<category>/<rule-name>.ts, ID<category>-<name>(e.g.crawl-canonical-to-noindex). Register it in the category'sindex.ts. No loader/config wiring needed — rules are enabled by default (src/rules/pattern-matcher.ts), so a new rule is live in every audit immediately. - Never throw. The Auditor catches rule exceptions and records them as
not measured with reason
rule-error(runRule()insrc/auditor.ts) — a crashy rule silently loses its reading on every page. Guard every optional context field; if the data a rule needs wasn't collected, returnnotMeasured(), neverfail(). - No state between pages. Rules keep no module-level state. A cross-page
check reads the finished crawl from
context.site(absent without--crawl), and a rule that needs another URL asksurlServiceFor(context)(src/net/url-service.ts), which makes each request once per run. - No new dependencies without checking. Use what
src/already imports (cheerio, etc.). New runtime deps land on every npm user. - Tests: extend
src/rules/<category>/<category>.test.ts. Build a minimalAuditContextwithcheerio.load(html),null as anyfor irrelevant fields, import the rule file directly (not the index). Cover at minimum: pass case, fail case, and the missing-data →notMeasuredcase. - Score impact is expected but must be visible: each new rule dilutes its
category average, so existing sites' scores will shift. Note this in
CHANGELOG.md. Do not "compensate" by changing category weights. - Update the hardcoded rule count (currently "398 rules"; was 287 before the
hint-coverage expansion) everywhere when rules
ship:
README.md,SKILL.md,skill/SKILL.md,skill/references/rules.md,references/rules.md,docs/introduction.md,docs/SEO-AUDIT-RULES.md(add the rule entries themselves),claude.md,package.jsondescription. - Verify before done:
npm run typecheck && npm run test:rungreen, plus one real smoke run (./dist/cli.js audit <url> --no-cwv) confirming the new rule appears and scores sanely. If you ran Electron since the last CLI use,npm run rebuild:clifirst. - Electron needs no changes — the renderer receives rule metadata from
the registry at runtime — but the audit flow there must still work, so
don't change shared types (
AuditContext,RuleResult,AuditResult) in ways that breakelectron/sharedIPC contracts. Additive optional fields only.
Reference Material for the Hint-Coverage Work
reports/hints-catalog.json— extracted hint inventoryreports/hints-mapping.json— per-hint COVERED/PARTIAL/MISSING verdict with our rule IDsscripts/map-hints.mjs— re-runnable validation (fails on unmapped slug) if the reference catalog changes
Style
TypeScript ESM, ES2022, .js suffix on relative imports. Match the
surrounding rule files: JSDoc on exports, terse rule bodies, thresholds as
named constants. Comments describe what the code actually does — update them
when behavior changes.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

