agentleFS
seo-skillsseo-skills/seo-audit-skill/AGENTS.md

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.

  • In this repository3 other files it gives its agents.

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
  1. Very specific:

    No new dependencies without checking: Use what src/ already imports (cheerio, etc.).

    line 87

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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 modifies src/
  • docs/ — documentation, including SEO-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 build

Electron: 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)

  1. package.json is 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 repoint main.
  2. Dependency split. dependencies = CLI only. React/zustand/recharts/ electron stay in devDependencies or npm users download ~15MB of UI code.
  3. src/ stays Electron-free. Electron reaches src/ via the @core alias; never the reverse.
  4. Category weights sum to exactly 100 (validateCategoryWeights() in src/categories/index.ts). Adding rules to an existing category does not touch this; adding/changing a category does.
  5. 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 via registerRule() in each src/rules/<category>/index.ts, pulled in by static imports in src/rules/loader.ts.
  • run(context: AuditContext) returns pass() (100), warn() (50), fail() (0), or notMeasured() (status not-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 for undefined.
  • 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:

  1. File: src/rules/<category>/<rule-name>.ts, ID <category>-<name> (e.g. crawl-canonical-to-noindex). Register it in the category's index.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.
  2. Never throw. The Auditor catches rule exceptions and records them as not measured with reason rule-error (runRule() in src/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, return notMeasured(), never fail().
  3. 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 asks urlServiceFor(context) (src/net/url-service.ts), which makes each request once per run.
  4. No new dependencies without checking. Use what src/ already imports (cheerio, etc.). New runtime deps land on every npm user.
  5. Tests: extend src/rules/<category>/<category>.test.ts. Build a minimal AuditContext with cheerio.load(html), null as any for irrelevant fields, import the rule file directly (not the index). Cover at minimum: pass case, fail case, and the missing-data → notMeasured case.
  6. 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.
  7. 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.json description.
  8. Verify before done: npm run typecheck && npm run test:run green, 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:cli first.
  9. 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 break electron/shared IPC contracts. Additive optional fields only.

Reference Material for the Hint-Coverage Work

  • reports/hints-catalog.json — extracted hint inventory
  • reports/hints-mapping.json — per-hint COVERED/PARTIAL/MISSING verdict with our rule IDs
  • scripts/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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.