answer-beacon

Beacon · SEO & discoverability

answer-beacon

Check that your built static site is ready for answer engines and AI search.

npm i -D @mrlouiswright/answer-beacon

Published to GitHub Packages: add @mrlouiswright:registry=https://npm.pkg.github.com to .npmrc first (installing needs a token with read:packages).

What it checks

  • Direct answersquestion-style headings (What…, How…, …?) must be followed by a paragraph or list that answers them, and the first paragraph should be short enough to quote (--max-answer-words, default 60).
  • FAQ / QAPage / HowTo schemaevery Question needs name and acceptedAnswer.text (QAPage also accepts suggestedAnswer), FAQ questions must be visible on the page, HowTo needs steps with text, and pages answering 3+ questions are nudged to add FAQPage.
  • llms.txtpresent, H1 title, ## sections of - name: notes links, and internal links that exist in the build.
  • AI crawler access in robots.txtGPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, Claude-SearchBot, PerplexityBot and Google-Extended allowed by default (--allow-bots), with --block-bots for crawlers you want kept out (CCBot, Bytespider, ...)…
  • AI meta tagsnoai/noimageai and bot-specific <meta name="GPTBot" content="noindex"> on pages you want quoted.
  • E-E-A-Tarticle-like pages need an author and a date; dateModified must not precede datePublished; homepage Organization/Person/WebSite schema; an About or Contact page.

Quick usage

CLI

npx answer-beacon dist
npx answer-beacon dist --block-bots CCBot,Bytespider --fail-on medium
npx answer-beacon public --allow-bots GPTBot,PerplexityBot --max-answer-words 45
npx answer-beacon out --no-llms-txt --not-articles "/docs/**"

API

import { check, parseRobots, robotsAllows, parseLlmsTxt } from "answer-beacon";
const report = check("dist", { blockBots: ["CCBot"] });
robotsAllows(parseRobots(txt), "GPTBot", "/"); // { allowed, explicit }

Every option is documented in the answer-beacon docs.

CI / GitHub Action

permissions:
  contents: read
  security-events: write   # only needed for the SARIF upload
jobs:
  answer-beacon:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
        with: { persist-credentials: false }
      - run: npm ci && npm run build   # produce the static site first
      - uses: MrLouisWright/answer-beacon@v1
        with:
          path: dist
          fail-on: high
          sarif: answer-beacon.sarif
      - uses: github/codeql-action/upload-sarif@v3
        if: always()
        with: { sarif_file: answer-beacon.sarif }