Skip to content

feat(analyzer): add agent-skill-exposure + migrate to Vitest with pilot coverage#20

Merged
arberx merged 2 commits intomainfrom
arberx/agent-form-check
Apr 17, 2026
Merged

feat(analyzer): add agent-skill-exposure + migrate to Vitest with pilot coverage#20
arberx merged 2 commits intomainfrom
arberx/agent-form-check

Conversation

@arberx
Copy link
Copy Markdown
Member

@arberx arberx commented Apr 17, 2026

Summary

  • New optional agent-skill-exposure analyzer (weight 6): scores whether a page declares its interactive affordances as tools an AI agent can invoke — Schema.org Action markup (with target + query-input/object), MCP / WebMCP / ai-plugin discovery (via <link>, <meta>, or Link header), OpenAPI service-description links, microdata itemprop, and a fallback form-structure score (label coverage, autocomplete tokens, semantic input types, meaningful name attrs, form accessible name, submit text). Wired behind --include-agent-skills.
  • Dispatcher refactor: per-factor opt-in so --include-geo no longer silently enables every optional factor, and --factors <optional-id> now works standalone (previously returned an empty set).
  • Test infrastructure migration to Vitest: pnpm test now runs vitest run, with a test:watch script. All 23 existing tests ported unchanged. E2E suite stays on tsx --test.
  • Pilot fixture-per-branch coverage for the three most critical analyzers:
    • structured-data (weight 12) — 19 tests covering JSON-LD absence/malformed, priority types individually and together, nested @graph, deeply-nested detection, @type arrays, every depth bucket, and recommendation composition.
    • ai-readable-content (weight 10) — 20 tests covering every auxiliary state (ok/missing/timeout/unreachable/not-html) for llms.txt and llms-full.txt, depth bonuses, robots/sitemap branches, head-link variants, and a full-stack clamp check.
    • agent-skill-exposure — 28 tests covering Action well-formed/partial/missing, multi-Action, nested potentialAction, every MCP discovery path (link/meta/header × mcp/webmcp/ai-plugin), OpenAPI link variants, microdata thresholds, strong/partial/weak forms, hidden-only form exclusion, mixed-quality multi-form averaging, and end-to-end composition.

Total: 84 tests (was 23). Typecheck, lint, and build all clean.

Test plan

  • pnpm test — 84 passing
  • pnpm run typecheck
  • pnpm lint
  • pnpm run build
  • Manual smoke: node bin/aeo-audit.js <url> --include-agent-skills on a real page

🤖 Generated with Claude Code

arberx and others added 2 commits April 17, 2026 12:43
Scores whether a page declares its interactive affordances as callable
tools an agent can use: Schema.org Action markup (with target and
query-input/object), MCP / WebMCP / ai-plugin discovery via link/meta/
header, OpenAPI service-description links, microdata itemprop, and a
fallback form-structure score (labels, autocomplete tokens, semantic
input types, meaningful name attrs, accessible form name, submit text).

Wired as optional behind --include-agent-skills. Refactored the
dispatcher to per-factor opt-in so --include-geo no longer silently
enables every optional factor, and --factors <optional-id> now works
standalone.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Move the test runner from node:test (tsx --test) to Vitest and port
the existing 23 tests unchanged. Build out pilot coverage for the
three most critical analyzers — structured-data (weight 12), ai-
readable-content (weight 10) and agent-skill-exposure — with an HTML
or auxiliary-state fixture per scoring branch:

- structured-data: no/malformed/empty JSON-LD, base credit, each
  priority type (LocalBusiness/FAQPage/Service/HowTo), nested @graph,
  deeply-nested Action-type regression, @type arrays, shallow/medium/
  strong depth buckets, recommendation composition.
- ai-readable-content: every auxiliary state (ok/missing/timeout/
  unreachable/not-html) for llms.txt and llms-full.txt, depth bonuses,
  robots/sitemap states, head-link variants, full-stack clamp.
- agent-skill-exposure: Action well-formed / partial / missing,
  multi-Action, nested potentialAction, MCP via link/meta/Link-header
  across mcp/webmcp/ai-plugin, OpenAPI link variants, microdata
  thresholds, strong/partial/weak forms, hidden-only form ignored,
  mixed-quality multi-form averaging, full-stack composition.

Total: 84 tests (was 23). E2E suite stays on tsx --test.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@arberx arberx changed the title feat(analyzer): add optional agent-skill-exposure factor feat(analyzer): add agent-skill-exposure + migrate to Vitest with pilot coverage Apr 17, 2026
@arberx arberx merged commit 3ca401e into main Apr 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant