Sign In

@cjavdev/agent-lint

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cjavdev/agent-lint

Audit websites for AI/agent-friendliness

latest
npmnpm
Version
0.1.0
Version published
Weekly downloads
2
100%
Maintainers
1
Weekly downloads
 
Created
Source

AgentLint

Audit any website for AI-agent friendliness. One command tells you if your site is ready for LLMs, crawlers, and autonomous agents — or what's blocking them.

npx agent-lint https://docs.example.com
AgentLint Report: https://docs.example.com/
────────────────────────────────────────────────────────────

  ✖ No /llms.txt file found                          [discoverability/llms-txt]
  ✖ No markdown representation available              [transport/accept-markdown]
  ⚠ Sitemap not found at /sitemap.xml                 [discoverability/sitemap]
  ⚠ Headings missing anchor IDs (60%)                 [structure/anchor-ids]
  ⚠ Page exceeds 4000 token threshold (est. 8,240)    [tokens/page-token-count]
  ℹ No MCP manifest found                             [agent/mcp-detect]

────────────────────────────────────────────────────────────
  Score: 62 / 100  Grade: D
  2 errors  3 warnings  1 info
  12 pages crawled in 2.4s

Why

LLMs and AI agents are the new consumers of your docs, APIs, and marketing pages. But most sites are optimized for humans and search engines — not machines.

AgentLint checks what agents actually care about:

  • Can they discover your content? (llms.txt, sitemaps, OpenAPI specs)
  • Can they read it efficiently? (markdown support, token counts, boilerplate ratio)
  • Is the structure parseable? (heading hierarchy, anchor IDs, semantic HTML)
  • Are agents welcome? (robots.txt policies, MCP manifests, usage guides)

Install

# Run directly — no install needed
npx agent-lint https://example.com

# Or install globally
npm install -g agent-lint

Requires Node.js 18+.

Usage

# Basic audit
agent-lint https://example.com

# Crawl deeper
agent-lint https://example.com --max-depth 5 --max-pages 100

# JSON output (for CI pipelines)
agent-lint https://example.com --json

# Agent-friendly markdown report
agent-lint https://example.com --agent

CLI Options

FlagDefaultDescription
--max-depth <n>3Maximum crawl depth from the start URL
--max-pages <n>30Maximum number of pages to crawl
--jsonOutput structured JSON (see JSON output)
--agentOutput markdown optimized for LLM consumption

Exit Codes

CodeMeaning
0Audit passed — no errors
1Audit failed — errors found
2Invalid input or execution error

Works in CI out of the box. Non-zero exit on errors means your pipeline fails when agent-friendliness degrades.

Rules

AgentLint ships with 17 rules across 5 categories. Every rule is a pure function — no side effects, no external calls beyond the initial crawl.

Discoverability

RuleSeverityWhat it checks
discoverability/llms-txterror/llms.txt exists (spec)
discoverability/sitemapwarn/sitemap.xml exists
discoverability/openapi-detectinfoOpenAPI spec at common paths
discoverability/structured-datainfoJSON-LD structured data on pages

Transport

RuleSeverityWhat it checks
transport/accept-markdownerrorReturns markdown when Accept: text/markdown is sent
transport/content-type-validwarnResponses have correct Content-Type headers
transport/robots-txtwarnrobots.txt exists and doesn't block AI crawlers

Structure

RuleSeverityWhat it checks
structure/heading-hierarchywarnH1 exists, no skipped heading levels
structure/anchor-idswarnHeadings have anchor IDs for deep linking
structure/semantic-htmlinfoUses <main>, <article>, <section>
structure/meta-descriptioninfoMeta description tag present
structure/lang-attributeinfo<html lang="..."> attribute set

Tokens

RuleSeverityWhat it checks
tokens/page-token-countwarnPage under 4,000 tokens (configurable)
tokens/boilerplate-duplicationwarnLess than 30% repeated nav/header/footer across pages
tokens/nav-ratioinfoNavigation tokens aren't dominating page content

Agent

RuleSeverityWhat it checks
agent/mcp-detectinfo/.well-known/mcp.json manifest exists
agent/agent-usage-guidewarnPages mention AI/agent topics

Scoring

AgentLint produces a numeric score (0–100) and a letter grade:

GradeScoreMeaning
A90–100Agent-ready
B80–89Minor gaps
C70–79Needs work
D60–69Significant issues
F0–59Not agent-friendly

Penalties: each error costs 10 points, each warning costs 4, each info costs 1.

Configuration

Create an agent-lint.config.json in your project root to customize behavior:

{
  "maxDepth": 5,
  "maxPages": 100,
  "tokenThreshold": 8000,
  "rules": {
    "tokens/page-token-count": { "severity": "info" },
    "agent/mcp-detect": { "enabled": false }
  }
}
OptionDefaultDescription
maxDepth3Maximum crawl depth
maxPages30Maximum pages to crawl
tokenThreshold4000Token count before warning fires
rules{}Per-rule overrides (severity or enabled)

JSON Output

The --json flag produces structured output for programmatic use:

{
  "targetUrl": "https://example.com/",
  "score": {
    "score": 75,
    "grade": "C",
    "errors": 1,
    "warnings": 3,
    "infos": 2
  },
  "results": [
    {
      "ruleId": "discoverability/llms-txt",
      "severity": "error",
      "message": "No /llms.txt file found at the site root",
      "url": "https://example.com/llms.txt",
      "remediation": "Create an /llms.txt file per https://llmstxt.org"
    }
  ],
  "pageCount": 12,
  "duration": 2400
}

How It Works

AgentLint runs a linear pipeline:

  • Crawl — Deterministic same-origin crawl. Deduplicates URLs, respects depth/page limits, fetches alternate representations (markdown).
  • Analyze — Builds a SiteContext from crawled pages, auto-discovers and runs all registered rules.
  • Score — Computes score from violations. Starts at 100, subtracts per severity.
  • Report — Formats output for console, JSON, or agent consumption.

Rules never fetch or produce side effects. All data comes from the crawl phase.

License

MIT

FAQs

Package last updated on 13 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts